diff mbox series

[2/3] driver core: auxiliary bus: make remove function return void

Message ID X8ohB1ks1NK7kPop@kroah.com
State Accepted
Commit 8142a46c50d2dd8160c42284e1044eed3bec0d18
Headers show
Series [resend/standalone,v4] Add auxiliary bus support | expand

Commit Message

Greg Kroah-Hartman Dec. 4, 2020, 11:44 a.m. UTC
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

There's an effort to move the remove() callback in the driver core to
not return an int, as nothing can be done if this function fails.  To
make that effort easier, make the aux bus remove function void to start
with so that no users have to be changed sometime in the future.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 Documentation/driver-api/auxiliary_bus.rst | 2 +-
 drivers/base/auxiliary.c                   | 5 ++---
 include/linux/auxiliary_bus.h              | 2 +-
 3 files changed, 4 insertions(+), 5 deletions(-)

Comments

Greg Kroah-Hartman Dec. 4, 2020, 11:48 a.m. UTC | #1
On Fri, Dec 04, 2020 at 12:44:24PM +0100, Greg KH wrote:
> From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> 
> For some reason, the original aux bus patch had some really long lines
> in a few places, probably due to it being a very long-lived patch in
> development by many different people.  Fix that up so that the two files
> all have the same length lines and function formatting styles.
> 
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
>  drivers/base/Kconfig     |  2 +-
>  drivers/base/auxiliary.c | 58 ++++++++++++++++++++++------------------
>  2 files changed, 33 insertions(+), 27 deletions(-)
> 
> diff --git a/drivers/base/Kconfig b/drivers/base/Kconfig
> index 040be48ce046..ba52b2c40202 100644
> --- a/drivers/base/Kconfig
> +++ b/drivers/base/Kconfig
> @@ -2,7 +2,7 @@
>  menu "Generic Driver Options"
>  
>  config AUXILIARY_BUS
> -	bool
> +	tristate "aux bus!"
>  
>  config UEVENT_HELPER
>  	bool "Support for uevent helper"

Argh, wrong version of this patch, this was added locally for me to test
with, let me fix up and resend a v2 of this patch.

thanks,

greg k-h
diff mbox series

Patch

diff --git a/Documentation/driver-api/auxiliary_bus.rst b/Documentation/driver-api/auxiliary_bus.rst
index 5dd7804631ef..2312506b0674 100644
--- a/Documentation/driver-api/auxiliary_bus.rst
+++ b/Documentation/driver-api/auxiliary_bus.rst
@@ -150,7 +150,7 @@  and shutdown notifications using the standard conventions.
 	struct auxiliary_driver {
 		int (*probe)(struct auxiliary_device *,
                              const struct auxiliary_device_id *id);
-		int (*remove)(struct auxiliary_device *);
+		void (*remove)(struct auxiliary_device *);
 		void (*shutdown)(struct auxiliary_device *);
 		int (*suspend)(struct auxiliary_device *, pm_message_t);
 		int (*resume)(struct auxiliary_device *);
diff --git a/drivers/base/auxiliary.c b/drivers/base/auxiliary.c
index eca36d6284d0..c44e85802b43 100644
--- a/drivers/base/auxiliary.c
+++ b/drivers/base/auxiliary.c
@@ -82,13 +82,12 @@  static int auxiliary_bus_remove(struct device *dev)
 {
 	struct auxiliary_driver *auxdrv = to_auxiliary_drv(dev->driver);
 	struct auxiliary_device *auxdev = to_auxiliary_dev(dev);
-	int ret = 0;
 
 	if (auxdrv->remove)
-		ret = auxdrv->remove(auxdev);
+		auxdrv->remove(auxdev);
 	dev_pm_domain_detach(dev, true);
 
-	return ret;
+	return 0;
 }
 
 static void auxiliary_bus_shutdown(struct device *dev)
diff --git a/include/linux/auxiliary_bus.h b/include/linux/auxiliary_bus.h
index 3580743d0e8d..d67b17606210 100644
--- a/include/linux/auxiliary_bus.h
+++ b/include/linux/auxiliary_bus.h
@@ -19,7 +19,7 @@  struct auxiliary_device {
 
 struct auxiliary_driver {
 	int (*probe)(struct auxiliary_device *auxdev, const struct auxiliary_device_id *id);
-	int (*remove)(struct auxiliary_device *auxdev);
+	void (*remove)(struct auxiliary_device *auxdev);
 	void (*shutdown)(struct auxiliary_device *auxdev);
 	int (*suspend)(struct auxiliary_device *auxdev, pm_message_t state);
 	int (*resume)(struct auxiliary_device *auxdev);