linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] misc: bcm_vk: Remove usage of deprecated functions
       [not found] <20220727111435.2153813-1-leitao@leitao.org>
@ 2022-08-03 19:09 ` Scott Branden
  2022-08-12  9:47   ` [RESEND PATCH] " Breno Leitao
  0 siblings, 1 reply; 2+ messages in thread
From: Scott Branden @ 2022-08-03 19:09 UTC (permalink / raw)
  To: Breno Leitao, bcm-kernel-feedback-list; +Cc: leit, linux-kernel, Breno Leitao

[-- Attachment #1: Type: text/plain, Size: 1844 bytes --]

Unsure, you may need to add Greg K-H to the to email for him to see this 
patch as he picks up misc drivers in his tree.

On 2022-07-27 04:14, Breno Leitao wrote:
> From: Breno Leitao <leitao@debian.org>
> 
> ida_simple_get() and ida_simple_remove() functions are deprecated now.
> These functions were replaced by ida_alloc() and ida_free()
> respectively. This patch modernizes the bcm_vk driver to use the
> replacement functions.
> 
> Signed-off-by: Breno Leitao <leitao@debian.org>
Acked-by: Scott Branden <scott.branden@broadcom.com>
> ---
>   drivers/misc/bcm-vk/bcm_vk_dev.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/misc/bcm-vk/bcm_vk_dev.c b/drivers/misc/bcm-vk/bcm_vk_dev.c
> index a16b99bdaa13..a3a82ebbc699 100644
> --- a/drivers/misc/bcm-vk/bcm_vk_dev.c
> +++ b/drivers/misc/bcm-vk/bcm_vk_dev.c
> @@ -1401,7 +1401,7 @@ static int bcm_vk_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
>   		bcm_vk_tty_set_irq_enabled(vk, i);
>   	}
>   
> -	id = ida_simple_get(&bcm_vk_ida, 0, 0, GFP_KERNEL);
> +	id = ida_alloc(&bcm_vk_ida, GFP_KERNEL);
>   	if (id < 0) {
>   		err = id;
>   		dev_err(dev, "unable to get id\n");
> @@ -1500,7 +1500,7 @@ static int bcm_vk_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
>   	misc_device->name = NULL;
>   
>   err_ida_remove:
> -	ida_simple_remove(&bcm_vk_ida, id);
> +	ida_free(&bcm_vk_ida, id);
>   
>   err_irq:
>   	for (i = 0; i < vk->num_irqs; i++)
> @@ -1573,7 +1573,7 @@ static void bcm_vk_remove(struct pci_dev *pdev)
>   	if (misc_device->name) {
>   		misc_deregister(misc_device);
>   		kfree(misc_device->name);
> -		ida_simple_remove(&bcm_vk_ida, vk->devid);
> +		ida_free(&bcm_vk_ida, vk->devid);
>   	}
>   	for (i = 0; i < vk->num_irqs; i++)
>   		devm_free_irq(&pdev->dev, pci_irq_vector(pdev, i), vk);

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4212 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [RESEND PATCH] misc: bcm_vk: Remove usage of deprecated functions
  2022-08-03 19:09 ` [PATCH] misc: bcm_vk: Remove usage of deprecated functions Scott Branden
@ 2022-08-12  9:47   ` Breno Leitao
  0 siblings, 0 replies; 2+ messages in thread
From: Breno Leitao @ 2022-08-12  9:47 UTC (permalink / raw)
  To: arnd, gregkh
  Cc: scott.branden, bcm-kernel-feedback-list, linux-kernel, Kernel-team

ida_simple_get() and ida_simple_remove() functions are deprecated now.
These functions were replaced by ida_alloc() and ida_free()
respectively. This patch modernize bcm_vk to use the replacement
functions.

Signed-off-by: Breno Leitao <leitao@debian.org>
Acked-by: Scott Branden <scott.branden@broadcom.com>
---
 drivers/misc/bcm-vk/bcm_vk_dev.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/misc/bcm-vk/bcm_vk_dev.c b/drivers/misc/bcm-vk/bcm_vk_dev.c
index a16b99bdaa13..a3a82ebbc699 100644
--- a/drivers/misc/bcm-vk/bcm_vk_dev.c
+++ b/drivers/misc/bcm-vk/bcm_vk_dev.c
@@ -1401,7 +1401,7 @@ static int bcm_vk_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 		bcm_vk_tty_set_irq_enabled(vk, i);
 	}
 
-	id = ida_simple_get(&bcm_vk_ida, 0, 0, GFP_KERNEL);
+	id = ida_alloc(&bcm_vk_ida, GFP_KERNEL);
 	if (id < 0) {
 		err = id;
 		dev_err(dev, "unable to get id\n");
@@ -1500,7 +1500,7 @@ static int bcm_vk_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	misc_device->name = NULL;
 
 err_ida_remove:
-	ida_simple_remove(&bcm_vk_ida, id);
+	ida_free(&bcm_vk_ida, id);
 
 err_irq:
 	for (i = 0; i < vk->num_irqs; i++)
@@ -1573,7 +1573,7 @@ static void bcm_vk_remove(struct pci_dev *pdev)
 	if (misc_device->name) {
 		misc_deregister(misc_device);
 		kfree(misc_device->name);
-		ida_simple_remove(&bcm_vk_ida, vk->devid);
+		ida_free(&bcm_vk_ida, vk->devid);
 	}
 	for (i = 0; i < vk->num_irqs; i++)
 		devm_free_irq(&pdev->dev, pci_irq_vector(pdev, i), vk);
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-08-12  9:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20220727111435.2153813-1-leitao@leitao.org>
2022-08-03 19:09 ` [PATCH] misc: bcm_vk: Remove usage of deprecated functions Scott Branden
2022-08-12  9:47   ` [RESEND PATCH] " Breno Leitao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).