diff mbox series

drm/sun4i: dsi: delete unnecessary IS_ERR() checks

Message ID YmqH71MtoGn2AXUg@kili (mailing list archive)
State New, archived
Headers show
Series drm/sun4i: dsi: delete unnecessary IS_ERR() checks | expand

Commit Message

Dan Carpenter April 28, 2022, 12:26 p.m. UTC
The "dsi->bus_clk" pointer cannot be an error pointer at this point.
The check is confusing and unnecessary.  Delete it.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Comments

Maxime Ripard April 29, 2022, 2:45 p.m. UTC | #1
On Thu, 28 Apr 2022 15:26:23 +0300, Dan Carpenter wrote:
> The "dsi->bus_clk" pointer cannot be an error pointer at this point.
> The check is confusing and unnecessary.  Delete it.
> 
> 

Applied to drm/drm-misc (drm-misc-next).

Thanks!
Maxime
diff mbox series

Patch

diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c
index 527c7b2474da..b4dfa166eccd 100644
--- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c
+++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c
@@ -1193,8 +1193,8 @@  static int sun6i_dsi_probe(struct platform_device *pdev)
 err_unprotect_clk:
 	clk_rate_exclusive_put(dsi->mod_clk);
 err_attach_clk:
-	if (!IS_ERR(dsi->bus_clk))
-		regmap_mmio_detach_clk(dsi->regs);
+	regmap_mmio_detach_clk(dsi->regs);
+
 	return ret;
 }
 
@@ -1207,8 +1207,7 @@  static int sun6i_dsi_remove(struct platform_device *pdev)
 	mipi_dsi_host_unregister(&dsi->host);
 	clk_rate_exclusive_put(dsi->mod_clk);
 
-	if (!IS_ERR(dsi->bus_clk))
-		regmap_mmio_detach_clk(dsi->regs);
+	regmap_mmio_detach_clk(dsi->regs);
 
 	return 0;
 }