Commit 6cc3ecfd authored by Dmitry Torokhov's avatar Dmitry Torokhov

Input: stmfts - 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 avatarAndi Shyti <andi.shyti@kernel.org>
Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20230729005133.1095051-20-dmitry.torokhov@gmail.comSigned-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 2ad95281
...@@ -517,10 +517,7 @@ static struct attribute *stmfts_sysfs_attrs[] = { ...@@ -517,10 +517,7 @@ static struct attribute *stmfts_sysfs_attrs[] = {
&dev_attr_hover_enable.attr, &dev_attr_hover_enable.attr,
NULL NULL
}; };
ATTRIBUTE_GROUPS(stmfts_sysfs);
static struct attribute_group stmfts_attribute_group = {
.attrs = stmfts_sysfs_attrs
};
static int stmfts_power_on(struct stmfts_data *sdata) static int stmfts_power_on(struct stmfts_data *sdata)
{ {
...@@ -727,10 +724,6 @@ static int stmfts_probe(struct i2c_client *client) ...@@ -727,10 +724,6 @@ static int stmfts_probe(struct i2c_client *client)
} }
} }
err = devm_device_add_group(&client->dev, &stmfts_attribute_group);
if (err)
return err;
pm_runtime_enable(&client->dev); pm_runtime_enable(&client->dev);
device_enable_async_suspend(&client->dev); device_enable_async_suspend(&client->dev);
...@@ -804,6 +797,7 @@ MODULE_DEVICE_TABLE(i2c, stmfts_id); ...@@ -804,6 +797,7 @@ MODULE_DEVICE_TABLE(i2c, stmfts_id);
static struct i2c_driver stmfts_driver = { static struct i2c_driver stmfts_driver = {
.driver = { .driver = {
.name = STMFTS_DEV_NAME, .name = STMFTS_DEV_NAME,
.dev_groups = stmfts_sysfs_groups,
.of_match_table = of_match_ptr(stmfts_of_match), .of_match_table = of_match_ptr(stmfts_of_match),
.pm = pm_ptr(&stmfts_pm_ops), .pm = pm_ptr(&stmfts_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