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

Input: rohm_bu21023 - use managed devm_device_add_group

Commit 57b8ff070f98 ("driver core: add devm_device_add_group() and
friends") has added the managed version for creating sysfs group files.

Use devm_device_add_group instead of sysfs_create_group and remove the
action that cleans the sysfs file when exiting the driver.

Signed-off-by: Andi Shyti <andi@etezian.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Andi Shyti and committed by
Dmitry Torokhov
a71b8b5c b887df52

+1 -16
+1 -16
drivers/input/touchscreen/rohm_bu21023.c
··· 1103 1103 ts->initialized = false; 1104 1104 } 1105 1105 1106 - static void rohm_ts_remove_sysfs_group(void *_dev) 1107 - { 1108 - struct device *dev = _dev; 1109 - 1110 - sysfs_remove_group(&dev->kobj, &rohm_ts_attr_group); 1111 - } 1112 - 1113 1106 static int rohm_bu21023_i2c_probe(struct i2c_client *client, 1114 1107 const struct i2c_device_id *id) 1115 1108 { ··· 1173 1180 return error; 1174 1181 } 1175 1182 1176 - error = sysfs_create_group(&dev->kobj, &rohm_ts_attr_group); 1183 + error = devm_device_add_group(dev, &rohm_ts_attr_group); 1177 1184 if (error) { 1178 1185 dev_err(dev, "failed to create sysfs group: %d\n", error); 1179 - return error; 1180 - } 1181 - 1182 - error = devm_add_action(dev, rohm_ts_remove_sysfs_group, dev); 1183 - if (error) { 1184 - rohm_ts_remove_sysfs_group(dev); 1185 - dev_err(dev, "Failed to add sysfs cleanup action: %d\n", 1186 - error); 1187 1186 return error; 1188 1187 } 1189 1188