Skip to content

Commit 18d214c

Browse files
Uwe Kleine-Königgregkh
authored andcommitted
zorro: Simplify 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 even if it was NULL, to_zorro_driver(NULL) isn't ...) Signed-off-by: Uwe Kleine-König <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent fe976c4 commit 18d214c

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

drivers/zorro/zorro-driver.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,9 @@ static void zorro_device_remove(struct device *dev)
6767
struct zorro_dev *z = to_zorro_dev(dev);
6868
struct zorro_driver *drv = to_zorro_driver(dev->driver);
6969

70-
if (drv) {
71-
if (drv->remove)
72-
drv->remove(z);
73-
z->driver = NULL;
74-
}
70+
if (drv->remove)
71+
drv->remove(z);
72+
z->driver = NULL;
7573
}
7674

7775

0 commit comments

Comments
 (0)