From patchwork Tue Jul 13 07:40:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 12373005 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CDC89C07E95 for ; Tue, 13 Jul 2021 07:40:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AFE3561279 for ; Tue, 13 Jul 2021 07:40:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234359AbhGMHnU (ORCPT ); Tue, 13 Jul 2021 03:43:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234333AbhGMHnT (ORCPT ); Tue, 13 Jul 2021 03:43:19 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF00AC0613DD for ; Tue, 13 Jul 2021 00:40:29 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m3D1j-0003xH-SF; Tue, 13 Jul 2021 09:40:23 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1m3D1h-0006Pv-CG; Tue, 13 Jul 2021 09:40:21 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1m3D1h-0000tH-BB; Tue, 13 Jul 2021 09:40:21 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman Cc: kernel@pengutronix.de, Bjorn Helgaas , Kishon Vijay Abraham I , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Lorenzo Pieralisi , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Subject: [PATCH v3 1/5] PCI: endpoint: Make struct pci_epf_driver::remove return void Date: Tue, 13 Jul 2021 09:40:10 +0200 Message-Id: <20210713074014.684791-2-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210713074014.684791-1-u.kleine-koenig@pengutronix.de> References: <20210713074014.684791-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Patch-Hashes: v=1; h=sha256; i=9dRuqNo/F0QuUsC0gOJNJtkYBeA+dIcgMdqc7T89QOM=; m=snXqztb6LzIi8DAPeqNx+9PxnuQ34OAUQf7w5ELTVEo=; p=mQYpkE+33DGoHOLv2dnUwlNBxobIypWigLJdWjDllyE=; g=e5c7b97ea399fddc2695e8cf5d0c02d14175abac X-Patch-Sig: m=pgp; i=uwe@kleine-koenig.org; s=0x0D2511F322BFAB1C1580266BE2DCDD9132669BD6; b=iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAmDtQzQACgkQwfwUeK3K7AmsAwgAgBX Eg3QvGOVoHKutG61D0lZAg0iNugKpWXyEFo77039z7MjKIpe3DPlUUOt3161Uj/ZNx1IU01hqp9pO s/3fhgXIyRXS4egHwKq0FXf3OOagCAHeqU8j8wKd6UzjbOo8idL7ULHhA0Vg8ElK6K+OeBO1V6dDF casP0br39xYNBYV1lnywnpM9JRcx8knhNqxKxTQ6rNxRmGjEJ/JeJcWdeI/bzhHFEKnspg1BbB849 4ZOv4X7hUB7pQduElDi5Mcsol7RP2WxWsCeH9m997I6AorIt7Rm9QuedIA/du/q0o71xLpLh15lb5 tC5XTwKYjrs8CbJvXo2DXMbBySRcYlQ== X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 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-pci@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org The driver core ignores the return value of pci_epf_device_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. Acked-by: Kishon Vijay Abraham I Acked-by: Bjorn Helgaas Signed-off-by: Uwe Kleine-König --- drivers/pci/endpoint/pci-epf-core.c | 5 ++--- include/linux/pci-epf.h | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/pci/endpoint/pci-epf-core.c b/drivers/pci/endpoint/pci-epf-core.c index e9289d10f822..4b9ad96bf1b2 100644 --- a/drivers/pci/endpoint/pci-epf-core.c +++ b/drivers/pci/endpoint/pci-epf-core.c @@ -389,15 +389,14 @@ static int pci_epf_device_probe(struct device *dev) static int pci_epf_device_remove(struct device *dev) { - int ret = 0; struct pci_epf *epf = to_pci_epf(dev); struct pci_epf_driver *driver = to_pci_epf_driver(dev->driver); if (driver->remove) - ret = driver->remove(epf); + driver->remove(epf); epf->driver = NULL; - return ret; + return 0; } static struct bus_type pci_epf_bus_type = { diff --git a/include/linux/pci-epf.h b/include/linux/pci-epf.h index 2debc27ba95e..8292420426f3 100644 --- a/include/linux/pci-epf.h +++ b/include/linux/pci-epf.h @@ -85,7 +85,7 @@ struct pci_epf_ops { */ struct pci_epf_driver { int (*probe)(struct pci_epf *epf); - int (*remove)(struct pci_epf *epf); + void (*remove)(struct pci_epf *epf); struct device_driver driver; struct pci_epf_ops *ops;