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

Input: stmfts - 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: Andi Shyti <andi.shyti@kernel.org>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20230729005133.1095051-20-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

+2 -8
+2 -8
drivers/input/touchscreen/stmfts.c
··· 517 517 &dev_attr_hover_enable.attr, 518 518 NULL 519 519 }; 520 - 521 - static struct attribute_group stmfts_attribute_group = { 522 - .attrs = stmfts_sysfs_attrs 523 - }; 520 + ATTRIBUTE_GROUPS(stmfts_sysfs); 524 521 525 522 static int stmfts_power_on(struct stmfts_data *sdata) 526 523 { ··· 724 727 } 725 728 } 726 729 727 - err = devm_device_add_group(&client->dev, &stmfts_attribute_group); 728 - if (err) 729 - return err; 730 - 731 730 pm_runtime_enable(&client->dev); 732 731 device_enable_async_suspend(&client->dev); 733 732 ··· 797 804 static struct i2c_driver stmfts_driver = { 798 805 .driver = { 799 806 .name = STMFTS_DEV_NAME, 807 + .dev_groups = stmfts_sysfs_groups, 800 808 .of_match_table = of_match_ptr(stmfts_of_match), 801 809 .pm = pm_ptr(&stmfts_pm_ops), 802 810 .probe_type = PROBE_PREFER_ASYNCHRONOUS,