All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Finn Thain <fthain@linux-m68k.org>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 5/5] bus: Make remove callback return void
Date: Wed, 14 Jul 2021 11:12:05 +1000 (AEST)	[thread overview]
Message-ID: <1a4ba24-8bab-47b8-b25d-cc31ce16ca1f@linux-m68k.org> (raw)
In-Reply-To: <20210713193522.1770306-6-u.kleine-koenig@pengutronix.de>

[-- Attachment #1: Type: text/plain, Size: 1394 bytes --]

On Tue, 13 Jul 2021, Uwe Kleine-König wrote:

> The driver core ignores the return value of this callback because there
> is only little it can do when a device disappears.
> 
> This is the final bit of a long lasting cleanup quest where several
> buses were converted to also return void from their remove callback.
> Additionally some resource leaks were fixed that were caused by drivers
> returning an error code in the expectation that the driver won't go
> away.
> 
> With struct bus_type::remove returning void it's prevented that newly
> implemented buses return an ignored error code and so don't anticipate
> wrong expectations for driver authors.
> 

...

> diff --git a/drivers/nubus/bus.c b/drivers/nubus/bus.c
> index ad3d17c42e23..d9d04f27f89b 100644
> --- a/drivers/nubus/bus.c
> +++ b/drivers/nubus/bus.c
> @@ -29,14 +29,12 @@ static int nubus_device_probe(struct device *dev)
>  	return err;
>  }
>  
> -static int nubus_device_remove(struct device *dev)
> +static void nubus_device_remove(struct device *dev)
>  {
>  	struct nubus_driver *ndrv = to_nubus_driver(dev->driver);
> -	int err = -ENODEV;
>  
>  	if (dev->driver && ndrv->remove)
> -		err = ndrv->remove(to_nubus_board(dev));
> -	return err;
> +		ndrv->remove(to_nubus_board(dev));
>  }
>  
>  struct bus_type nubus_bus_type = {

Acked-by: Finn Thain <fthain@linux-m68k.org>

  reply	other threads:[~2021-07-14  1:12 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-13 19:35 [PATCH v4 0/5] bus: Make remove callback return void Uwe Kleine-König
2021-07-13 19:35 ` Uwe Kleine-König
2021-07-13 19:35 ` Uwe Kleine-König
2021-07-13 19:35 ` Uwe Kleine-König
2021-07-13 19:35 ` [PATCH v4 1/5] PCI: endpoint: Make struct pci_epf_driver::remove " Uwe Kleine-König
2021-07-13 19:35 ` [PATCH v4 2/5] s390/cio: Make struct css_driver::remove " Uwe Kleine-König
2021-07-13 19:35 ` [PATCH v4 3/5] s390/ccwgroup: Drop if with an always false condition Uwe Kleine-König
2021-07-13 19:35 ` [PATCH v4 4/5] s390/scm: Make struct scm_driver::remove return void Uwe Kleine-König
2021-07-13 19:35 ` [PATCH v4 5/5] bus: Make remove callback " Uwe Kleine-König
2021-07-13 19:35   ` Uwe Kleine-König
2021-07-13 19:35   ` Uwe Kleine-König
2021-07-13 19:35   ` Uwe Kleine-König
2021-07-14  1:12   ` Finn Thain [this message]
2021-07-14  8:44   ` Geert Uytterhoeven
2021-07-14  8:44     ` Geert Uytterhoeven
2021-07-14  8:44     ` Geert Uytterhoeven
2021-07-14  8:44     ` Geert Uytterhoeven
2021-07-14  8:44     ` Geert Uytterhoeven
2021-07-14 10:25   ` Sudeep Holla
2021-07-14 10:25     ` Sudeep Holla
2021-07-14 10:25     ` Sudeep Holla
2021-07-14 10:25     ` Sudeep Holla
2021-07-14 10:25     ` Sudeep Holla
2021-07-14 19:10   ` Dmitry Torokhov
2021-07-19  8:07   ` Uwe Kleine-König
2021-07-20 20:25   ` Wolfram Sang
2021-07-20 20:25     ` Wolfram Sang
2021-07-20 20:25     ` Wolfram Sang
2021-07-20 20:25     ` Wolfram Sang
2021-07-21 10:09 ` [PATCH v4 0/5] " Greg Kroah-Hartman
2021-07-21 10:09   ` Greg Kroah-Hartman
2021-07-21 10:09   ` Greg Kroah-Hartman
2021-07-21 10:09   ` Greg Kroah-Hartman
2021-07-21 10:09   ` Greg Kroah-Hartman
2021-07-21 10:09   ` Greg Kroah-Hartman
2021-07-22  8:45   ` Greg Kroah-Hartman
2021-07-22  8:45     ` Greg Kroah-Hartman
2021-07-22  8:45     ` Greg Kroah-Hartman
2021-07-22  8:45     ` Greg Kroah-Hartman
2021-07-22  8:45     ` Greg Kroah-Hartman
2021-07-22  8:45     ` Greg Kroah-Hartman

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=1a4ba24-8bab-47b8-b25d-cc31ce16ca1f@linux-m68k.org \
    --to=fthain@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=u.kleine-koenig@pengutronix.de \
    /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.