From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
To: "Stanley Chang[昌育德]" <stanley_chang@realtek.com>
Cc: Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>
Subject: Re: [PATCH v1 1/2] usb: dwc3: core: add support for remapping global register start address
Date: Tue, 11 Apr 2023 01:27:24 +0000 [thread overview]
Message-ID: <20230411012721.b63dx3oodojby6lf@synopsys.com> (raw)
In-Reply-To: <2e26b5005a4e4efa946cb04898779f08@realtek.com>
On Mon, Apr 10, 2023, Stanley Chang[昌育德] wrote:
>
> > > diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index
> > > 476b63618511..771b35449376 100644
> > > --- a/drivers/usb/dwc3/core.c
> > > +++ b/drivers/usb/dwc3/core.c
> > > @@ -1785,6 +1785,23 @@ static int dwc3_probe(struct platform_device
> > *pdev)
> > > dwc_res = *res;
> > > dwc_res.start += DWC3_GLOBALS_REGS_START;
> > >
> > > + /* For some dwc3 controller, the dwc3 global register start address is
> > > + * not at DWC3_GLOBALS_REGS_START (0xc100).
> > > + */
> >
> > Please use this comment style block:
> > /*
> > * a b c
> > * d e f
> > */
> >
>
> I will follow this rule.
>
> > > + if (dev) {
> >
> > Why do we need this if (dev) check? When would this not be the case?
>
> I want the variable "fixed_dwc3_globals_regs_start" to be a local variable.
> So I added an if statement.
> I can modify it to "if (dev->of_node)" which looks more make sense.
Why? If it's within this function, it's a local variable. Don't create
arbitrary condition just to limit the scope of the variable.
Thanks,
Thinh
>
> >
> > > + int fixed_dwc3_globals_regs_start;
> >
> > Need to initialize this in case you get bogus value when the property is not
> > defined.
>
> Thanks. I will add the initial value.
>
> >
> > > +
> > > + device_property_read_u32(dev,
> > > + "snps,fixed_dwc3_globals_regs_start",
> >
> > Property name should be using "-" instead of "_". Also can we rename it to
> > "snps,global-regs-starting-offset"
> >
> > Thanks,
> > Thinh
> >
>
> I will rename as "snps,global-regs-starting-offset" in next version.
>
> Thanks a lot of.
> Stanley
next prev parent reply other threads:[~2023-04-11 1:27 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-07 6:07 [PATCH v1 1/2] usb: dwc3: core: add support for remapping global register start address Stanley Chang
2023-04-07 6:07 ` [PATCH v1 2/2] dt-bindings: usb: snps,dwc3: Add 'snps,fixed_dwc3_globals_regs_start' quirk Stanley Chang
2023-04-08 2:51 ` Thinh Nguyen
2023-04-10 3:59 ` Stanley Chang[昌育德]
2023-04-08 2:08 ` [PATCH v1 1/2] usb: dwc3: core: add support for remapping global register start address Thinh Nguyen
2023-04-10 4:09 ` Stanley Chang[昌育德]
2023-04-11 1:27 ` Thinh Nguyen [this message]
2023-04-11 3:11 ` Stanley Chang[昌育德]
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=20230411012721.b63dx3oodojby6lf@synopsys.com \
--to=thinh.nguyen@synopsys.com \
--cc=linux-usb@vger.kernel.org \
--cc=stanley_chang@realtek.com \
/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