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

Input: atmel_mxt_ts - use driver core to instantiate device attributes

Instead of manually creating driver-specific device attributes,
set struct driver->dev_groups pointer to have the driver core
do it.

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

+2 -14
+2 -14
drivers/input/touchscreen/atmel_mxt_ts.c
··· 3069 3069 NULL 3070 3070 }; 3071 3071 3072 - static const struct attribute_group mxt_attr_group = { 3073 - .attrs = mxt_attrs, 3074 - }; 3072 + ATTRIBUTE_GROUPS(mxt); 3075 3073 3076 3074 static void mxt_start(struct mxt_data *data) 3077 3075 { ··· 3346 3348 if (error) 3347 3349 goto err_disable_regulators; 3348 3350 3349 - error = sysfs_create_group(&client->dev.kobj, &mxt_attr_group); 3350 - if (error) { 3351 - dev_err(&client->dev, "Failure %d creating sysfs group\n", 3352 - error); 3353 - goto err_free_object; 3354 - } 3355 - 3356 3351 return 0; 3357 3352 3358 - err_free_object: 3359 - mxt_free_input_device(data); 3360 - mxt_free_object_table(data); 3361 3353 err_disable_regulators: 3362 3354 regulator_bulk_disable(ARRAY_SIZE(data->regulators), 3363 3355 data->regulators); ··· 3359 3371 struct mxt_data *data = i2c_get_clientdata(client); 3360 3372 3361 3373 disable_irq(data->irq); 3362 - sysfs_remove_group(&client->dev.kobj, &mxt_attr_group); 3363 3374 mxt_free_input_device(data); 3364 3375 mxt_free_object_table(data); 3365 3376 regulator_bulk_disable(ARRAY_SIZE(data->regulators), ··· 3442 3455 static struct i2c_driver mxt_driver = { 3443 3456 .driver = { 3444 3457 .name = "atmel_mxt_ts", 3458 + .dev_groups = mxt_groups, 3445 3459 .of_match_table = mxt_of_match, 3446 3460 .acpi_match_table = ACPI_PTR(mxt_acpi_id), 3447 3461 .pm = pm_sleep_ptr(&mxt_pm_ops),