linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: William Breathitt Gray <vilhelm.gray@gmail.com>
Cc: wim@iguana.be, linux-watchdog@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] watchdog: ebc-c384_wdt: Utilize devm_ functions in driver probe callback
Date: Tue, 24 Jan 2017 13:52:34 -0800	[thread overview]
Message-ID: <20170124215234.GB9359@roeck-us.net> (raw)
In-Reply-To: <20170124203619.21099-1-vilhelm.gray@gmail.com>

On Tue, Jan 24, 2017 at 03:36:19PM -0500, William Breathitt Gray wrote:
> The devm_ resource manager functions allow memory to be automatically
> released when a device is unbound. This patch takes advantage of the
> resource manager functions and replaces the watchdog_register_device
> call with the devm_watchdog_register_device call. In addition, the
> ebc_c384_wdt_remove function has been removed as no longer necessary due
> to the use of the relevant devm_ resource manager functions.
> 
> Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
> ---
>  drivers/watchdog/ebc-c384_wdt.c | 12 +-----------
>  1 file changed, 1 insertion(+), 11 deletions(-)
> 
> diff --git a/drivers/watchdog/ebc-c384_wdt.c b/drivers/watchdog/ebc-c384_wdt.c
> index 4b849b8e..de135dff 100644
> --- a/drivers/watchdog/ebc-c384_wdt.c
> +++ b/drivers/watchdog/ebc-c384_wdt.c
> @@ -123,16 +123,7 @@ static int ebc_c384_wdt_probe(struct device *dev, unsigned int id)
>  
>  	dev_set_drvdata(dev, wdd);

Unless I am missing something, this is no longer needed.

Thanks,
Guenter

>  
> -	return watchdog_register_device(wdd);
> -}
> -
> -static int ebc_c384_wdt_remove(struct device *dev, unsigned int id)
> -{
> -	struct watchdog_device *wdd = dev_get_drvdata(dev);
> -
> -	watchdog_unregister_device(wdd);
> -
> -	return 0;
> +	return devm_watchdog_register_device(dev, wdd);
>  }
>  
>  static struct isa_driver ebc_c384_wdt_driver = {
> @@ -140,7 +131,6 @@ static struct isa_driver ebc_c384_wdt_driver = {
>  	.driver = {
>  		.name = MODULE_NAME
>  	},
> -	.remove = ebc_c384_wdt_remove
>  };
>  
>  static int __init ebc_c384_wdt_init(void)
> -- 
> 2.11.0
> 

      reply	other threads:[~2017-01-24 21:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-24 20:36 [PATCH] watchdog: ebc-c384_wdt: Utilize devm_ functions in driver probe callback William Breathitt Gray
2017-01-24 21:52 ` Guenter Roeck [this message]

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=20170124215234.GB9359@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=vilhelm.gray@gmail.com \
    --cc=wim@iguana.be \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).