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

Input: s6sy761 - 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-19-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

+2 -8
+2 -8
drivers/input/touchscreen/s6sy761.c
··· 286 286 &dev_attr_devid.attr, 287 287 NULL 288 288 }; 289 - 290 - static struct attribute_group s6sy761_attribute_group = { 291 - .attrs = s6sy761_sysfs_attrs 292 - }; 289 + ATTRIBUTE_GROUPS(s6sy761_sysfs); 293 290 294 291 static int s6sy761_power_on(struct s6sy761_data *sdata) 295 292 { ··· 462 465 if (err) 463 466 return err; 464 467 465 - err = devm_device_add_group(&client->dev, &s6sy761_attribute_group); 466 - if (err) 467 - return err; 468 - 469 468 pm_runtime_enable(&client->dev); 470 469 471 470 return 0; ··· 528 535 static struct i2c_driver s6sy761_driver = { 529 536 .driver = { 530 537 .name = S6SY761_DEV_NAME, 538 + .dev_groups = s6sy761_sysfs_groups, 531 539 .of_match_table = of_match_ptr(s6sy761_of_match), 532 540 .pm = pm_ptr(&s6sy761_pm_ops), 533 541 },