Skip to content

Commit fac58b4

Browse files
Uwe Kleine-Königgregkh
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 18d214c commit fac58b4

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

drivers/zorro/zorro-driver.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,14 @@ static int zorro_device_probe(struct device *dev)
4747
struct zorro_driver *drv = to_zorro_driver(dev->driver);
4848
struct zorro_dev *z = to_zorro_dev(dev);
4949

50-
if (!z->driver && drv->probe) {
50+
if (drv->probe) {
5151
const struct zorro_device_id *id;
5252

5353
id = zorro_match_device(drv->id_table, z);
5454
if (id)
5555
error = drv->probe(z, id);
56-
if (error >= 0) {
57-
z->driver = drv;
56+
if (error >= 0)
5857
error = 0;
59-
}
6058
}
6159
return error;
6260
}
@@ -69,7 +67,6 @@ static void zorro_device_remove(struct device *dev)
6967

7068
if (drv->remove)
7169
drv->remove(z);
72-
z->driver = NULL;
7370
}
7471

7572

include/linux/zorro.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
struct zorro_dev {
3030
struct ExpansionRom rom;
3131
zorro_id id;
32-
struct zorro_driver *driver; /* which driver has allocated this device */
3332
struct device dev; /* Generic device interface */
3433
u16 slotaddr;
3534
u16 slotsize;

0 commit comments

Comments
 (0)