Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp4777892pxv; Tue, 6 Jul 2021 08:56:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwZQ1ue8Nse50GtBBcyVyuJcIk28NMUnXrQL1pqHQwfnClR1RPFvpg5MtFAlrLADnLXXFub X-Received: by 2002:a05:6402:1c06:: with SMTP id ck6mr23931169edb.287.1625586996813; Tue, 06 Jul 2021 08:56:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625586996; cv=none; d=google.com; s=arc-20160816; b=flBWbUIZLXO6MJfUFjMS2AX+sAFyT3EzL1IGV91F1q39hfc+8IIbfLiq3YUKFL502m 92MFz/aFD4XQ8eOARZcHCgslvRPdlyKLSK65x9rfAG68eY2NiN/D1urS/tEDLngc6Ydx usd3agRQEf4st4CvyONliSj2Bk0HHNhqmTmROGrJl0U7xLsp/tIwxFMaRG7Kh5gezJRD hMIsQQHPkO3KR7kYZrYrLIPnpHr4Y2Sf6O4YFrlJJccIhKif2HMDldWdJ6vLVDfAzzYq BM0RW9ZjH2iYSf7EiZFUs1dR5JJsXS2kZOm/yKZb49xa8shZ6wt61hSGu+kcxGTttlnr jU3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=yeLvR6x40VfXAeEhqeVHe4qQHpqZGz7E3t1SSN2hcJE=; b=N+vyHA4pxkPrw77OkAI0NFhNnHmj9/A4yJ+hvJRt68c7ltqnMWjeCp+5r4GtZjZ4U0 43m/1e2kZdd5z9G+6mnXwfN/t+xU9/dXLJGmJvENjnLp0k0mm1NC+V2AB0vqeJcoWKke iJRscDbKgTKt5HXti7FAcdAxggDVvy0Zq9xWPY8OqJogi25EOUsyd56b0dYmFeqytjLO F0Yd7Snd4D30tS/+znE7nOhypuFPMxi9NTlQ3fyyzLWrhHZ2CGNQJuvzFkEtw688VlIl dJtA31Bq5d+d69qCCphkiBQwPHdAyVOwY7HgyCEoXheidYlA7F4BwLzbHo/loTF1C4IU NiWA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e18si3544593edz.11.2021.07.06.08.56.08; Tue, 06 Jul 2021 08:56:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232757AbhGFPz3 (ORCPT + 99 others); Tue, 6 Jul 2021 11:55:29 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:47347 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232749AbhGFPz3 (ORCPT ); Tue, 6 Jul 2021 11:55:29 -0400 Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m0nL8-0007mM-BN; Tue, 06 Jul 2021 17:50:26 +0200 Received: from ukl by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1m0nL6-0005Sm-5I; Tue, 06 Jul 2021 17:50:24 +0200 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman Cc: kernel@pengutronix.de, Cornelia Huck , Vineeth Vijayan , Peter Oberparleiter , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Eric Farman , Matthew Rosato , Halil Pasic , 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 Message-Id: <20210706154803.1631813-2-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210706154803.1631813-1-u.kleine-koenig@pengutronix.de> References: <20210706154803.1631813-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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