public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
From: Alexander Stein <alexander.stein@ew.tq-group.com>
To: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Cc: Felipe Balbi <balbi@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org, John Youn <John.Youn@synopsys.com>,
	Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Subject: Re: (EXT) [PATCH] usb: dwc3: drd: Don't check against CONFIG_OF
Date: Thu, 17 Feb 2022 14:50:34 +0100	[thread overview]
Message-ID: <2620260.mvXUDI8C0e@steina-w> (raw)
In-Reply-To: <9f15580ad5810b1e5f31c241b35ebedfbfc30a3f.1644964864.git.Thinh.Nguyen@synopsys.com>

Hi Thinh,

Am Dienstag, 15. Februar 2022, 23:49:48 CET schrieb Thinh Nguyen:
> The CONFIG_OF maybe set, but it may not be applicable to a device. In
> such case, checking against that can cause the device fail to
> initialize. Check against the device node (device->of_node) instead.
> 
> Fixes: a102f07e4edf ("usb: dwc3: drd: Add support for usb-conn-gpio based
> usb-role-switch") Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
> ---
> Note: This patch should go on Greg's "usb-testing" branch as the commit it
> fixes is not in mainline yet.
> 
>  drivers/usb/dwc3/drd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/dwc3/drd.c b/drivers/usb/dwc3/drd.c
> index 25f322e62d3f..b60b5f7b6dff 100644
> --- a/drivers/usb/dwc3/drd.c
> +++ b/drivers/usb/dwc3/drd.c
> @@ -560,7 +560,7 @@ static int dwc3_setup_role_switch(struct dwc3 *dwc)
>  	if (IS_ERR(dwc->role_sw))
>  		return PTR_ERR(dwc->role_sw);
> 
> -	if (IS_ENABLED(CONFIG_OF)) {
> +	if (dwc->dev->of_node) {
>  		/* populate connector entry */
>  		int ret = devm_of_platform_populate(dwc->dev);
> 
> 

Looks reasonable, thanks.

Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
on TQMa8MPxL using DT.

Regards,
Alexander




      reply	other threads:[~2022-02-17 13:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-15 22:49 [PATCH] usb: dwc3: drd: Don't check against CONFIG_OF Thinh Nguyen
2022-02-17 13:50 ` Alexander Stein [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=2620260.mvXUDI8C0e@steina-w \
    --to=alexander.stein@ew.tq-group.com \
    --cc=John.Youn@synopsys.com \
    --cc=Thinh.Nguyen@synopsys.com \
    --cc=balbi@kernel.org \
    --cc=gregkh@linuxfoundation.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