Skip to content

Commit

Permalink
nubus: Simplify check in remove callback
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Uwe Kleine-König authored and Greg Kroah-Hartman committed Aug 5, 2021
1 parent b2c943e commit f52c9cc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/nubus/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand Down

0 comments on commit f52c9cc

Please sign in to comment.