Re: [PATCH -next] phy: ti: j721e-wiz: Fix some error return code in wiz_probe()
From: Kishon Vijay Abraham I
Date: Tue May 12 2020 - 22:23:45 EST
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@xxxxxxxxxx>
>> Signed-off-by: Wei Yongjun <weiyongjun1@xxxxxxxxxx>
>
> Acked-by: Roger Quadros <rogerq@xxxxxx>
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