From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org, kernel@pengutronix.de,
Geert Uytterhoeven <geert@linux-m68k.org>,
linux-m68k@lists.linux-m68k.org
Subject: [PATCH 5/5] zorro: Drop useless (and hardly used) .driver member in struct zorro_dev
Date: Tue, 27 Jul 2021 10:08:40 +0200 [thread overview]
Message-ID: <20210727080840.3550927-6-u.kleine-koenig@pengutronix.de> (raw)
In-Reply-To: <20210727080840.3550927-1-u.kleine-koenig@pengutronix.de>
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>
---
drivers/zorro/zorro-driver.c | 7 ++-----
include/linux/zorro.h | 1 -
2 files changed, 2 insertions(+), 6 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;
}
diff --git a/include/linux/zorro.h b/include/linux/zorro.h
index e2e4de188d84..db7416ed6057 100644
--- a/include/linux/zorro.h
+++ b/include/linux/zorro.h
@@ -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;
--
2.30.2
prev parent reply other threads:[~2021-07-27 8:09 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-27 8:08 [PATCH 0/5] Some cleanups after making bus_type::remove return void Uwe Kleine-König
2021-07-27 8:08 ` [PATCH 1/5] nubus: Simplify check in remove callback Uwe Kleine-König
2021-07-27 9:50 ` Finn Thain
2021-07-27 10:07 ` Geert Uytterhoeven
2021-07-27 10:19 ` Finn Thain
2021-07-27 11:42 ` Uwe Kleine-König
2021-07-31 10:32 ` Finn Thain
2021-07-31 12:05 ` Uwe Kleine-König
2021-07-27 8:08 ` [PATCH 2/5] nubus: Make struct nubus_driver::remove return void Uwe Kleine-König
2021-07-27 9:47 ` Finn Thain
2021-07-27 8:08 ` [PATCH 3/5] sh: superhyway: Simplify check in remove callback Uwe Kleine-König
2021-07-27 8:08 ` [PATCH 4/5] zorro: Simplify " Uwe Kleine-König
2021-07-27 8:08 ` Uwe Kleine-König [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210727080840.3550927-6-u.kleine-koenig@pengutronix.de \
--to=u.kleine-koenig@pengutronix.de \
--cc=geert@linux-m68k.org \
--cc=gregkh@linuxfoundation.org \
--cc=kernel@pengutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-m68k@lists.linux-m68k.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).