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

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

+3 -9
+3 -9
drivers/input/touchscreen/exc3000.c
··· 324 324 } 325 325 static DEVICE_ATTR_RO(type); 326 326 327 - static struct attribute *sysfs_attrs[] = { 327 + static struct attribute *exc3000_attrs[] = { 328 328 &dev_attr_fw_version.attr, 329 329 &dev_attr_model.attr, 330 330 &dev_attr_type.attr, 331 331 NULL 332 332 }; 333 - 334 - static struct attribute_group exc3000_attribute_group = { 335 - .attrs = sysfs_attrs 336 - }; 333 + ATTRIBUTE_GROUPS(exc3000); 337 334 338 335 static int exc3000_probe(struct i2c_client *client) 339 336 { ··· 433 436 434 437 i2c_set_clientdata(client, data); 435 438 436 - error = devm_device_add_group(&client->dev, &exc3000_attribute_group); 437 - if (error) 438 - return error; 439 - 440 439 return 0; 441 440 } 442 441 ··· 457 464 static struct i2c_driver exc3000_driver = { 458 465 .driver = { 459 466 .name = "exc3000", 467 + .dev_groups = exc3000_groups, 460 468 .of_match_table = of_match_ptr(exc3000_of_match), 461 469 }, 462 470 .id_table = exc3000_id,