All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: kernel@pengutronix.de, Cornelia Huck <cohuck@redhat.com>,
	Vineeth Vijayan <vneethv@linux.ibm.com>,
	Peter Oberparleiter <oberpar@linux.ibm.com>,
	Heiko Carstens <hca@linux.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	Eric Farman <farman@linux.ibm.com>,
	Matthew Rosato <mjrosato@linux.ibm.com>,
	Halil Pasic <pasic@linux.ibm.com>,
	linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org,
	kvm@vger.kernel.org
Subject: [PATCH v2 1/4] s390/cio: Make struct css_driver::remove return void
Date: Tue,  6 Jul 2021 17:48:00 +0200	[thread overview]
Message-ID: <20210706154803.1631813-2-u.kleine-koenig@pengutronix.de> (raw)
In-Reply-To: <20210706154803.1631813-1-u.kleine-koenig@pengutronix.de>

The driver core ignores the return value of css_remove()
(because there is only little it can do when a device disappears) and
there are no pci_epf_drivers with a remove callback.

So make it impossible for future drivers to return an unused error code
by changing the remove prototype to return void.

The real motivation for this change is the quest to make struct
bus_type::remove return void, too.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/s390/cio/chsc_sch.c     | 3 +--
 drivers/s390/cio/css.c          | 7 ++++---
 drivers/s390/cio/css.h          | 2 +-
 drivers/s390/cio/device.c       | 5 ++---
 drivers/s390/cio/eadm_sch.c     | 4 +---
 drivers/s390/cio/vfio_ccw_drv.c | 3 +--
 6 files changed, 10 insertions(+), 14 deletions(-)

diff --git a/drivers/s390/cio/chsc_sch.c b/drivers/s390/cio/chsc_sch.c
index c42405c620b5..684348d82f08 100644
--- a/drivers/s390/cio/chsc_sch.c
+++ b/drivers/s390/cio/chsc_sch.c
@@ -100,7 +100,7 @@ static int chsc_subchannel_probe(struct subchannel *sch)
 	return ret;
 }
 
-static int chsc_subchannel_remove(struct subchannel *sch)
+static void chsc_subchannel_remove(struct subchannel *sch)
 {
 	struct chsc_private *private;
 
@@ -112,7 +112,6 @@ static int chsc_subchannel_remove(struct subchannel *sch)
 		put_device(&sch->dev);
 	}
 	kfree(private);
-	return 0;
 }
 
 static void chsc_subchannel_shutdown(struct subchannel *sch)
diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c
index a974943c27da..092fd1ea5799 100644
--- a/drivers/s390/cio/css.c
+++ b/drivers/s390/cio/css.c
@@ -1374,12 +1374,13 @@ static int css_probe(struct device *dev)
 static int css_remove(struct device *dev)
 {
 	struct subchannel *sch;
-	int ret;
 
 	sch = to_subchannel(dev);
-	ret = sch->driver->remove ? sch->driver->remove(sch) : 0;
+	if (sch->driver->remove)
+		sch->driver->remove(sch);
 	sch->driver = NULL;
-	return ret;
+
+	return 0;
 }
 
 static void css_shutdown(struct device *dev)
diff --git a/drivers/s390/cio/css.h b/drivers/s390/cio/css.h
index 2eddfc47f687..c98522cbe276 100644
--- a/drivers/s390/cio/css.h
+++ b/drivers/s390/cio/css.h
@@ -81,7 +81,7 @@ struct css_driver {
 	int (*chp_event)(struct subchannel *, struct chp_link *, int);
 	int (*sch_event)(struct subchannel *, int);
 	int (*probe)(struct subchannel *);
-	int (*remove)(struct subchannel *);
+	void (*remove)(struct subchannel *);
 	void (*shutdown)(struct subchannel *);
 	int (*settle)(void);
 };
diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c
index 84f659cafe76..cd5d2d4d8e46 100644
--- a/drivers/s390/cio/device.c
+++ b/drivers/s390/cio/device.c
@@ -137,7 +137,7 @@ static int ccw_uevent(struct device *dev, struct kobj_uevent_env *env)
 
 static void io_subchannel_irq(struct subchannel *);
 static int io_subchannel_probe(struct subchannel *);
-static int io_subchannel_remove(struct subchannel *);
+static void io_subchannel_remove(struct subchannel *);
 static void io_subchannel_shutdown(struct subchannel *);
 static int io_subchannel_sch_event(struct subchannel *, int);
 static int io_subchannel_chp_event(struct subchannel *, struct chp_link *,
@@ -1101,7 +1101,7 @@ static int io_subchannel_probe(struct subchannel *sch)
 	return 0;
 }
 
-static int io_subchannel_remove(struct subchannel *sch)
+static void io_subchannel_remove(struct subchannel *sch)
 {
 	struct io_subchannel_private *io_priv = to_io_private(sch);
 	struct ccw_device *cdev;
@@ -1120,7 +1120,6 @@ static int io_subchannel_remove(struct subchannel *sch)
 			  io_priv->dma_area, io_priv->dma_area_dma);
 	kfree(io_priv);
 	sysfs_remove_group(&sch->dev.kobj, &io_subchannel_attr_group);
-	return 0;
 }
 
 static void io_subchannel_verify(struct subchannel *sch)
diff --git a/drivers/s390/cio/eadm_sch.c b/drivers/s390/cio/eadm_sch.c
index c8964e0a23e7..15bdae5981ca 100644
--- a/drivers/s390/cio/eadm_sch.c
+++ b/drivers/s390/cio/eadm_sch.c
@@ -282,7 +282,7 @@ static void eadm_quiesce(struct subchannel *sch)
 	spin_unlock_irq(sch->lock);
 }
 
-static int eadm_subchannel_remove(struct subchannel *sch)
+static void eadm_subchannel_remove(struct subchannel *sch)
 {
 	struct eadm_private *private = get_eadm_private(sch);
 
@@ -297,8 +297,6 @@ static int eadm_subchannel_remove(struct subchannel *sch)
 	spin_unlock_irq(sch->lock);
 
 	kfree(private);
-
-	return 0;
 }
 
 static void eadm_subchannel_shutdown(struct subchannel *sch)
diff --git a/drivers/s390/cio/vfio_ccw_drv.c b/drivers/s390/cio/vfio_ccw_drv.c
index 9b61e9b131ad..76099bcb765b 100644
--- a/drivers/s390/cio/vfio_ccw_drv.c
+++ b/drivers/s390/cio/vfio_ccw_drv.c
@@ -234,7 +234,7 @@ static int vfio_ccw_sch_probe(struct subchannel *sch)
 	return ret;
 }
 
-static int vfio_ccw_sch_remove(struct subchannel *sch)
+static void vfio_ccw_sch_remove(struct subchannel *sch)
 {
 	struct vfio_ccw_private *private = dev_get_drvdata(&sch->dev);
 	struct vfio_ccw_crw *crw, *temp;
@@ -257,7 +257,6 @@ static int vfio_ccw_sch_remove(struct subchannel *sch)
 	VFIO_CCW_MSG_EVENT(4, "unbound from subchannel %x.%x.%04x\n",
 			   sch->schid.cssid, sch->schid.ssid,
 			   sch->schid.sch_no);
-	return 0;
 }
 
 static void vfio_ccw_sch_shutdown(struct subchannel *sch)
-- 
2.30.2


  reply	other threads:[~2021-07-06 15:52 UTC|newest]

Thread overview: 89+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-06 15:47 [PATCH v2 0/4] bus: Make remove callback return void Uwe Kleine-König
2021-07-06 15:47 ` Uwe Kleine-König
2021-07-06 15:47 ` Uwe Kleine-König
2021-07-06 15:47 ` Uwe Kleine-König
2021-07-06 15:48 ` Uwe Kleine-König [this message]
2021-07-06 15:58   ` [PATCH v2 1/4] s390/cio: Make struct css_driver::remove " Cornelia Huck
2021-07-06 16:05     ` Uwe Kleine-König
2021-07-07 11:28       ` Vineeth Vijayan
2021-07-07 14:34         ` Uwe Kleine-König
2021-07-12 12:13           ` Heiko Carstens
2021-07-06 15:48 ` [PATCH v2 2/4] s390/ccwgroup: Drop if with an always false condition Uwe Kleine-König
2021-07-06 16:04   ` Cornelia Huck
2021-07-07 11:15   ` Vineeth Vijayan
2021-07-06 15:48 ` [PATCH v2 3/4] s390/scm: Make struct scm_driver::remove return void Uwe Kleine-König
2021-07-06 16:05   ` Cornelia Huck
2021-07-07 11:32   ` Vineeth Vijayan
2021-07-06 15:48 ` [PATCH v2 4/4] bus: Make remove callback " Uwe Kleine-König
2021-07-06 15:48   ` Uwe Kleine-König
2021-07-06 15:48   ` Uwe Kleine-König
2021-07-06 15:48   ` Uwe Kleine-König
2021-07-06 16:09   ` Cornelia Huck
2021-07-06 16:09     ` Cornelia Huck
2021-07-06 16:09     ` Cornelia Huck
2021-07-06 16:09     ` Cornelia Huck
2021-07-06 16:09     ` Cornelia Huck
2021-07-06 16:44   ` Rafael J. Wysocki
2021-07-06 16:44     ` Rafael J. Wysocki
2021-07-06 16:44     ` Rafael J. Wysocki
2021-07-06 16:44     ` Rafael J. Wysocki
2021-07-06 16:44     ` Rafael J. Wysocki
2021-07-06 18:08   ` Bjorn Andersson
2021-07-06 18:08     ` Bjorn Andersson
2021-07-06 18:08     ` Bjorn Andersson
2021-07-06 18:08     ` Bjorn Andersson
2021-07-06 18:08     ` Bjorn Andersson
2021-07-06 18:43     ` Uwe Kleine-König
2021-07-06 18:43       ` Uwe Kleine-König
2021-07-06 18:43       ` Uwe Kleine-König
2021-07-06 18:43       ` Uwe Kleine-König
2021-07-06 20:43       ` Bjorn Andersson
2021-07-06 20:43         ` Bjorn Andersson
2021-07-06 20:43         ` Bjorn Andersson
2021-07-06 20:43         ` Bjorn Andersson
2021-07-06 20:43         ` Bjorn Andersson
2021-07-06 18:15   ` Srinivas Pandruvada
2021-07-06 18:15     ` Srinivas Pandruvada
2021-07-06 18:15     ` Srinivas Pandruvada
2021-07-06 18:15     ` Srinivas Pandruvada
2021-07-06 18:32   ` Uwe Kleine-König
2021-07-06 18:32     ` Uwe Kleine-König
2021-07-06 18:32     ` Uwe Kleine-König
2021-07-06 18:32     ` Uwe Kleine-König
2021-07-06 18:51   ` Dan Williams
2021-07-06 18:51     ` Dan Williams
2021-07-06 18:51     ` Dan Williams
2021-07-06 18:51     ` Dan Williams
2021-07-06 18:51     ` Dan Williams
2021-07-06 21:37   ` William Breathitt Gray
2021-07-06 21:37     ` William Breathitt Gray
2021-07-06 21:37     ` William Breathitt Gray
2021-07-06 21:37     ` William Breathitt Gray
2021-07-07  5:57   ` Stefan Richter
2021-07-07 14:24   ` Benjamin Tissoires
2021-07-07 14:24     ` Benjamin Tissoires
2021-07-07 14:24     ` Benjamin Tissoires
2021-07-07 14:24     ` Benjamin Tissoires
2021-07-07 21:51   ` Thorsten Scherer
2021-07-07 21:51     ` Thorsten Scherer
2021-07-07 21:51     ` Thorsten Scherer
2021-07-07 21:51     ` Thorsten Scherer
2021-07-07 21:51     ` Thorsten Scherer
2021-07-08 12:41   ` Ulf Hansson
2021-07-08 12:41     ` Ulf Hansson
2021-07-08 12:41     ` Ulf Hansson
2021-07-08 12:41     ` Ulf Hansson
2021-07-15 12:41   ` Wei Liu
2021-07-15 13:02   ` Thomas Bogendoerfer
2021-07-15 13:02     ` Thomas Bogendoerfer
2021-07-15 13:02     ` Thomas Bogendoerfer
2021-07-15 13:02     ` Thomas Bogendoerfer
2021-07-15 13:02     ` Thomas Bogendoerfer
2021-07-08  2:08 ` [PATCH v2 0/4] " Sven Van Asbroeck
2021-07-08  2:08   ` Sven Van Asbroeck
2021-07-08  2:08   ` Sven Van Asbroeck
2021-07-08  2:08   ` Sven Van Asbroeck
2021-07-08  5:38   ` Uwe Kleine-König
2021-07-08  5:38     ` Uwe Kleine-König
2021-07-08  5:38     ` Uwe Kleine-König
2021-07-08  5:38     ` Uwe Kleine-König

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=20210706154803.1631813-2-u.kleine-koenig@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=borntraeger@de.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=farman@linux.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hca@linux.ibm.com \
    --cc=kernel@pengutronix.de \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=mjrosato@linux.ibm.com \
    --cc=oberpar@linux.ibm.com \
    --cc=pasic@linux.ibm.com \
    --cc=vneethv@linux.ibm.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.