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

zorro: Drop useless (and hardly used) .driver member in struct zorro_dev

The only actual use is to check in zorro_device_probe() that the device
isn't already bound. The driver core already ensures this however so the
check can go away which allows to drop the then assigned-only member
from struct zorro_dev.

If the value was indeed needed somewhere it can always be calculated by

to_zorro_driver(z->dev.driver)

.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20210730191035.1455248-5-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
fac58b4a 18d214cc

+2 -6
+2 -5
drivers/zorro/zorro-driver.c
··· 47 47 struct zorro_driver *drv = to_zorro_driver(dev->driver); 48 48 struct zorro_dev *z = to_zorro_dev(dev); 49 49 50 - if (!z->driver && drv->probe) { 50 + if (drv->probe) { 51 51 const struct zorro_device_id *id; 52 52 53 53 id = zorro_match_device(drv->id_table, z); 54 54 if (id) 55 55 error = drv->probe(z, id); 56 - if (error >= 0) { 57 - z->driver = drv; 56 + if (error >= 0) 58 57 error = 0; 59 - } 60 58 } 61 59 return error; 62 60 } ··· 67 69 68 70 if (drv->remove) 69 71 drv->remove(z); 70 - z->driver = NULL; 71 72 } 72 73 73 74
-1
include/linux/zorro.h
··· 29 29 struct zorro_dev { 30 30 struct ExpansionRom rom; 31 31 zorro_id id; 32 - struct zorro_driver *driver; /* which driver has allocated this device */ 33 32 struct device dev; /* Generic device interface */ 34 33 u16 slotaddr; 35 34 u16 slotsize;