Skip to content

Commit

Permalink
zorro: Drop useless (and hardly used) .driver member in struct zorro_dev
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Uwe Kleine-König authored and Greg Kroah-Hartman committed Aug 5, 2021
1 parent 18d214c commit fac58b4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
7 changes: 2 additions & 5 deletions drivers/zorro/zorro-driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,14 @@ static int zorro_device_probe(struct device *dev)
struct zorro_driver *drv = to_zorro_driver(dev->driver);
struct zorro_dev *z = to_zorro_dev(dev);

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

id = zorro_match_device(drv->id_table, z);
if (id)
error = drv->probe(z, id);
if (error >= 0) {
z->driver = drv;
if (error >= 0)
error = 0;
}
}
return error;
}
Expand All @@ -69,7 +67,6 @@ static void zorro_device_remove(struct device *dev)

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


Expand Down
1 change: 0 additions & 1 deletion include/linux/zorro.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
struct zorro_dev {
struct ExpansionRom rom;
zorro_id id;
struct zorro_driver *driver; /* which driver has allocated this device */
struct device dev; /* Generic device interface */
u16 slotaddr;
u16 slotsize;
Expand Down

0 comments on commit fac58b4

Please sign in to comment.