linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] usb: cdns3: Rids of duplicate error message
@ 2020-10-07  3:35 Pawel Laszczak
  2020-10-07  8:11 ` Roger Quadros
  0 siblings, 1 reply; 4+ messages in thread
From: Pawel Laszczak @ 2020-10-07  3:35 UTC (permalink / raw)
  To: balbi
  Cc: peter.chen, 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>
---
 drivers/usb/cdns3/core.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/usb/cdns3/core.c b/drivers/usb/cdns3/core.c
index a0f73d4711ae..4fd3c742d9d5 100644
--- a/drivers/usb/cdns3/core.c
+++ b/drivers/usb/cdns3/core.c
@@ -469,9 +469,6 @@ static int cdns3_probe(struct platform_device *pdev)
 	if (cdns->dev_irq == -EPROBE_DEFER)
 		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);
@@ -481,10 +478,8 @@ static int cdns3_probe(struct platform_device *pdev)
 	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) {
-- 
2.17.1


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

* Re: [PATCH 1/2] usb: cdns3: Rids of duplicate error message
  2020-10-07  3:35 [PATCH 1/2] usb: cdns3: Rids of duplicate error message Pawel Laszczak
@ 2020-10-07  8:11 ` Roger Quadros
  2020-10-08  4:18   ` Pawel Laszczak
  0 siblings, 1 reply; 4+ messages in thread
From: Roger Quadros @ 2020-10-07  8:11 UTC (permalink / raw)
  To: Pawel Laszczak, balbi
  Cc: peter.chen, gregkh, linux-usb, linux-kernel, kurahul

Pawel,

On 07/10/2020 06:35, 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>
> ---
>   drivers/usb/cdns3/core.c | 7 +------
>   1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/drivers/usb/cdns3/core.c b/drivers/usb/cdns3/core.c
> index a0f73d4711ae..4fd3c742d9d5 100644
> --- a/drivers/usb/cdns3/core.c
> +++ b/drivers/usb/cdns3/core.c
> @@ -469,9 +469,6 @@ static int cdns3_probe(struct platform_device *pdev)
>   	if (cdns->dev_irq == -EPROBE_DEFER)

if (cdns->dev_irq < 0 && cdns->dev_irq == -EPROBE_DEFER)

>   		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);
> @@ -481,10 +478,8 @@ static int cdns3_probe(struct platform_device *pdev)
>   	if (cdns->otg_irq == -EPROBE_DEFER)

if (cdns->otg_irq < 0 && 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)

you can then get rid of this if {}.

>   		return cdns->otg_irq;
> -	}
>   
>   	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "otg");
>   	if (!res) {
> 

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

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

* RE: [PATCH 1/2] usb: cdns3: Rids of duplicate error message
  2020-10-07  8:11 ` Roger Quadros
@ 2020-10-08  4:18   ` Pawel Laszczak
  2020-10-08  7:28     ` Roger Quadros
  0 siblings, 1 reply; 4+ messages in thread
From: Pawel Laszczak @ 2020-10-08  4:18 UTC (permalink / raw)
  To: Roger Quadros, balbi
  Cc: peter.chen, gregkh, linux-usb, linux-kernel, Rahul Kumar

Hi Roger,

>
>On 07/10/2020 06:35, 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>
>> ---
>>   drivers/usb/cdns3/core.c | 7 +------
>>   1 file changed, 1 insertion(+), 6 deletions(-)
>>
>> diff --git a/drivers/usb/cdns3/core.c b/drivers/usb/cdns3/core.c
>> index a0f73d4711ae..4fd3c742d9d5 100644
>> --- a/drivers/usb/cdns3/core.c
>> +++ b/drivers/usb/cdns3/core.c
>> @@ -469,9 +469,6 @@ static int cdns3_probe(struct platform_device *pdev)
>>   	if (cdns->dev_irq == -EPROBE_DEFER)
>
>if (cdns->dev_irq < 0 && cdns->dev_irq == -EPROBE_DEFER)

It's the same - cdns->dev_irq == -EPROBE_DEFER < 0 


>>   		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);
>> @@ -481,10 +478,8 @@ static int cdns3_probe(struct platform_device *pdev)
>>   	if (cdns->otg_irq == -EPROBE_DEFER)
>
>if (cdns->otg_irq < 0 && cdns->otg_irq == -EPROBE_DEFER)

It should be:
if (cdns->dev_irq < 0 || cdns->dev_irq == -EPROBE_DEFER)
or event
if (cdns->dev_irq < 0)

Am I right ?

>
>>   		return cdns->otg_irq;
>>
>> -	if (cdns->otg_irq < 0) {
>> -		dev_err(dev, "couldn't get otg irq\n");
>> +	if (cdns->otg_irq < 0)
>
>you can then get rid of this if {}.
>
>>   		return cdns->otg_irq;
>> -	}
>>
>>   	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "otg");
>>   	if (!res) {
>>

Cheers,
Pawell

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

* Re: [PATCH 1/2] usb: cdns3: Rids of duplicate error message
  2020-10-08  4:18   ` Pawel Laszczak
@ 2020-10-08  7:28     ` Roger Quadros
  0 siblings, 0 replies; 4+ messages in thread
From: Roger Quadros @ 2020-10-08  7:28 UTC (permalink / raw)
  To: Pawel Laszczak, balbi
  Cc: peter.chen, gregkh, linux-usb, linux-kernel, Rahul Kumar



On 08/10/2020 07:18, Pawel Laszczak wrote:
> Hi Roger,
> 
>>
>> On 07/10/2020 06:35, 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>
>>> ---
>>>    drivers/usb/cdns3/core.c | 7 +------
>>>    1 file changed, 1 insertion(+), 6 deletions(-)
>>>
>>> diff --git a/drivers/usb/cdns3/core.c b/drivers/usb/cdns3/core.c
>>> index a0f73d4711ae..4fd3c742d9d5 100644
>>> --- a/drivers/usb/cdns3/core.c
>>> +++ b/drivers/usb/cdns3/core.c
>>> @@ -469,9 +469,6 @@ static int cdns3_probe(struct platform_device *pdev)
>>>    	if (cdns->dev_irq == -EPROBE_DEFER)
>>
>> if (cdns->dev_irq < 0 && cdns->dev_irq == -EPROBE_DEFER)
> 
> It's the same - cdns->dev_irq == -EPROBE_DEFER < 0
> 
> 
>>>    		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);
>>> @@ -481,10 +478,8 @@ static int cdns3_probe(struct platform_device *pdev)
>>>    	if (cdns->otg_irq == -EPROBE_DEFER)
>>
>> if (cdns->otg_irq < 0 && cdns->otg_irq == -EPROBE_DEFER)
> 
> It should be:
> if (cdns->dev_irq < 0 || cdns->dev_irq == -EPROBE_DEFER)
> or event
> if (cdns->dev_irq < 0)
> 
> Am I right ?

Yeah, at both places just

	if (cdns->dev_irq < 0)
		return cdns->dev_irq;

should be enough.

cheers,
-roger

> 
>>
>>>    		return cdns->otg_irq;
>>>
>>> -	if (cdns->otg_irq < 0) {
>>> -		dev_err(dev, "couldn't get otg irq\n");
>>> +	if (cdns->otg_irq < 0)
>>
>> you can then get rid of this if {}.
>>
>>>    		return cdns->otg_irq;
>>> -	}
>>>
>>>    	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "otg");
>>>    	if (!res) {
>>>
> 
> Cheers,
> Pawell
> 

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

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

end of thread, other threads:[~2020-10-08  7:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-07  3:35 [PATCH 1/2] usb: cdns3: Rids of duplicate error message Pawel Laszczak
2020-10-07  8:11 ` Roger Quadros
2020-10-08  4:18   ` Pawel Laszczak
2020-10-08  7:28     ` Roger Quadros

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).