diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2023-07-28 17:51:21 -0700 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2023-09-06 14:29:02 -0700 |
commit | d9d538cac29a8e60a8461003b449b52201b4131c (patch) | |
tree | 69977de1ee4e5cb363ea03ea5126a31814fcc5e6 | |
parent | 12f2288b0b635476f022597a8474a4aca8d9c0d6 (diff) | |
download | lwn-d9d538cac29a8e60a8461003b449b52201b4131c.tar.gz lwn-d9d538cac29a8e60a8461003b449b52201b4131c.zip |
Input: hycon-hy46xx - 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-12-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-rw-r--r-- | drivers/input/touchscreen/hycon-hy46xx.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/input/touchscreen/hycon-hy46xx.c b/drivers/input/touchscreen/hycon-hy46xx.c index 2450cfa14de9..d0f257989fd6 100644 --- a/drivers/input/touchscreen/hycon-hy46xx.c +++ b/drivers/input/touchscreen/hycon-hy46xx.c @@ -274,10 +274,7 @@ static struct attribute *hycon_hy46xx_attrs[] = { &hycon_hy46xx_attr_bootloader_version.dattr.attr, NULL }; - -static const struct attribute_group hycon_hy46xx_attr_group = { - .attrs = hycon_hy46xx_attrs, -}; +ATTRIBUTE_GROUPS(hycon_hy46xx); static void hycon_hy46xx_get_defaults(struct device *dev, struct hycon_hy46xx_data *tsdata) { @@ -535,10 +532,6 @@ static int hycon_hy46xx_probe(struct i2c_client *client) return error; } - error = devm_device_add_group(&client->dev, &hycon_hy46xx_attr_group); - if (error) - return error; - error = input_register_device(input); if (error) return error; @@ -576,6 +569,7 @@ MODULE_DEVICE_TABLE(of, hycon_hy46xx_of_match); static struct i2c_driver hycon_hy46xx_driver = { .driver = { .name = "hycon_hy46xx", + .dev_groups = hycon_hy46xx_groups, .of_match_table = hycon_hy46xx_of_match, .probe_type = PROBE_PREFER_ASYNCHRONOUS, }, |