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

Input: melfas_mip4 - 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
4c16f82e 8db69a9a

+1 -16
+1 -16
drivers/input/touchscreen/melfas_mip4.c
··· 1433 1433 .attrs = mip4_attrs, 1434 1434 }; 1435 1435 1436 - static void mip4_sysfs_remove(void *_data) 1437 - { 1438 - struct mip4_ts *ts = _data; 1439 - 1440 - sysfs_remove_group(&ts->client->dev.kobj, &mip4_attr_group); 1441 - } 1442 - 1443 1436 static int mip4_probe(struct i2c_client *client, const struct i2c_device_id *id) 1444 1437 { 1445 1438 struct mip4_ts *ts; ··· 1528 1535 return error; 1529 1536 } 1530 1537 1531 - error = sysfs_create_group(&client->dev.kobj, &mip4_attr_group); 1538 + error = devm_device_add_group(&client->dev, &mip4_attr_group); 1532 1539 if (error) { 1533 1540 dev_err(&client->dev, 1534 1541 "Failed to create sysfs attribute group: %d\n", error); 1535 - return error; 1536 - } 1537 - 1538 - error = devm_add_action(&client->dev, mip4_sysfs_remove, ts); 1539 - if (error) { 1540 - mip4_sysfs_remove(ts); 1541 - dev_err(&client->dev, 1542 - "Failed to install sysfs remoce action: %d\n", error); 1543 1542 return error; 1544 1543 } 1545 1544