All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Lad, Prabhakar" <prabhakar.csengg@gmail.com>
To: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, netdev <netdev@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] net: mv643xx_eth: Propagate errors from of_irq_to_resource()
Date: Fri, 17 Dec 2021 00:47:37 +0000	[thread overview]
Message-ID: <CA+V-a8uuSRP8H9_kfUoy7+e9MJuwA7nP2w3PRDAm_2K7-x9uqw@mail.gmail.com> (raw)
In-Reply-To: <20211217003540.21344-1-prabhakar.mahadev-lad.rj@bp.renesas.com>

Hi All,

On Fri, Dec 17, 2021 at 12:35 AM Lad Prabhakar
<prabhakar.mahadev-lad.rj@bp.renesas.com> wrote:
>
> The driver overrides the error code returned by of_irq_to_resource() to
> -EINVAL. Switch to propagating the error code upstream so that errors
> such as -EPROBE_DEFER are handled.
>
> While at it drop the memset() operation as of_irq_to_resource()
> does call memset() before filling in the IRQ resource.
>
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> ---
>  drivers/net/ethernet/marvell/mv643xx_eth.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
Please ignore this patch, as the plan is to drop all the users
of_irq_to_resource() (see [0]). I'll send a new patch which uses the
preferred way of platform_get_irq().

[0] https://patchwork.ozlabs.org/project/linux-ide/patch/20211217001238.16298-1-prabhakar.mahadev-lad.rj@bp.renesas.com/

Cheers,
Prabhakar

> diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
> index 105247582684..7a5ff629d158 100644
> --- a/drivers/net/ethernet/marvell/mv643xx_eth.c
> +++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
> @@ -2716,10 +2716,10 @@ static int mv643xx_eth_shared_of_add_port(struct platform_device *pdev,
>         memset(&ppd, 0, sizeof(ppd));
>         ppd.shared = pdev;
>
> -       memset(&res, 0, sizeof(res));
> -       if (of_irq_to_resource(pnp, 0, &res) <= 0) {
> +       ret = of_irq_to_resource(pnp, 0, &res);
> +       if (ret <= 0) {
>                 dev_err(&pdev->dev, "missing interrupt on %pOFn\n", pnp);
> -               return -EINVAL;
> +               return ret ? ret : -ENXIO;
>         }
>
>         if (of_property_read_u32(pnp, "reg", &ppd.port_number)) {
> --
> 2.17.1
>

      reply	other threads:[~2021-12-17  0:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-17  0:35 [PATCH] net: mv643xx_eth: Propagate errors from of_irq_to_resource() Lad Prabhakar
2021-12-17  0:47 ` Lad, Prabhakar [this message]

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=CA+V-a8uuSRP8H9_kfUoy7+e9MJuwA7nP2w3PRDAm_2K7-x9uqw@mail.gmail.com \
    --to=prabhakar.csengg@gmail.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
    --cc=sebastian.hesselbarth@gmail.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.