linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Chen <peter.chen@nxp.com>
To: Roger Quadros <rogerq@ti.com>
Cc: Pawel Laszczak <pawell@cadence.com>,
	"balbi@kernel.org" <balbi@kernel.org>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Rahul Kumar <kurahul@cadence.com>
Subject: Re: [PATCH v2] usb: cdns3: Rids of duplicate error message
Date: Mon, 12 Oct 2020 12:18:59 +0000	[thread overview]
Message-ID: <20201012121831.GA17965@b29397-desktop> (raw)
In-Reply-To: <ab93c402-f721-d780-654b-7b74bc5b2ab1@ti.com>

On 20-10-12 14:38:16, Roger Quadros wrote:
> Pawel,
> 
> On 12/10/2020 14:12, Pawel Laszczak wrote:
> > Hi Roger,
> > 
> > On 12/10/2020 09:42, Pawel Laszczak wrote:
> > > On failure, the platform_get_irq_byname prints an error message
> > > so, patch removes error message related to this function from
> > > core.c file.
> > > 
> > > A change was suggested during reviewing CDNSP driver by Chunfeng Yun.
> > > 
> > > Signed-off-by: Pawel Laszczak <pawell@cadence.com>
> > > ---
> > > Changelog:
> > > v2
> > > - simplified code as sugested by Roger Quadros.
> > > 
> > >    drivers/usb/cdns3/core.c | 10 +---------
> > >    1 file changed, 1 insertion(+), 9 deletions(-)
> > > 
> > > diff --git a/drivers/usb/cdns3/core.c b/drivers/usb/cdns3/core.c
> > > index a0f73d4711ae..85ef3025b293 100644
> > > --- a/drivers/usb/cdns3/core.c
> > > +++ b/drivers/usb/cdns3/core.c
> > > @@ -469,22 +469,14 @@ static int cdns3_probe(struct platform_device *pdev)
> > >    	if (cdns->dev_irq == -EPROBE_DEFER)
> > 
> > Shouldn't this be
> > 	if (cdns->dev_irq < 0)
> > ?
> > 
> > No, such line will change the original behavior of driver.
> > 
> > Current patch allows to run driver when we support only host.
> > In such case the dev_irq can be < 0 and we still can use host  side.
> 
> In that case should we check if we need dev_irq and if so then error out.
> i.e. if mode is "peripheral" or "otg"
> 
> Also DT binding document says all 3 IRQs are mandatory. Do we need to update that?
> 

I agree with Roger, or you change the driver behaviour that return error
if the dev_irq is < 0.

Peter
> 
> > 
> > Regards,
> > Pawel Laszczak
> > 
> > >    		return cdns->dev_irq;
> > > -	if (cdns->dev_irq < 0)
> > > -		dev_err(dev, "couldn't get peripheral irq\n");
> > > -
> > >    	regs = devm_platform_ioremap_resource_byname(pdev, "dev");
> > >    	if (IS_ERR(regs))
> > >    		return PTR_ERR(regs);
> > >    	cdns->dev_regs	= regs;
> > >    	cdns->otg_irq = platform_get_irq_byname(pdev, "otg");
> > > -	if (cdns->otg_irq == -EPROBE_DEFER)
> > > -		return cdns->otg_irq;
> > > -
> > > -	if (cdns->otg_irq < 0) {
> > > -		dev_err(dev, "couldn't get otg irq\n");
> > > +	if (cdns->otg_irq < 0)
> > >    		return cdns->otg_irq;
> > > -	}
> > >    	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "otg");
> > >    	if (!res) {
> > > 
> > 
> 
> -- 
> Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
> Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

-- 

Thanks,
Peter Chen

  reply	other threads:[~2020-10-12 12:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-12  6:42 [PATCH v2] usb: cdns3: Rids of duplicate error message Pawel Laszczak
2020-10-12  8:16 ` Roger Quadros
2020-10-12 11:12   ` Pawel Laszczak
2020-10-12 11:38     ` Roger Quadros
2020-10-12 12:18       ` Peter Chen [this message]
2020-10-12 12:26         ` Pawel Laszczak

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=20201012121831.GA17965@b29397-desktop \
    --to=peter.chen@nxp.com \
    --cc=balbi@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=kurahul@cadence.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=pawell@cadence.com \
    --cc=rogerq@ti.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;
as well as URLs for NNTP newsgroup(s).