Commit d9d538ca authored by Dmitry Torokhov's avatar Dmitry Torokhov

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: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20230729005133.1095051-12-dmitry.torokhov@gmail.comSigned-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 12f2288b
...@@ -274,10 +274,7 @@ static struct attribute *hycon_hy46xx_attrs[] = { ...@@ -274,10 +274,7 @@ static struct attribute *hycon_hy46xx_attrs[] = {
&hycon_hy46xx_attr_bootloader_version.dattr.attr, &hycon_hy46xx_attr_bootloader_version.dattr.attr,
NULL NULL
}; };
ATTRIBUTE_GROUPS(hycon_hy46xx);
static const struct attribute_group hycon_hy46xx_attr_group = {
.attrs = hycon_hy46xx_attrs,
};
static void hycon_hy46xx_get_defaults(struct device *dev, struct hycon_hy46xx_data *tsdata) 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) ...@@ -535,10 +532,6 @@ static int hycon_hy46xx_probe(struct i2c_client *client)
return error; return error;
} }
error = devm_device_add_group(&client->dev, &hycon_hy46xx_attr_group);
if (error)
return error;
error = input_register_device(input); error = input_register_device(input);
if (error) if (error)
return error; return error;
...@@ -576,6 +569,7 @@ MODULE_DEVICE_TABLE(of, hycon_hy46xx_of_match); ...@@ -576,6 +569,7 @@ MODULE_DEVICE_TABLE(of, hycon_hy46xx_of_match);
static struct i2c_driver hycon_hy46xx_driver = { static struct i2c_driver hycon_hy46xx_driver = {
.driver = { .driver = {
.name = "hycon_hy46xx", .name = "hycon_hy46xx",
.dev_groups = hycon_hy46xx_groups,
.of_match_table = hycon_hy46xx_of_match, .of_match_table = hycon_hy46xx_of_match,
.probe_type = PROBE_PREFER_ASYNCHRONOUS, .probe_type = PROBE_PREFER_ASYNCHRONOUS,
}, },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment