From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Kishon Vijay Abraham I <kishon@ti.com>
Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>,
Felipe Balbi <balbi@ti.com>,
Vivek Gautam <gautam.vivek@samsung.com>,
linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org
Subject: Re: [PATCHv2 5/6] base: platform: name the device already during allocation
Date: Mon, 14 Jul 2014 07:55:43 -0700 [thread overview]
Message-ID: <20140714145543.GB11477@kroah.com> (raw)
In-Reply-To: <53C3767A.9000203@ti.com>
On Mon, Jul 14, 2014 at 11:49:38AM +0530, Kishon Vijay Abraham I wrote:
> Greg,
>
> On Thursday 05 June 2014 06:22 PM, Heikki Krogerus wrote:
> > This allows resources such as GPIOs and clocks, which can be
> > matched based on the device name when requested, to be
> > assigned even when PLATFORM_DEVID_AUTO is used.
>
> Any comments on this patch?
I thought I rejected it in the past, don't have my email archives
around at the moment, sorry.
> > Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > ---
> > drivers/base/platform.c | 77 ++++++++++++++++++++++++++++++-------------------
> > 1 file changed, 47 insertions(+), 30 deletions(-)
> >
> > diff --git a/drivers/base/platform.c b/drivers/base/platform.c
> > index 9e9227e..e856bc4 100644
> > --- a/drivers/base/platform.c
> > +++ b/drivers/base/platform.c
> > @@ -177,11 +177,45 @@ struct platform_object {
> > */
> > void platform_device_put(struct platform_device *pdev)
> > {
> > - if (pdev)
> > - put_device(&pdev->dev);
> > + if (!pdev)
> > + return;
> > +
> > + if (pdev->id_auto) {
> > + ida_simple_remove(&platform_devid_ida, pdev->id);
> > + pdev->id = PLATFORM_DEVID_AUTO;
> > + }
> > +
> > + put_device(&pdev->dev);
> > }
> > EXPORT_SYMBOL_GPL(platform_device_put);
Why would a single call to this function remove an id? That seems
really wrong, you should be able to call get and put on a device
numerous times, only the "last" reference should cause the device to be
cleaned up.
Shouldn't this be in the release function instead?
thanks,
greg k-h
next prev parent reply other threads:[~2014-07-14 14:56 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-05 12:52 [PATCHv2 0/6] phy: simplified phy lookup Heikki Krogerus
2014-06-05 12:52 ` [PATCHv2 1/6] phy: safer to_phy() macro Heikki Krogerus
2014-06-05 12:52 ` [PATCHv2 2/6] phy: improved lookup method Heikki Krogerus
2014-06-05 12:52 ` [PATCHv2 3/6] arm: omap3: twl: use the new lookup method with usb phy Heikki Krogerus
2014-07-14 6:18 ` Kishon Vijay Abraham I
2014-06-05 12:52 ` [PATCHv2 4/6] phy: remove the old lookup method Heikki Krogerus
2014-06-05 12:52 ` [PATCHv2 5/6] base: platform: name the device already during allocation Heikki Krogerus
2014-07-14 6:19 ` Kishon Vijay Abraham I
2014-07-14 14:55 ` Greg Kroah-Hartman [this message]
2014-08-04 10:00 ` Vivek Gautam
2014-08-05 6:38 ` Heikki Krogerus
2014-06-05 12:52 ` [PATCHv2 6/6] usb: dwc3: host: convey the PHYs to xhci Heikki Krogerus
2014-06-19 13:43 ` Felipe Balbi
2014-06-05 13:21 ` [PATCHv2 0/6] phy: simplified phy lookup Vivek Gautam
2014-07-02 11:31 ` Kishon Vijay Abraham I
2014-07-03 4:59 ` Vivek Gautam
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=20140714145543.GB11477@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=balbi@ti.com \
--cc=gautam.vivek@samsung.com \
--cc=heikki.krogerus@linux.intel.com \
--cc=kishon@ti.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.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
Powered by JetHome