]> git.itanic.dy.fi Git - linux-stable/commitdiff
platform/chrome/wilco_ec: Remove usage of the deprecated ida_simple_xx() API
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sat, 16 Dec 2023 16:59:38 +0000 (17:59 +0100)
committerTzung-Bi Shih <tzungbi@kernel.org>
Mon, 18 Dec 2023 04:44:38 +0000 (12:44 +0800)
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>
Link: https://lore.kernel.org/r/898d9aa181a84f1d17725ca047004bad532c37e9.1702745959.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
drivers/platform/chrome/wilco_ec/event.c
drivers/platform/chrome/wilco_ec/telemetry.c

index f80a7c83cfba02d29f3d464af4386c94f55c7026..13291fb4214e82bf78cb73e8b19916a5da68faa6 100644 (file)
@@ -495,7 +495,7 @@ static int event_device_add(struct acpi_device *adev)
 free_dev_data:
        hangup_device(dev_data);
 free_minor:
-       ida_simple_remove(&event_ida, minor);
+       ida_free(&event_ida, minor);
        return error;
 }
 
@@ -504,7 +504,7 @@ static void event_device_remove(struct acpi_device *adev)
        struct event_device_data *dev_data = adev->driver_data;
 
        cdev_device_del(&dev_data->cdev, &dev_data->dev);
-       ida_simple_remove(&event_ida, MINOR(dev_data->dev.devt));
+       ida_free(&event_ida, MINOR(dev_data->dev.devt));
        hangup_device(dev_data);
 }
 
index 253098bace63e32192b8ef850913ab5a59daba44..b7c616f3d179bf669e4248944886cea6419efc1c 100644 (file)
@@ -372,7 +372,7 @@ static int telem_device_probe(struct platform_device *pdev)
 
        dev_data = kzalloc(sizeof(*dev_data), GFP_KERNEL);
        if (!dev_data) {
-               ida_simple_remove(&telem_ida, minor);
+               ida_free(&telem_ida, minor);
                return -ENOMEM;
        }
 
@@ -393,7 +393,7 @@ static int telem_device_probe(struct platform_device *pdev)
        error = cdev_device_add(&dev_data->cdev, &dev_data->dev);
        if (error) {
                put_device(&dev_data->dev);
-               ida_simple_remove(&telem_ida, minor);
+               ida_free(&telem_ida, minor);
                return error;
        }
 
@@ -405,7 +405,7 @@ static void telem_device_remove(struct platform_device *pdev)
        struct telem_device_data *dev_data = platform_get_drvdata(pdev);
 
        cdev_device_del(&dev_data->cdev, &dev_data->dev);
-       ida_simple_remove(&telem_ida, MINOR(dev_data->dev.devt));
+       ida_free(&telem_ida, MINOR(dev_data->dev.devt));
        put_device(&dev_data->dev);
 }