public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Chen <peter.chen@kernel.org>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
	linux-usb@vger.kernel.org
Subject: Re: [PATCH] usb: chipidea: Remove usage of the deprecated ida_simple_xx() API
Date: Mon, 11 Dec 2023 09:44:56 +0800	[thread overview]
Message-ID: <20231211014456.GA1197808@nchen-desktop> (raw)
In-Reply-To: <8bf382976c0ba0986c0dbe93427266273f0776ef.1702230217.git.christophe.jaillet@wanadoo.fr>

On 23-12-10 18:43:56, Christophe JAILLET wrote:
> ida_alloc() and ida_free() should be preferred to the deprecated
> ida_simple_get() and ida_simple_remove().
> 
> This is less verbose.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

Acked-by: Peter Chen <peter.chen@kernel.org>

> ---
>  drivers/usb/chipidea/core.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
> index 7ac39a281b8c..0af9e68035fb 100644
> --- a/drivers/usb/chipidea/core.c
> +++ b/drivers/usb/chipidea/core.c
> @@ -862,7 +862,7 @@ struct platform_device *ci_hdrc_add_device(struct device *dev,
>  	if (ret)
>  		return ERR_PTR(ret);
>  
> -	id = ida_simple_get(&ci_ida, 0, 0, GFP_KERNEL);
> +	id = ida_alloc(&ci_ida, GFP_KERNEL);
>  	if (id < 0)
>  		return ERR_PTR(id);
>  
> @@ -892,7 +892,7 @@ struct platform_device *ci_hdrc_add_device(struct device *dev,
>  err:
>  	platform_device_put(pdev);
>  put_id:
> -	ida_simple_remove(&ci_ida, id);
> +	ida_free(&ci_ida, id);
>  	return ERR_PTR(ret);
>  }
>  EXPORT_SYMBOL_GPL(ci_hdrc_add_device);
> @@ -901,7 +901,7 @@ void ci_hdrc_remove_device(struct platform_device *pdev)
>  {
>  	int id = pdev->id;
>  	platform_device_unregister(pdev);
> -	ida_simple_remove(&ci_ida, id);
> +	ida_free(&ci_ida, id);
>  }
>  EXPORT_SYMBOL_GPL(ci_hdrc_remove_device);
>  
> -- 
> 2.34.1
> 

-- 

Thanks,
Peter Chen

      reply	other threads:[~2023-12-11  1:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-10 17:43 [PATCH] usb: chipidea: Remove usage of the deprecated ida_simple_xx() API Christophe JAILLET
2023-12-11  1:44 ` Peter Chen [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=20231211014456.GA1197808@nchen-desktop \
    --to=peter.chen@kernel.org \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /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