]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
drm/bridge/synopsys: dsi: readl_poll_timeout return value clean up
authorPhilippe CORNU <philippe.cornu@st.com>
Sun, 4 Feb 2018 21:36:24 +0000 (22:36 +0100)
committerAndrzej Hajda <a.hajda@samsung.com>
Mon, 5 Mar 2018 13:08:16 +0000 (14:08 +0100)
The readl_poll_timeout() return value is 0 in case of success
so it is better to detect errors without taking care of the
return value sign.

Signed-off-by: Philippe Cornu <philippe.cornu@st.com>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180204213624.18288-1-philippe.cornu@st.com
drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c

index 7bac101c285cbc2f2b5d8f0442779f8a853ef14e..226171a3ece19415ec7d85b94945d063c70393eb 100644 (file)
@@ -342,7 +342,7 @@ static int dw_mipi_dsi_gen_pkt_hdr_write(struct dw_mipi_dsi *dsi, u32 hdr_val)
        ret = readl_poll_timeout(dsi->base + DSI_CMD_PKT_STATUS,
                                 val, !(val & GEN_CMD_FULL), 1000,
                                 CMD_PKT_STATUS_TIMEOUT_US);
-       if (ret < 0) {
+       if (ret) {
                dev_err(dsi->dev, "failed to get available command FIFO\n");
                return ret;
        }
@@ -353,7 +353,7 @@ static int dw_mipi_dsi_gen_pkt_hdr_write(struct dw_mipi_dsi *dsi, u32 hdr_val)
        ret = readl_poll_timeout(dsi->base + DSI_CMD_PKT_STATUS,
                                 val, (val & mask) == mask,
                                 1000, CMD_PKT_STATUS_TIMEOUT_US);
-       if (ret < 0) {
+       if (ret) {
                dev_err(dsi->dev, "failed to write command FIFO\n");
                return ret;
        }
@@ -385,7 +385,7 @@ static int dw_mipi_dsi_write(struct dw_mipi_dsi *dsi,
                ret = readl_poll_timeout(dsi->base + DSI_CMD_PKT_STATUS,
                                         val, !(val & GEN_PLD_W_FULL), 1000,
                                         CMD_PKT_STATUS_TIMEOUT_US);
-               if (ret < 0) {
+               if (ret) {
                        dev_err(dsi->dev,
                                "failed to get available write payload FIFO\n");
                        return ret;
@@ -721,13 +721,13 @@ static void dw_mipi_dsi_dphy_enable(struct dw_mipi_dsi *dsi)
 
        ret = readl_poll_timeout(dsi->base + DSI_PHY_STATUS, val,
                                 val & PHY_LOCK, 1000, PHY_STATUS_TIMEOUT_US);
-       if (ret < 0)
+       if (ret)
                DRM_DEBUG_DRIVER("failed to wait phy lock state\n");
 
        ret = readl_poll_timeout(dsi->base + DSI_PHY_STATUS,
                                 val, val & PHY_STOP_STATE_CLK_LANE, 1000,
                                 PHY_STATUS_TIMEOUT_US);
-       if (ret < 0)
+       if (ret)
                DRM_DEBUG_DRIVER("failed to wait phy clk lane stop state\n");
 }