Skip to content

Commit

Permalink
zorro: Simplify 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 even if it was NULL, to_zorro_driver(NULL) isn't ...)

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20210730191035.1455248-4-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 fe976c4 commit 18d214c
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions drivers/zorro/zorro-driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,9 @@ static void zorro_device_remove(struct device *dev)
struct zorro_dev *z = to_zorro_dev(dev);
struct zorro_driver *drv = to_zorro_driver(dev->driver);

if (drv) {
if (drv->remove)
drv->remove(z);
z->driver = NULL;
}
if (drv->remove)
drv->remove(z);
z->driver = NULL;
}


Expand Down

0 comments on commit 18d214c

Please sign in to comment.