Linux-USB Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH v4] usb: cdns3: Rids of duplicate error message
@ 2020-10-15  4:54 Pawel Laszczak
  2020-10-15 11:29 ` Roger Quadros
  0 siblings, 1 reply; 2+ messages in thread
From: Pawel Laszczak @ 2020-10-15  4:54 UTC (permalink / raw)
  To: peter.chen
  Cc: balbi, rogerq, gregkh, linux-usb, linux-kernel, kurahul, Pawel Laszczak

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>
Acked-by: Peter Chen <peter.chen@nxp.com>
---
Changelog:
v4
- fixed typo.
- "Acked-by" tag has been added.
v3
- changed error condition checking for dev_irq.
v2
- simplified code as sugested by Roger Quadros.

 drivers/usb/cdns3/core.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/drivers/usb/cdns3/core.c b/drivers/usb/cdns3/core.c
index a0f73d4711ae..f2dedce3a40e 100644
--- a/drivers/usb/cdns3/core.c
+++ b/drivers/usb/cdns3/core.c
@@ -466,11 +466,8 @@ static int cdns3_probe(struct platform_device *pdev)
 	cdns->xhci_res[1] = *res;
 
 	cdns->dev_irq = platform_get_irq_byname(pdev, "peripheral");
-	if (cdns->dev_irq == -EPROBE_DEFER)
-		return cdns->dev_irq;
-
 	if (cdns->dev_irq < 0)
-		dev_err(dev, "couldn't get peripheral irq\n");
+		return cdns->dev_irq;
 
 	regs = devm_platform_ioremap_resource_byname(pdev, "dev");
 	if (IS_ERR(regs))
@@ -478,14 +475,9 @@ static int cdns3_probe(struct platform_device *pdev)
 	cdns->dev_regs	= regs;
 
 	cdns->otg_irq = platform_get_irq_byname(pdev, "otg");
-	if (cdns->otg_irq == -EPROBE_DEFER)
+	if (cdns->otg_irq < 0)
 		return cdns->otg_irq;
 
-	if (cdns->otg_irq < 0) {
-		dev_err(dev, "couldn't get otg irq\n");
-		return cdns->otg_irq;
-	}
-
 	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "otg");
 	if (!res) {
 		dev_err(dev, "couldn't get otg resource\n");
-- 
2.17.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v4] usb: cdns3: Rids of duplicate error message
  2020-10-15  4:54 [PATCH v4] usb: cdns3: Rids of duplicate error message Pawel Laszczak
@ 2020-10-15 11:29 ` Roger Quadros
  0 siblings, 0 replies; 2+ messages in thread
From: Roger Quadros @ 2020-10-15 11:29 UTC (permalink / raw)
  To: Pawel Laszczak, peter.chen
  Cc: balbi, gregkh, linux-usb, linux-kernel, kurahul



On 15/10/2020 07:54, 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>
> Acked-by: Peter Chen <peter.chen@nxp.com>

Acked-by: Roger Quadros <rogerq@ti.com>

> ---
> Changelog:
> v4
> - fixed typo.
> - "Acked-by" tag has been added.
> v3
> - changed error condition checking for dev_irq.
> v2
> - simplified code as sugested by Roger Quadros.
> 
>   drivers/usb/cdns3/core.c | 12 ++----------
>   1 file changed, 2 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/usb/cdns3/core.c b/drivers/usb/cdns3/core.c
> index a0f73d4711ae..f2dedce3a40e 100644
> --- a/drivers/usb/cdns3/core.c
> +++ b/drivers/usb/cdns3/core.c
> @@ -466,11 +466,8 @@ static int cdns3_probe(struct platform_device *pdev)
>   	cdns->xhci_res[1] = *res;
>   
>   	cdns->dev_irq = platform_get_irq_byname(pdev, "peripheral");
> -	if (cdns->dev_irq == -EPROBE_DEFER)
> -		return cdns->dev_irq;
> -
>   	if (cdns->dev_irq < 0)
> -		dev_err(dev, "couldn't get peripheral irq\n");
> +		return cdns->dev_irq;
>   
>   	regs = devm_platform_ioremap_resource_byname(pdev, "dev");
>   	if (IS_ERR(regs))
> @@ -478,14 +475,9 @@ static int cdns3_probe(struct platform_device *pdev)
>   	cdns->dev_regs	= regs;
>   
>   	cdns->otg_irq = platform_get_irq_byname(pdev, "otg");
> -	if (cdns->otg_irq == -EPROBE_DEFER)
> +	if (cdns->otg_irq < 0)
>   		return cdns->otg_irq;
>   
> -	if (cdns->otg_irq < 0) {
> -		dev_err(dev, "couldn't get otg irq\n");
> -		return cdns->otg_irq;
> -	}
> -
>   	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "otg");
>   	if (!res) {
>   		dev_err(dev, "couldn't get otg resource\n");
> 

-- 
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-15  4:54 [PATCH v4] usb: cdns3: Rids of duplicate error message Pawel Laszczak
2020-10-15 11:29 ` Roger Quadros

Linux-USB Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-usb/0 linux-usb/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-usb linux-usb/ https://lore.kernel.org/linux-usb \
		linux-usb@vger.kernel.org
	public-inbox-index linux-usb

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-usb


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git