linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] Some cleanups after making bus_type::remove return void
@ 2021-07-30 19:10 Uwe Kleine-König
  2021-07-30 19:10 ` [PATCH v2 2/4] sh: superhyway: Simplify check in remove callback Uwe Kleine-König
  0 siblings, 1 reply; 2+ messages in thread
From: Uwe Kleine-König @ 2021-07-30 19:10 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: linux-kernel, kernel, Chen-Yu Tsai, Dmitry Torokhov, Finn Thain,
	Geert Uytterhoeven, Pali Rohár, Rich Felker,
	Samuel Iglesias Gonsálvez, linux-m68k, linux-sh

Hello,

compared to (implicit) v1 that can be found at
https://lore.kernel.org/lkml/20210727080840.3550927-1-u.kleine-koenig@pengutronix.de
I rebased on top of
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git's
driver-core-next where Greg already applied one of the patches.

Patch #1 has an updated commit log, the other three patches are
unmodified.

There are no interdependencies between these patches apart from the two
zorro patches. So the patches can also be taken independently by their
respective maintainers.

Uwe Kleine-König (4):
  nubus: Simplify check in remove callback
  sh: superhyway: Simplify check in remove callback
  zorro: Simplify remove callback
  zorro: Drop useless (and hardly used) .driver member in struct
    zorro_dev

 drivers/nubus/bus.c                |  2 +-
 drivers/sh/superhyway/superhyway.c |  2 +-
 drivers/zorro/zorro-driver.c       | 13 ++++---------
 include/linux/zorro.h              |  1 -
 4 files changed, 6 insertions(+), 12 deletions(-)


base-commit: b2c943e52705b211d1aa0633c9196150cf30be47
-- 
2.30.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH v2 2/4] sh: superhyway: Simplify check in remove callback
  2021-07-30 19:10 [PATCH v2 0/4] Some cleanups after making bus_type::remove return void Uwe Kleine-König
@ 2021-07-30 19:10 ` Uwe Kleine-König
  0 siblings, 0 replies; 2+ messages in thread
From: Uwe Kleine-König @ 2021-07-30 19:10 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: linux-kernel, kernel, Rich Felker,
	Samuel Iglesias Gonsálvez, Dmitry Torokhov, Chen-Yu Tsai,
	Pali Rohár, linux-sh

The driver core only calls a remove callback when the device was
successfully bound (aka probed) before. So dev->driver is never NULL.

(And even if it was NULL, to_superhyway_driver(NULL) isn't ...)

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/sh/superhyway/superhyway.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/sh/superhyway/superhyway.c b/drivers/sh/superhyway/superhyway.c
index c0ab904c76ec..44324abe21da 100644
--- a/drivers/sh/superhyway/superhyway.c
+++ b/drivers/sh/superhyway/superhyway.c
@@ -155,7 +155,7 @@ static void superhyway_device_remove(struct device *dev)
 	struct superhyway_device *shyway_dev = to_superhyway_device(dev);
 	struct superhyway_driver *shyway_drv = to_superhyway_driver(dev->driver);
 
-	if (shyway_drv && shyway_drv->remove)
+	if (shyway_drv->remove)
 		shyway_drv->remove(shyway_dev);
 }
 
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-07-30 19:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-30 19:10 [PATCH v2 0/4] Some cleanups after making bus_type::remove return void Uwe Kleine-König
2021-07-30 19:10 ` [PATCH v2 2/4] sh: superhyway: Simplify check in remove callback Uwe Kleine-König

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).