diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2023-07-29 02:51:19 +0200 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2023-09-06 23:29:01 +0200 |
commit | 354f1a2c170fbe5c9a6741c2c6a9ee0098c76b16 (patch) | |
tree | 6f1863b909271d8b3604c78448daa31ab7ea189f | |
parent | Input: elants_i2c - use device core to create driver-specific device attributes (diff) | |
download | linux-354f1a2c170fbe5c9a6741c2c6a9ee0098c76b16.tar.xz linux-354f1a2c170fbe5c9a6741c2c6a9ee0098c76b16.zip |
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>
-rw-r--r-- | drivers/input/touchscreen/exc3000.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/input/touchscreen/exc3000.c b/drivers/input/touchscreen/exc3000.c index e3f6d21b3c1b..654845c0cdcd 100644 --- a/drivers/input/touchscreen/exc3000.c +++ b/drivers/input/touchscreen/exc3000.c @@ -324,16 +324,13 @@ static ssize_t type_show(struct device *dev, } static DEVICE_ATTR_RO(type); -static struct attribute *sysfs_attrs[] = { +static struct attribute *exc3000_attrs[] = { &dev_attr_fw_version.attr, &dev_attr_model.attr, &dev_attr_type.attr, NULL }; - -static struct attribute_group exc3000_attribute_group = { - .attrs = sysfs_attrs -}; +ATTRIBUTE_GROUPS(exc3000); static int exc3000_probe(struct i2c_client *client) { @@ -436,10 +433,6 @@ static int exc3000_probe(struct i2c_client *client) i2c_set_clientdata(client, data); - error = devm_device_add_group(&client->dev, &exc3000_attribute_group); - if (error) - return error; - return 0; } @@ -464,6 +457,7 @@ MODULE_DEVICE_TABLE(of, exc3000_of_match); static struct i2c_driver exc3000_driver = { .driver = { .name = "exc3000", + .dev_groups = exc3000_groups, .of_match_table = of_match_ptr(exc3000_of_match), }, .id_table = exc3000_id, |