Re: [PATCH] char: make misc_deregister a void function

Alexandre Belloni
2015-07-31T13:06:10Z

Hi,

On 30/07/2015 at 15:59:57 -0700, Greg Kroah-Hartman wrote :
> From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>
> With well over 200+ users of this api, there are a mere 12 users that
> actually cheked the return value of this function. And all of them
^
small typo here

> really didn't do anything with that information as the system or module
> was shutting down no matter what.
>
> So stop pretending like it matters, and just return void from
> misc_deregister(). If something goes wrong in the call, you will get a
> WARNING splat in the syslog so you know how to fix up your driver.
> Other than that, there's nothing that can go wrong.
>
> Cc: Alasdair Kergon <agk@redhat.com>
> Cc: Mike Snitzer <snitzer@redhat.com>
> Cc: Neil Brown <neilb@suse.com>
> Cc: Alessandro Zummo <a.zummo@towertech.it>
> Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> Cc: Oleg Drokin <oleg.drokin@intel.com>
> Cc: Andreas Dilger <andreas.dilger@intel.com>
> Cc: "Michael S. Tsirkin" <mst@redhat.com>
> Cc: Wim Van Sebroeck <wim@iguana.be>
> Cc: Christine Caulfield <ccaulfie@redhat.com>
> Cc: David Teigland <teigland@redhat.com>
> Cc: Mark Fasheh <mfasheh@suse.com>
> Cc: Joel Becker <jlbec@evilplan.org>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

For rtc and at91rm9200_wdt.c:
Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>

[...]

> --- a/drivers/watchdog/at91rm9200_wdt.c
> +++ b/drivers/watchdog/at91rm9200_wdt.c
> @@ -269,9 +269,8 @@ static int at91wdt_remove(struct platfor
> if (res)
> dev_warn(dev, "failed to unregister restart handler\n");
>
> - res = misc_deregister(&at91wdt_miscdev);
> - if (!res)
> - at91wdt_miscdev.parent = NULL;
> + misc_deregister(&at91wdt_miscdev);
> + at91wdt_miscdev.parent = NULL;
>
> return res;

That one was actually doing something with the return value ;)

--
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering