public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jingoo Han <jg1.han@samsung.com>
To: "'Dmitry Torokhov'" <dmitry.torokhov@gmail.com>
Cc: "'Andrew Morton'" <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org, "'Tejun Heo'" <tj@kernel.org>,
	"'Greg KH'" <greg@kroah.com>,
	"'Alessandro Zummo'" <a.zummo@towertech.it>,
	rtc-linux@googlegroups.com, "'Jingoo Han'" <jg1.han@samsung.com>
Subject: Re: [PATCH V2] rtc: add devm_rtc_device_{register,unregister}()
Date: Wed, 27 Feb 2013 11:12:17 +0900	[thread overview]
Message-ID: <007601ce148f$ddce3280$996a9780$%han@samsung.com> (raw)
In-Reply-To: <20130226223304.GB20670@core.coreip.homeip.net>

On Wednesday, February 27, 2013 7:33 AM, Dmitry Torokhov wrote:
> 
> On Tue, Feb 26, 2013 at 10:21:06AM +0900, Jingoo Han wrote:
> > +/**
> > + * devm_rtc_device_unregister - resource managed devm_rtc_device_unregister()
> > + * @dev: the device to unregister
> > + * @rtc: the RTC class device to unregister
> > + *
> > + * Deallocated a rtc allocated with devm_rtc_device_register(). Normally this
> > + * function will not need to be called and the resource management code will
> > + * ensure that the resource is freed.
> > + */
> > +void devm_rtc_device_unregister(struct device *dev, struct rtc_device *rtc)
> 
> Why do you need a separate function? You can add a flag to struct rtc_device
> so it knows whether it is devm-managed or not and behave accordingly.
> And then you can do
> 
> #define devm_rtc_device_unregister rtc_device_unregister

Um, I don't prefer that way using additional a flag.

Also, most of other devm_* functions are using a separate functions
such as devm_pwm_put(), devm_regulator_put(),devm_usb_put_phy(), etc.


> 
> Thanks.
> 
> --
> Dmitry


      reply	other threads:[~2013-02-27  2:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-26  1:21 [PATCH V2] rtc: add devm_rtc_device_{register,unregister}() Jingoo Han
2013-02-26  1:23 ` 'Tejun Heo'
2013-02-26  1:30   ` 'Tejun Heo'
2013-02-26  1:42     ` Jingoo Han
2013-02-26 22:33 ` Dmitry Torokhov
2013-02-27  2:12   ` Jingoo Han [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='007601ce148f$ddce3280$996a9780$%han@samsung.com' \
    --to=jg1.han@samsung.com \
    --cc=a.zummo@towertech.it \
    --cc=akpm@linux-foundation.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rtc-linux@googlegroups.com \
    --cc=tj@kernel.org \
    /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