linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] phy: ti: j721e-wiz: Fix some error return code in wiz_probe()
@ 2020-05-07  5:41 Wei Yongjun
  2020-05-07  6:41 ` Roger Quadros
  0 siblings, 1 reply; 3+ messages in thread
From: Wei Yongjun @ 2020-05-07  5:41 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Vinod Koul, Philipp Zabel, Jyri Sarha,
	Roger Quadros, Sekhar Nori, Wei Yongjun
  Cc: linux-kernel, kernel-janitors, Hulk Robot

Fix to return negative error code from some error handling
cases instead of 0, as done elsewhere in this function.

Fixes: 091876cc355d ("phy: ti: j721e-wiz: Add support for WIZ module present in TI J721E SoC")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/phy/ti/phy-j721e-wiz.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/phy/ti/phy-j721e-wiz.c b/drivers/phy/ti/phy-j721e-wiz.c
index 1d12d1b1b63a..30ea5b207285 100644
--- a/drivers/phy/ti/phy-j721e-wiz.c
+++ b/drivers/phy/ti/phy-j721e-wiz.c
@@ -841,8 +841,10 @@ static int wiz_probe(struct platform_device *pdev)
 	}
 
 	base = devm_ioremap(dev, res.start, resource_size(&res));
-	if (!base)
+	if (!base) {
+		ret = -ENOMEM;
 		goto err_addr_to_resource;
+	}
 
 	regmap = devm_regmap_init_mmio(dev, base, &wiz_regmap_config);
 	if (IS_ERR(regmap)) {
@@ -859,6 +861,7 @@ static int wiz_probe(struct platform_device *pdev)
 
 	if (num_lanes > WIZ_MAX_LANES) {
 		dev_err(dev, "Cannot support %d lanes\n", num_lanes);
+		ret = -ENODEV;
 		goto err_addr_to_resource;
 	}
 
@@ -948,6 +951,7 @@ static int wiz_probe(struct platform_device *pdev)
 	serdes_pdev = of_platform_device_create(child_node, NULL, dev);
 	if (!serdes_pdev) {
 		dev_WARN(dev, "Unable to create SERDES platform device\n");
+		ret = -ENOMEM;
 		goto err_pdev_create;
 	}
 	wiz->serdes_pdev = serdes_pdev;




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

* Re: [PATCH -next] phy: ti: j721e-wiz: Fix some error return code in wiz_probe()
  2020-05-07  5:41 [PATCH -next] phy: ti: j721e-wiz: Fix some error return code in wiz_probe() Wei Yongjun
@ 2020-05-07  6:41 ` Roger Quadros
  2020-05-13  2:23   ` Kishon Vijay Abraham I
  0 siblings, 1 reply; 3+ messages in thread
From: Roger Quadros @ 2020-05-07  6:41 UTC (permalink / raw)
  To: Wei Yongjun, Kishon Vijay Abraham I, Vinod Koul, Philipp Zabel,
	Jyri Sarha, Sekhar Nori
  Cc: linux-kernel, kernel-janitors, Hulk Robot



On 07/05/2020 08:41, Wei Yongjun wrote:
> Fix to return negative error code from some error handling
> cases instead of 0, as done elsewhere in this function.
> 
> Fixes: 091876cc355d ("phy: ti: j721e-wiz: Add support for WIZ module present in TI J721E SoC")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

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

> ---
>   drivers/phy/ti/phy-j721e-wiz.c | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/phy/ti/phy-j721e-wiz.c b/drivers/phy/ti/phy-j721e-wiz.c
> index 1d12d1b1b63a..30ea5b207285 100644
> --- a/drivers/phy/ti/phy-j721e-wiz.c
> +++ b/drivers/phy/ti/phy-j721e-wiz.c
> @@ -841,8 +841,10 @@ static int wiz_probe(struct platform_device *pdev)
>   	}
>   
>   	base = devm_ioremap(dev, res.start, resource_size(&res));
> -	if (!base)
> +	if (!base) {
> +		ret = -ENOMEM;
>   		goto err_addr_to_resource;
> +	}
>   
>   	regmap = devm_regmap_init_mmio(dev, base, &wiz_regmap_config);
>   	if (IS_ERR(regmap)) {
> @@ -859,6 +861,7 @@ static int wiz_probe(struct platform_device *pdev)
>   
>   	if (num_lanes > WIZ_MAX_LANES) {
>   		dev_err(dev, "Cannot support %d lanes\n", num_lanes);
> +		ret = -ENODEV;
>   		goto err_addr_to_resource;
>   	}
>   
> @@ -948,6 +951,7 @@ static int wiz_probe(struct platform_device *pdev)
>   	serdes_pdev = of_platform_device_create(child_node, NULL, dev);
>   	if (!serdes_pdev) {
>   		dev_WARN(dev, "Unable to create SERDES platform device\n");
> +		ret = -ENOMEM;
>   		goto err_pdev_create;
>   	}
>   	wiz->serdes_pdev = serdes_pdev;
> 
> 
> 

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

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

* Re: [PATCH -next] phy: ti: j721e-wiz: Fix some error return code in wiz_probe()
  2020-05-07  6:41 ` Roger Quadros
@ 2020-05-13  2:23   ` Kishon Vijay Abraham I
  0 siblings, 0 replies; 3+ messages in thread
From: Kishon Vijay Abraham I @ 2020-05-13  2:23 UTC (permalink / raw)
  To: Roger Quadros, Wei Yongjun, Vinod Koul, Philipp Zabel,
	Jyri Sarha, Sekhar Nori
  Cc: linux-kernel, kernel-janitors, Hulk Robot



On 5/7/2020 12:11 PM, Roger Quadros wrote:
> 
> 
> On 07/05/2020 08:41, Wei Yongjun wrote:
>> Fix to return negative error code from some error handling
>> cases instead of 0, as done elsewhere in this function.
>>
>> Fixes: 091876cc355d ("phy: ti: j721e-wiz: Add support for WIZ module present
>> in TI J721E SoC")
>> Reported-by: Hulk Robot <hulkci@huawei.com>
>> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> 
> Acked-by: Roger Quadros <rogerq@ti.com>

merged, thanks!

-Kishon
> 
>> ---
>>   drivers/phy/ti/phy-j721e-wiz.c | 6 +++++-
>>   1 file changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/phy/ti/phy-j721e-wiz.c b/drivers/phy/ti/phy-j721e-wiz.c
>> index 1d12d1b1b63a..30ea5b207285 100644
>> --- a/drivers/phy/ti/phy-j721e-wiz.c
>> +++ b/drivers/phy/ti/phy-j721e-wiz.c
>> @@ -841,8 +841,10 @@ static int wiz_probe(struct platform_device *pdev)
>>       }
>>         base = devm_ioremap(dev, res.start, resource_size(&res));
>> -    if (!base)
>> +    if (!base) {
>> +        ret = -ENOMEM;
>>           goto err_addr_to_resource;
>> +    }
>>         regmap = devm_regmap_init_mmio(dev, base, &wiz_regmap_config);
>>       if (IS_ERR(regmap)) {
>> @@ -859,6 +861,7 @@ static int wiz_probe(struct platform_device *pdev)
>>         if (num_lanes > WIZ_MAX_LANES) {
>>           dev_err(dev, "Cannot support %d lanes\n", num_lanes);
>> +        ret = -ENODEV;
>>           goto err_addr_to_resource;
>>       }
>>   @@ -948,6 +951,7 @@ static int wiz_probe(struct platform_device *pdev)
>>       serdes_pdev = of_platform_device_create(child_node, NULL, dev);
>>       if (!serdes_pdev) {
>>           dev_WARN(dev, "Unable to create SERDES platform device\n");
>> +        ret = -ENOMEM;
>>           goto err_pdev_create;
>>       }
>>       wiz->serdes_pdev = serdes_pdev;
>>
>>
>>
> 
> cheers,
> -roger

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

end of thread, other threads:[~2020-05-13  2:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-07  5:41 [PATCH -next] phy: ti: j721e-wiz: Fix some error return code in wiz_probe() Wei Yongjun
2020-05-07  6:41 ` Roger Quadros
2020-05-13  2:23   ` Kishon Vijay Abraham I

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