From: Jakub Kicinski <kuba@kernel.org>
To: Yang Yingliang <yangyingliang@huawei.com>
Cc: <netdev@vger.kernel.org>, <davem@davemloft.net>
Subject: Re: [PATCH net-next 1/2] net: natsemi: xtsonic: switch to use platform_get_irq()
Date: Mon, 24 Oct 2022 21:11:48 -0700 [thread overview]
Message-ID: <20221024211148.6522caac@kernel.org> (raw)
In-Reply-To: <20221025031236.1031330-1-yangyingliang@huawei.com>
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
next prev parent reply other threads:[~2022-10-25 4:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-25 3:12 [PATCH net-next 1/2] net: natsemi: xtsonic: switch to use platform_get_irq() Yang Yingliang
2022-10-25 3:12 ` [PATCH net-next 2/2] net: natsemi: xtsonic: use pr_err() Yang Yingliang
2022-10-25 4:12 ` Jakub Kicinski
2022-10-25 4:11 ` Jakub Kicinski [this message]
2022-10-25 8:32 ` [PATCH net-next 1/2] net: natsemi: xtsonic: switch to use platform_get_irq() Yang Yingliang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221024211148.6522caac@kernel.org \
--to=kuba@kernel.org \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=yangyingliang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.