[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <dcc26fd7-9a4b-7f0a-979c-14d989bb2af8@huawei.com>
Date: Tue, 25 Oct 2022 16:32:45 +0800
From: Yang Yingliang <yangyingliang@...wei.com>
To: Jakub Kicinski <kuba@...nel.org>
CC: <netdev@...r.kernel.org>, <davem@...emloft.net>
Subject: Re: [PATCH net-next 1/2] net: natsemi: xtsonic: switch to use
platform_get_irq()
On 2022/10/25 12:11, Jakub Kicinski wrote:
> On Tue, 25 Oct 2022 11:12:35 +0800 Yang Yingliang wrote:
>> Switch to use platform_get_irq() which supports more cases.
> More cases of what? You need to explain what you're trying to achieve
> and why you're touching this old driver.
platform_get_irq() is a common API which calls of_irq_get(),
platform_get_resource() or
acpi_dev_gpio_irq_get() to get irq, and it returns exactly error code.
Thanks,
Yang
>
>> diff --git a/drivers/net/ethernet/natsemi/xtsonic.c b/drivers/net/ethernet/natsemi/xtsonic.c
>> index 52fef34d43f9..ffb3814c54cb 100644
>> --- a/drivers/net/ethernet/natsemi/xtsonic.c
>> +++ b/drivers/net/ethernet/natsemi/xtsonic.c
>> @@ -201,14 +201,17 @@ int xtsonic_probe(struct platform_device *pdev)
>> {
>> struct net_device *dev;
>> struct sonic_local *lp;
>> - struct resource *resmem, *resirq;
>> + struct resource *resmem;
>> + int irq;
>> int err = 0;
> The variable declaration lines should be sorted longest to shortest.
>
>> if ((resmem = platform_get_resource(pdev, IORESOURCE_MEM, 0)) == NULL)
>> return -ENODEV;
>>
>> - if ((resirq = platform_get_resource(pdev, IORESOURCE_IRQ, 0)) == NULL)
>> - return -ENODEV;
>> + irq = platform_get_irq(pdev, 0);
>> + if (irq < 0)
>> + return irq;
>> +
>>
> extra new line
> .
Powered by blists - more mailing lists