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

Input: rohm_bu21023 - use device core to create driver-specific device attributes

Instead of creating driver-specific device attributes with
devm_device_add_group() have device core do this by setting up dev_groups
pointer in the driver structure.

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20230729005133.1095051-18-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

+2 -10
+2 -10
drivers/input/touchscreen/rohm_bu21023.c
··· 854 854 &dev_attr_inv_y.attr, 855 855 NULL, 856 856 }; 857 - 858 - static const struct attribute_group rohm_ts_attr_group = { 859 - .attrs = rohm_ts_attrs, 860 - }; 857 + ATTRIBUTE_GROUPS(rohm_ts); 861 858 862 859 static int rohm_ts_device_init(struct i2c_client *client, u8 setup2) 863 860 { ··· 1161 1164 return error; 1162 1165 } 1163 1166 1164 - error = devm_device_add_group(dev, &rohm_ts_attr_group); 1165 - if (error) { 1166 - dev_err(dev, "failed to create sysfs group: %d\n", error); 1167 - return error; 1168 - } 1169 - 1170 1167 return error; 1171 1168 } 1172 1169 ··· 1173 1182 static struct i2c_driver rohm_bu21023_i2c_driver = { 1174 1183 .driver = { 1175 1184 .name = BU21023_NAME, 1185 + .dev_groups = rohm_ts_groups, 1176 1186 }, 1177 1187 .probe = rohm_bu21023_i2c_probe, 1178 1188 .id_table = rohm_bu21023_i2c_id,