From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
To: keliu <liuke94@huawei.com>,
andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk,
davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: phy: Directly use ida_alloc()/free()
Date: Fri, 27 May 2022 09:35:33 +0200 [thread overview]
Message-ID: <131a9514-8ca6-eac2-ba4f-9fafca21e5b4@wanadoo.fr> (raw)
In-Reply-To: <20220527074000.2474792-1-liuke94@huawei.com>
Hi,
Le 27/05/2022 à 09:40, keliu a écrit :
> Use ida_alloc()/ida_free() instead of deprecated
> ida_simple_get()/ida_simple_remove() .
>
> Signed-off-by: keliu <liuke94@huawei.com>
> ---
> drivers/net/phy/fixed_phy.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/phy/fixed_phy.c b/drivers/net/phy/fixed_phy.c
> index c65fb5f5d2dc..63e7922bf257 100644
> --- a/drivers/net/phy/fixed_phy.c
> +++ b/drivers/net/phy/fixed_phy.c
> @@ -180,7 +180,7 @@ static void fixed_phy_del(int phy_addr)
> if (fp->link_gpiod)
> gpiod_put(fp->link_gpiod);
> kfree(fp);
> - ida_simple_remove(&phy_fixed_ida, phy_addr);
> + ida_free(&phy_fixed_ida, phy_addr);
> return;
> }
> }
> @@ -250,7 +250,7 @@ static struct phy_device *__fixed_phy_register(unsigned int irq,
>
> ret = fixed_phy_add_gpiod(irq, phy_addr, status, gpiod);
> if (ret < 0) {
> - ida_simple_remove(&phy_fixed_ida, phy_addr);
> + ida_free(&phy_fixed_ida, phy_addr);
> return ERR_PTR(ret);
> }
>
Hi,
You missed ida_simple_get() that shoud become ida_alloc_max() here.
CJ
next prev parent reply other threads:[~2022-05-27 7:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-27 7:40 keliu
2022-05-27 7:35 ` Christophe JAILLET [this message]
2022-05-28 4:54 Ke Liu
2022-05-28 11:50 ` patchwork-bot+netdevbpf
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=131a9514-8ca6-eac2-ba4f-9fafca21e5b4@wanadoo.fr \
--to=christophe.jaillet@wanadoo.fr \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=liuke94@huawei.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®