Commit a1bdf458 authored by Dmitry Torokhov's avatar Dmitry Torokhov

Input: edt-ft5x06 - 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-8-dmitry.torokhov@gmail.comSigned-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent e9f6aa10
...@@ -580,10 +580,7 @@ static struct attribute *edt_ft5x06_attrs[] = { ...@@ -580,10 +580,7 @@ static struct attribute *edt_ft5x06_attrs[] = {
&dev_attr_crc_errors.attr, &dev_attr_crc_errors.attr,
NULL NULL
}; };
ATTRIBUTE_GROUPS(edt_ft5x06);
static const struct attribute_group edt_ft5x06_attr_group = {
.attrs = edt_ft5x06_attrs,
};
static void edt_ft5x06_restore_reg_parameters(struct edt_ft5x06_ts_data *tsdata) static void edt_ft5x06_restore_reg_parameters(struct edt_ft5x06_ts_data *tsdata)
{ {
...@@ -1330,10 +1327,6 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client) ...@@ -1330,10 +1327,6 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client)
return error; return error;
} }
error = devm_device_add_group(&client->dev, &edt_ft5x06_attr_group);
if (error)
return error;
error = input_register_device(input); error = input_register_device(input);
if (error) if (error)
return error; return error;
...@@ -1502,6 +1495,7 @@ MODULE_DEVICE_TABLE(of, edt_ft5x06_of_match); ...@@ -1502,6 +1495,7 @@ MODULE_DEVICE_TABLE(of, edt_ft5x06_of_match);
static struct i2c_driver edt_ft5x06_ts_driver = { static struct i2c_driver edt_ft5x06_ts_driver = {
.driver = { .driver = {
.name = "edt_ft5x06", .name = "edt_ft5x06",
.dev_groups = edt_ft5x06_groups,
.of_match_table = edt_ft5x06_of_match, .of_match_table = edt_ft5x06_of_match,
.pm = pm_sleep_ptr(&edt_ft5x06_ts_pm_ops), .pm = pm_sleep_ptr(&edt_ft5x06_ts_pm_ops),
.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