PCI: xgene: Fix the error return code

Message ID 1513730309-18831-1-git-send-email-festevam@gmail.com
State Accepted
Headers show
Series
  • PCI: xgene: Fix the error return code
Related show

Commit Message

Fabio Estevam Dec. 20, 2017, 12:38 a.m.
In the case of IS_ERR() error, we should return PTR_ERR().

Fix the error return code.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
 drivers/pci/host/pci-xgene-msi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Lorenzo Pieralisi Dec. 20, 2017, 12:14 p.m. | #1
[+ Khuong Dinh]

On Tue, Dec 19, 2017 at 10:38:29PM -0200, Fabio Estevam wrote:
> In the case of IS_ERR() error, we should return PTR_ERR().
> 
> Fix the error return code.
> 
> Signed-off-by: Fabio Estevam <festevam@gmail.com>
> ---
>  drivers/pci/host/pci-xgene-msi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

I am about to apply this patch, please let me know if you see
any issue with that.

Thanks,
Lorenzo

> diff --git a/drivers/pci/host/pci-xgene-msi.c b/drivers/pci/host/pci-xgene-msi.c
> index 1f42a20..4a1fb01 100644
> --- a/drivers/pci/host/pci-xgene-msi.c
> +++ b/drivers/pci/host/pci-xgene-msi.c
> @@ -465,7 +465,7 @@ static int xgene_msi_probe(struct platform_device *pdev)
>  	xgene_msi->msi_regs = devm_ioremap_resource(&pdev->dev, res);
>  	if (IS_ERR(xgene_msi->msi_regs)) {
>  		dev_err(&pdev->dev, "no reg space\n");
> -		rc = -EINVAL;
> +		rc = PTR_ERR(xgene_msi->msi_regs);
>  		goto error;
>  	}
>  	xgene_msi->msi_addr = res->start;
> -- 
> 2.7.4
>
Fabio Estevam Feb. 14, 2018, 1:45 a.m. | #2
Khuong Dinh, Lorenzo,

On Wed, Dec 20, 2017 at 10:14 AM, Lorenzo Pieralisi
<lorenzo.pieralisi@arm.com> wrote:
> [+ Khuong Dinh]
>
> On Tue, Dec 19, 2017 at 10:38:29PM -0200, Fabio Estevam wrote:
>> In the case of IS_ERR() error, we should return PTR_ERR().
>>
>> Fix the error return code.
>>
>> Signed-off-by: Fabio Estevam <festevam@gmail.com>
>> ---
>>  drivers/pci/host/pci-xgene-msi.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> I am about to apply this patch, please let me know if you see
> any issue with that.

A gente ping.

>
> Thanks,
> Lorenzo
>
>> diff --git a/drivers/pci/host/pci-xgene-msi.c b/drivers/pci/host/pci-xgene-msi.c
>> index 1f42a20..4a1fb01 100644
>> --- a/drivers/pci/host/pci-xgene-msi.c
>> +++ b/drivers/pci/host/pci-xgene-msi.c
>> @@ -465,7 +465,7 @@ static int xgene_msi_probe(struct platform_device *pdev)
>>       xgene_msi->msi_regs = devm_ioremap_resource(&pdev->dev, res);
>>       if (IS_ERR(xgene_msi->msi_regs)) {
>>               dev_err(&pdev->dev, "no reg space\n");
>> -             rc = -EINVAL;
>> +             rc = PTR_ERR(xgene_msi->msi_regs);
>>               goto error;
>>       }
>>       xgene_msi->msi_addr = res->start;
>> --
>> 2.7.4
>>
Lorenzo Pieralisi Feb. 14, 2018, 3:32 p.m. | #3
On Tue, Feb 13, 2018 at 11:45:15PM -0200, Fabio Estevam wrote:
> Khuong Dinh, Lorenzo,
> 
> On Wed, Dec 20, 2017 at 10:14 AM, Lorenzo Pieralisi
> <lorenzo.pieralisi@arm.com> wrote:
> > [+ Khuong Dinh]
> >
> > On Tue, Dec 19, 2017 at 10:38:29PM -0200, Fabio Estevam wrote:
> >> In the case of IS_ERR() error, we should return PTR_ERR().
> >>
> >> Fix the error return code.
> >>
> >> Signed-off-by: Fabio Estevam <festevam@gmail.com>
> >> ---
> >>  drivers/pci/host/pci-xgene-msi.c | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > I am about to apply this patch, please let me know if you see
> > any issue with that.
> 
> A gente ping.

Applied to pci/xgene for v4.17, sorry for the delay.

Lorenzo

> > Thanks,
> > Lorenzo
> >
> >> diff --git a/drivers/pci/host/pci-xgene-msi.c b/drivers/pci/host/pci-xgene-msi.c
> >> index 1f42a20..4a1fb01 100644
> >> --- a/drivers/pci/host/pci-xgene-msi.c
> >> +++ b/drivers/pci/host/pci-xgene-msi.c
> >> @@ -465,7 +465,7 @@ static int xgene_msi_probe(struct platform_device *pdev)
> >>       xgene_msi->msi_regs = devm_ioremap_resource(&pdev->dev, res);
> >>       if (IS_ERR(xgene_msi->msi_regs)) {
> >>               dev_err(&pdev->dev, "no reg space\n");
> >> -             rc = -EINVAL;
> >> +             rc = PTR_ERR(xgene_msi->msi_regs);
> >>               goto error;
> >>       }
> >>       xgene_msi->msi_addr = res->start;
> >> --
> >> 2.7.4
> >>

Patch

diff --git a/drivers/pci/host/pci-xgene-msi.c b/drivers/pci/host/pci-xgene-msi.c
index 1f42a20..4a1fb01 100644
--- a/drivers/pci/host/pci-xgene-msi.c
+++ b/drivers/pci/host/pci-xgene-msi.c
@@ -465,7 +465,7 @@  static int xgene_msi_probe(struct platform_device *pdev)
 	xgene_msi->msi_regs = devm_ioremap_resource(&pdev->dev, res);
 	if (IS_ERR(xgene_msi->msi_regs)) {
 		dev_err(&pdev->dev, "no reg space\n");
-		rc = -EINVAL;
+		rc = PTR_ERR(xgene_msi->msi_regs);
 		goto error;
 	}
 	xgene_msi->msi_addr = res->start;