devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dinh Nguyen <dinguyen-yzvPICuk2ABMcg4IHK0kFoH6Mc4MB0Vx@public.gmane.org>
To: John Youn <John.Youn-HKixBCOQz3hWk0Htik3J/w@public.gmane.org>,
	Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
Cc: "dinh.linux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org"
	<dinh.linux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	"balbi-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org"
	<balbi-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	"stefan.wahren-eS4NqCHxEME@public.gmane.org"
	<stefan.wahren-eS4NqCHxEME@public.gmane.org>,
	"linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCHv3 2/2] usb: dwc2: Add reset control to dwc2
Date: Thu, 14 Apr 2016 15:46:57 -0500	[thread overview]
Message-ID: <571001C1.70308@opensource.altera.com> (raw)
In-Reply-To: <570FE01C.3090109-HKixBCOQz3hWk0Htik3J/w@public.gmane.org>

On 04/14/2016 01:23 PM, John Youn wrote:
> On 4/13/2016 7:04 PM, Arnd Bergmann wrote:
>> On Thursday 14 April 2016, dinguyen-yzvPICuk2ABMcg4IHK0kFoH6Mc4MB0Vx@public.gmane.org wrote:
>>> @@ -337,6 +338,17 @@ static int dwc2_lowlevel_hw_init(struct dwc2_hsotg *hsotg)
>>>  {
>>>         int i, ret;
>>>  
>>> +       hsotg->reset = devm_reset_control_get(hsotg->dev, "dwc2");
>>> +       if (IS_ERR(hsotg->reset)) {
>>> +               if (PTR_ERR(hsotg->reset) == -EPROBE_DEFER)
>>> +                       return -EPROBE_DEFER;
>>> +               dev_dbg(hsotg->dev, "Could not get reset control.\n");
>>> +               hsotg->reset = NULL;
>>> +       }
>>> +
>>> +       if(hsotg->reset)
>>> +               reset_control_deassert(hsotg->reset);
>>
>>
>> The error handling seems a bit odd here. If there is a failure to get the
>> reset control and it's actually needed, I would argue the init function should
>> not continue. Conversely, if there was no reset line specified in the
>> device, why even print a message about it?
> 
> Yes it's optional. I think this needs to be checked like the PHY's are
> checked in the same function. That is, by checking for specific error
> codes that indicate a reset control is not specified and continue only
> in that case. All other errors should be returned.
> 
> Dinh, care to make these changes?

Sure, I can make the change.

Dinh
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2016-04-14 20:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-13 22:44 [PATCH 1/2] Documentation: dt-bindings: dwc2: add the resets and reset-names property dinguyen-yzvPICuk2ABMcg4IHK0kFoH6Mc4MB0Vx
     [not found] ` <1460587442-21136-1-git-send-email-dinguyen-yzvPICuk2ABMcg4IHK0kFoH6Mc4MB0Vx@public.gmane.org>
2016-04-13 22:44   ` [PATCHv3 2/2] usb: dwc2: Add reset control to dwc2 dinguyen-yzvPICuk2ABMcg4IHK0kFoH6Mc4MB0Vx
     [not found]     ` <1460587442-21136-2-git-send-email-dinguyen-yzvPICuk2ABMcg4IHK0kFoH6Mc4MB0Vx@public.gmane.org>
2016-04-14  2:04       ` Arnd Bergmann
     [not found]         ` <201604140404.32087.arnd-r2nGTMty4D4@public.gmane.org>
2016-04-14 18:23           ` John Youn
     [not found]             ` <570FE01C.3090109-HKixBCOQz3hWk0Htik3J/w@public.gmane.org>
2016-04-14 20:46               ` Dinh Nguyen [this message]
2016-04-14 16:40   ` [PATCH 1/2] Documentation: dt-bindings: dwc2: add the resets and reset-names property Rob Herring
2016-06-03 15:39     ` Dinh Nguyen

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=571001C1.70308@opensource.altera.com \
    --to=dinguyen-yzvpicuk2abmcg4ihk0kfoh6mc4mb0vx@public.gmane.org \
    --cc=John.Youn-HKixBCOQz3hWk0Htik3J/w@public.gmane.org \
    --cc=arnd-r2nGTMty4D4@public.gmane.org \
    --cc=balbi-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=dinh.linux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=stefan.wahren-eS4NqCHxEME@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).