[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20221024211148.6522caac@kernel.org>
Date: Mon, 24 Oct 2022 21:11:48 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Yang Yingliang <yangyingliang@...wei.com>
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 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.
> 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