Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

nubus: Simplify check in remove callback

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>

authored by

Uwe Kleine-König and committed by
Greg Kroah-Hartman
f52c9ccb b2c943e5

+1 -1
+1 -1
drivers/nubus/bus.c
··· 33 33 { 34 34 struct nubus_driver *ndrv = to_nubus_driver(dev->driver); 35 35 36 - if (dev->driver && ndrv->remove) 36 + if (ndrv->remove) 37 37 ndrv->remove(to_nubus_board(dev)); 38 38 } 39 39