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

Input: raydium_i2c_ts - 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
b887df52 4c16f82e

+1 -17
+1 -17
drivers/input/touchscreen/raydium_i2c_ts.c
··· 943 943 .attrs = raydium_i2c_attributes, 944 944 }; 945 945 946 - static void raydium_i2c_remove_sysfs_group(void *_data) 947 - { 948 - struct raydium_data *ts = _data; 949 - 950 - sysfs_remove_group(&ts->client->dev.kobj, &raydium_i2c_attribute_group); 951 - } 952 - 953 946 static int raydium_i2c_power_on(struct raydium_data *ts) 954 947 { 955 948 int error; ··· 1113 1120 return error; 1114 1121 } 1115 1122 1116 - error = sysfs_create_group(&client->dev.kobj, 1123 + error = devm_device_add_group(&client->dev, 1117 1124 &raydium_i2c_attribute_group); 1118 1125 if (error) { 1119 1126 dev_err(&client->dev, "failed to create sysfs attributes: %d\n", 1120 1127 error); 1121 - return error; 1122 - } 1123 - 1124 - error = devm_add_action(&client->dev, 1125 - raydium_i2c_remove_sysfs_group, ts); 1126 - if (error) { 1127 - raydium_i2c_remove_sysfs_group(ts); 1128 - dev_err(&client->dev, 1129 - "Failed to add sysfs cleanup action: %d\n", error); 1130 1128 return error; 1131 1129 } 1132 1130