diff mbox series

[3/5] sh: superhyway: Simplify check in remove callback

Message ID 20210727080840.3550927-4-u.kleine-koenig@pengutronix.de (mailing list archive)
State New, archived
Headers show
Series Some cleanups after making bus_type::remove return void | expand

Commit Message

Uwe Kleine-König July 27, 2021, 8:08 a.m. UTC
The driver core only calls a remove callback when the device was
successfully bound (aka probed) before. So dev->driver is never NULL.

(And even if it was NULL, to_superhyway_driver(NULL) isn't ...)

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/sh/superhyway/superhyway.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/sh/superhyway/superhyway.c b/drivers/sh/superhyway/superhyway.c
index c0ab904c76ec..44324abe21da 100644
--- a/drivers/sh/superhyway/superhyway.c
+++ b/drivers/sh/superhyway/superhyway.c
@@ -155,7 +155,7 @@  static void superhyway_device_remove(struct device *dev)
 	struct superhyway_device *shyway_dev = to_superhyway_device(dev);
 	struct superhyway_driver *shyway_drv = to_superhyway_driver(dev->driver);
 
-	if (shyway_drv && shyway_drv->remove)
+	if (shyway_drv->remove)
 		shyway_drv->remove(shyway_dev);
 }