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

Input: cyapa - switch to using devm_device_add_group()

Instead of installing custom devm cleanup action to remove attribute
groups on failure, let's use the dedicated devm API.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

+1 -15
+1 -15
drivers/input/mouse/cyapa.c
··· 1238 1238 .attrs = cyapa_sysfs_entries, 1239 1239 }; 1240 1240 1241 - static void cyapa_remove_sysfs_group(void *data) 1242 - { 1243 - struct cyapa *cyapa = data; 1244 - 1245 - sysfs_remove_group(&cyapa->client->dev.kobj, &cyapa_sysfs_group); 1246 - } 1247 - 1248 1241 static void cyapa_disable_regulator(void *data) 1249 1242 { 1250 1243 struct cyapa *cyapa = data; ··· 1305 1312 return error; 1306 1313 } 1307 1314 1308 - error = sysfs_create_group(&dev->kobj, &cyapa_sysfs_group); 1315 + error = devm_device_add_group(dev, &cyapa_sysfs_group); 1309 1316 if (error) { 1310 1317 dev_err(dev, "failed to create sysfs entries: %d\n", error); 1311 - return error; 1312 - } 1313 - 1314 - error = devm_add_action(dev, cyapa_remove_sysfs_group, cyapa); 1315 - if (error) { 1316 - cyapa_remove_sysfs_group(cyapa); 1317 - dev_err(dev, "failed to add sysfs cleanup action: %d\n", error); 1318 1318 return error; 1319 1319 } 1320 1320