sh: superhyway: Simplify check in remove callback
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Fri, 30 Jul 2021 19:10:33 +0000 (21:10 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Aug 2021 12:37:03 +0000 (14:37 +0200)
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>
Link: https://lore.kernel.org/r/20210730191035.1455248-3-u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/sh/superhyway/superhyway.c

index c0ab904c76ec6b0c2dcbcc8c7bf3db672010e340..44324abe21dada902ab3920489d39a3b28aff798 100644 (file)
@@ -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);
 }