aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/hwmon/nct6775.c21
1 files changed, 5 insertions, 16 deletions
diff --git a/drivers/hwmon/nct6775.c b/drivers/hwmon/nct6775.c
index 58e9e11ef32a..fdbd63282e29 100644
--- a/drivers/hwmon/nct6775.c
+++ b/drivers/hwmon/nct6775.c
@@ -724,8 +724,6 @@ struct nct6775_data {
724 enum kinds kind; 724 enum kinds kind;
725 const char *name; 725 const char *name;
726 726
727 struct device *hwmon_dev;
728
729 int num_attr_groups; 727 int num_attr_groups;
730 const struct attribute_group *groups[6]; 728 const struct attribute_group *groups[6];
731 729
@@ -3260,6 +3258,7 @@ static int nct6775_probe(struct platform_device *pdev)
3260 int num_reg_temp; 3258 int num_reg_temp;
3261 u8 cr2a; 3259 u8 cr2a;
3262 struct attribute_group *group; 3260 struct attribute_group *group;
3261 struct device *hwmon_dev;
3263 3262
3264 res = platform_get_resource(pdev, IORESOURCE_IO, 0); 3263 res = platform_get_resource(pdev, IORESOURCE_IO, 0);
3265 if (!devm_request_region(&pdev->dev, res->start, IOREGION_LENGTH, 3264 if (!devm_request_region(&pdev->dev, res->start, IOREGION_LENGTH,
@@ -3861,19 +3860,10 @@ static int nct6775_probe(struct platform_device *pdev)
3861 data->groups[data->num_attr_groups++] = group; 3860 data->groups[data->num_attr_groups++] = group;
3862 data->groups[data->num_attr_groups++] = &nct6775_group_other; 3861 data->groups[data->num_attr_groups++] = &nct6775_group_other;
3863 3862
3864 data->hwmon_dev = hwmon_device_register_with_groups(dev, data->name, 3863 hwmon_dev = devm_hwmon_device_register_with_groups(dev, data->name,
3865 data, data->groups); 3864 data, data->groups);
3866 if (IS_ERR(data->hwmon_dev)) 3865 if (IS_ERR(hwmon_dev))
3867 return PTR_ERR(data->hwmon_dev); 3866 return PTR_ERR(hwmon_dev);
3868
3869 return 0;
3870}
3871
3872static int nct6775_remove(struct platform_device *pdev)
3873{
3874 struct nct6775_data *data = platform_get_drvdata(pdev);
3875
3876 hwmon_device_unregister(data->hwmon_dev);
3877 3867
3878 return 0; 3868 return 0;
3879} 3869}
@@ -3964,7 +3954,6 @@ static struct platform_driver nct6775_driver = {
3964 .pm = NCT6775_DEV_PM_OPS, 3954 .pm = NCT6775_DEV_PM_OPS,
3965 }, 3955 },
3966 .probe = nct6775_probe, 3956 .probe = nct6775_probe,
3967 .remove = nct6775_remove,
3968}; 3957};
3969 3958
3970static const char * const nct6775_sio_names[] __initconst = { 3959static const char * const nct6775_sio_names[] __initconst = {