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

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 <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>

authored by

Uwe Kleine-König and committed by
Greg Kroah-Hartman
18d214cc fe976c4a

+3 -5
+3 -5
drivers/zorro/zorro-driver.c
··· 67 67 struct zorro_dev *z = to_zorro_dev(dev); 68 68 struct zorro_driver *drv = to_zorro_driver(dev->driver); 69 69 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; 75 73 } 76 74 77 75