Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

hwmon: (ds1621) Convert to use devm_hwmon_device_register_with_groups

Also use new macro __ATTRIBUTE_GROUPS to declare attribute groups.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>

+4 -20
+4 -20
drivers/hwmon/ds1621.c
··· 354 354 .attrs = ds1621_attributes, 355 355 .is_visible = ds1621_attribute_visible 356 356 }; 357 - 358 - static const struct attribute_group *ds1621_groups[] = { 359 - &ds1621_group, 360 - NULL 361 - }; 357 + __ATTRIBUTE_GROUPS(ds1621); 362 358 363 359 static int ds1621_probe(struct i2c_client *client, 364 360 const struct i2c_device_id *id) ··· 375 379 /* Initialize the DS1621 chip */ 376 380 ds1621_init_client(data, client); 377 381 378 - hwmon_dev = hwmon_device_register_with_groups(&client->dev, 379 - client->name, data, 380 - ds1621_groups); 382 + hwmon_dev = devm_hwmon_device_register_with_groups(&client->dev, 383 + client->name, data, 384 + ds1621_groups); 381 385 if (IS_ERR(hwmon_dev)) 382 386 return PTR_ERR(hwmon_dev); 383 - 384 - i2c_set_clientdata(client, hwmon_dev); 385 - 386 - return 0; 387 - } 388 - 389 - static int ds1621_remove(struct i2c_client *client) 390 - { 391 - struct device *hwmon_dev = i2c_get_clientdata(client); 392 - 393 - hwmon_device_unregister(hwmon_dev); 394 387 395 388 return 0; 396 389 } ··· 401 416 .name = "ds1621", 402 417 }, 403 418 .probe = ds1621_probe, 404 - .remove = ds1621_remove, 405 419 .id_table = ds1621_id, 406 420 }; 407 421