diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2021-07-30 22:10:35 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-08-05 15:37:04 +0300 |
commit | fac58b4a5287c9d37c39d09d9bdc80846b744649 (patch) | |
tree | 45c5fb9b0d4871b10d2f70d529ea703a37541c56 /drivers/zorro/zorro-driver.c | |
parent | 18d214cc1d83af5dadf12c383686715497f20571 (diff) | |
download | linux-fac58b4a5287c9d37c39d09d9bdc80846b744649.tar.xz |
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>
Diffstat (limited to 'drivers/zorro/zorro-driver.c')
-rw-r--r-- | drivers/zorro/zorro-driver.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/zorro/zorro-driver.c b/drivers/zorro/zorro-driver.c index ab06c9ce2c78..96f068830549 100644 --- a/drivers/zorro/zorro-driver.c +++ b/drivers/zorro/zorro-driver.c @@ -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; } @@ -69,7 +67,6 @@ static void zorro_device_remove(struct device *dev) if (drv->remove) drv->remove(z); - z->driver = NULL; } |