devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Alan Stern <stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.org>
Cc: Tony Prisk <linux-ci5G2KO2hbZ+pU9mqzGVBQ@public.gmane.org>,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	devicetree <devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	linux-usb <linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: Re: [PATCH v6 1/2] ohci-platform: Add support for devicetree instantiation
Date: Wed, 15 Jan 2014 19:58:25 +0100	[thread overview]
Message-ID: <52D6DA51.5050905@redhat.com> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1401151123340.1587-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>

Hi,

On 01/15/2014 05:30 PM, Alan Stern wrote:
> On Wed, 15 Jan 2014, Hans de Goede wrote:
>
>> +static int ohci_platform_power_on(struct platform_device *dev)
>> +{
>> +	struct usb_hcd *hcd = platform_get_drvdata(dev);
>> +	struct ohci_platform_priv *priv = hcd_to_ohci_priv(hcd);
>> +	int clk, ret;
>> +
>> +	for (clk = 0; clk < OHCI_MAX_CLKS && priv->clks[clk]; clk++) {
>
> You fixed this one...
>
>> @@ -125,13 +225,22 @@ static int ohci_platform_remove(struct platform_device *dev)
>>   {
>>   	struct usb_hcd *hcd = platform_get_drvdata(dev);
>>   	struct usb_ohci_pdata *pdata = dev_get_platdata(&dev->dev);
>> +	struct ohci_platform_priv *priv = hcd_to_ohci_priv(hcd);
>> +	int clk;
>>
>>   	usb_remove_hcd(hcd);
>> -	usb_put_hcd(hcd);
>>
>>   	if (pdata->power_off)
>>   		pdata->power_off(dev);
>>
>> +	for (clk = 0; priv->clks[clk] && clk < OHCI_MAX_CLKS; clk++)
>
> but not this one.  :-(  Same for the ehci-platform patch.

Oops, sorry about that, v7 coming up.

> In fact, it might be easier to make this loop go backward, like
> you do in the *_platform_power_off routines.

I prefer keep doing things forward here, the backward loop in
power_off is because the disable_unprepare must be done in reverse
order if the prepare_enable calls.

> Is there a devm-type routine that will take care of all this for you?

Nope, the downside of getting the clocks by index rather then by name
is that there are no devm routines for that.

Regards,

Hans

  parent reply	other threads:[~2014-01-15 18:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-15 16:08 [PATCH v6 0/2] ohci and ehci-platform clks, phy and dt support Hans de Goede
     [not found] ` <1389802104-17330-1-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-01-15 16:08   ` [PATCH v6 1/2] ohci-platform: Add support for devicetree instantiation Hans de Goede
     [not found]     ` <1389802104-17330-2-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-01-15 16:30       ` Alan Stern
     [not found]         ` <Pine.LNX.4.44L0.1401151123340.1587-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2014-01-15 18:58           ` Hans de Goede [this message]
2014-01-15 16:08   ` [PATCH v6 2/2] ehci-platform: Add support for clks and phy passed through devicetree Hans de Goede

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=52D6DA51.5050905@redhat.com \
    --to=hdegoede-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-ci5G2KO2hbZ+pU9mqzGVBQ@public.gmane.org \
    --cc=linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    --cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.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;
as well as URLs for NNTP newsgroup(s).