nubus: Simplify check in remove callback
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Fri, 30 Jul 2021 19:10:32 +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
the respective check can just be dropped.

Acked-by: Finn Thain <fthain@linux-m68k.org>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20210730191035.1455248-2-u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/nubus/bus.c

index d9d04f2..17fad66 100644 (file)
@@ -33,7 +33,7 @@ static void nubus_device_remove(struct device *dev)
 {
        struct nubus_driver *ndrv = to_nubus_driver(dev->driver);
 
-       if (dev->driver && ndrv->remove)
+       if (ndrv->remove)
                ndrv->remove(to_nubus_board(dev));
 }