çå: reply: [PATCH v3 1/2] PCI: kirin: Add MSI support

From: songxiaowei
Date: Mon May 14 2018 - 03:41:03 EST


Hi Andy Shevchenko

> -----éäåä-----
> åää: Andy Shevchenko [mailto:andy.shevchenko@xxxxxxxxx]
> åéæé: 2018å5æ14æ 15:17
> æää: songxiaowei <songxiaowei@xxxxxxxxxxxxx>
> æé: chenyao (F) <chenyao11@xxxxxxxxxx>; Wangbinghui
> <wangbinghui@xxxxxxxxxxxxx>; Lorenzo Pieralisi <lorenzo.pieralisi@xxxxxxx>;
> Bjorn Helgaas <bhelgaas@xxxxxxxxxx>; xuwei (O) <xuwei5@xxxxxxxxxx>;
> Rob Herring <robh+dt@xxxxxxxxxx>; Mark Rutland <mark.rutland@xxxxxxx>;
> Catalin Marinas <catalin.marinas@xxxxxxx>; Will Deacon
> <will.deacon@xxxxxxx>; linux-pci@xxxxxxxxxxxxxxx; Linux Kernel Mailing List
> <linux-kernel@xxxxxxxxxxxxxxx>; linux-arm Mailing List
> <linux-arm-kernel@xxxxxxxxxxxxxxxxxxx>; devicetree
> <devicetree@xxxxxxxxxxxxxxx>; dimitrysh@xxxxxxxxxx;
> guodong.xu@xxxxxxxxxx; Suzhuangluan <suzhuangluan@xxxxxxxxxxxxx>; Kongfei
> <kongfei@xxxxxxxxxxxxx>
> äé: Re: reply: [PATCH v3 1/2] PCI: kirin: Add MSI support
>
> On Mon, May 14, 2018 at 4:11 AM, songxiaowei <songxiaowei@xxxxxxxxxxxxx>
> wrote:
>
> >> > + int ret;
> >> > +
> >> > + if (IS_ENABLED(CONFIG_PCI_MSI)) {
> >>
> >> > + pci->pp.msi_irq = platform_get_irq(pdev, 0);
> >> > + if (pci->pp.msi_irq < 0) {
> >> > + dev_err(&pdev->dev, "failed to get MSI IRQ
> >> (%d)\n",
> >> > + pci->pp.msi_irq);
> >>
> >> > + return -ENODEV;
> >>
> >> Why shadowing actual error code?
> > [songxiaowei] Sorry, I can't get your point about this, would you explain it
> for me.
>
> platform_get_irq() returns either correct IRQ number or negative error code.
> In the code above you shadow the actual error (as returned by that
> call) by -ENODEV. Any reason why?
>
[songxiaowei] I guess the reason is that she wanted to keep the same with other hosts,
So, you'd like to use "return pci->pp.msi_irq " instead of " return -ENODEV ".
> --
> With Best Regards,
> Andy Shevchenko

Thanks a lot,
Xiaowei.