Input: hideep - 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-11-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
This commit is contained in:
parent
354f1a2c17
commit
12f2288b0b
@ -954,16 +954,13 @@ static DEVICE_ATTR(version, 0664, hideep_fw_version_show, NULL);
|
||||
static DEVICE_ATTR(product_id, 0664, hideep_product_id_show, NULL);
|
||||
static DEVICE_ATTR(update_fw, 0664, NULL, hideep_update_fw);
|
||||
|
||||
static struct attribute *hideep_ts_sysfs_entries[] = {
|
||||
static struct attribute *hideep_ts_attrs[] = {
|
||||
&dev_attr_version.attr,
|
||||
&dev_attr_product_id.attr,
|
||||
&dev_attr_update_fw.attr,
|
||||
NULL,
|
||||
};
|
||||
|
||||
static const struct attribute_group hideep_ts_attr_group = {
|
||||
.attrs = hideep_ts_sysfs_entries,
|
||||
};
|
||||
ATTRIBUTE_GROUPS(hideep_ts);
|
||||
|
||||
static void hideep_set_work_mode(struct hideep_ts *ts)
|
||||
{
|
||||
@ -1096,13 +1093,6 @@ static int hideep_probe(struct i2c_client *client)
|
||||
return error;
|
||||
}
|
||||
|
||||
error = devm_device_add_group(&client->dev, &hideep_ts_attr_group);
|
||||
if (error) {
|
||||
dev_err(&client->dev,
|
||||
"failed to add sysfs attributes: %d\n", error);
|
||||
return error;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1131,6 +1121,7 @@ MODULE_DEVICE_TABLE(of, hideep_match_table);
|
||||
static struct i2c_driver hideep_driver = {
|
||||
.driver = {
|
||||
.name = HIDEEP_I2C_NAME,
|
||||
.dev_groups = hideep_ts_groups,
|
||||
.of_match_table = of_match_ptr(hideep_match_table),
|
||||
.acpi_match_table = ACPI_PTR(hideep_acpi_id),
|
||||
.pm = pm_sleep_ptr(&hideep_pm_ops),
|
||||
|
Loading…
x
Reference in New Issue
Block a user