Skip to content

Commit

Permalink
hwmon: hwmon-aaeon: convert to the .remove_new (void) callback
Browse files Browse the repository at this point in the history
With commit 74a5b94 ("ARM: Convert to platform remove callback
returning void"), the .remove() callback for platform drivers was
refactored into void (previously int), with the callback renamed as
.remove_new().

Follow the commit and refactor this driver.

Signed-off-by: Mingcong Bai <[email protected]>
  • Loading branch information
MingcongBai committed Nov 19, 2024
1 parent b4fe8fe commit a329ab5
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions drivers/hwmon/hwmon-aaeon.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ static ssize_t name_show(struct device *dev, struct device_attribute *devattr,
char *buf);
static int aaeon_get_version(void);
static int aaeon_hwmon_probe(struct platform_device *pdev);
static int aaeon_hwmon_remove(struct platform_device *pdev);
static void aaeon_hwmon_remove(struct platform_device *pdev);

static const char * const temp_sensors_name_table[] = {
"CPU_Temp",
Expand Down Expand Up @@ -409,16 +409,14 @@ aaeon_hwmon_remove_sysfs_files(struct platform_device *pdev,
data->bfpi_version);
}

static int aaeon_hwmon_remove(struct platform_device *pdev)
static void aaeon_hwmon_remove(struct platform_device *pdev)
{
struct aaeon_hwmon_data *data = platform_get_drvdata(pdev);

if (data->hwmon_dev)
hwmon_device_unregister(data->hwmon_dev);

aaeon_hwmon_remove_sysfs_files(pdev, data);

return 0;
}

static int aaeon_get_version(void)
Expand Down Expand Up @@ -556,7 +554,7 @@ static struct platform_driver aaeon_hwmon_driver = {
.owner = THIS_MODULE,
},
.probe = aaeon_hwmon_probe,
.remove = aaeon_hwmon_remove,
.remove_new = aaeon_hwmon_remove,
};

module_platform_driver_probe(aaeon_hwmon_driver, aaeon_hwmon_probe);
Expand Down

0 comments on commit a329ab5

Please sign in to comment.