Commit a122a6fd authored by Dmitry Torokhov's avatar Dmitry Torokhov

Input: atmel_mxt_ts - use driver core to instantiate device attributes

Instead of manually creating driver-specific device attributes,
set struct driver->dev_groups pointer to have the driver core
do it.
Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/Zo9kSFeGOZB9b3rq@google.comSigned-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 8c98dddc
...@@ -3069,9 +3069,7 @@ static struct attribute *mxt_attrs[] = { ...@@ -3069,9 +3069,7 @@ static struct attribute *mxt_attrs[] = {
NULL NULL
}; };
static const struct attribute_group mxt_attr_group = { ATTRIBUTE_GROUPS(mxt);
.attrs = mxt_attrs,
};
static void mxt_start(struct mxt_data *data) static void mxt_start(struct mxt_data *data)
{ {
...@@ -3348,18 +3346,8 @@ static int mxt_probe(struct i2c_client *client) ...@@ -3348,18 +3346,8 @@ static int mxt_probe(struct i2c_client *client)
if (error) if (error)
goto err_disable_regulators; goto err_disable_regulators;
error = sysfs_create_group(&client->dev.kobj, &mxt_attr_group);
if (error) {
dev_err(&client->dev, "Failure %d creating sysfs group\n",
error);
goto err_free_object;
}
return 0; return 0;
err_free_object:
mxt_free_input_device(data);
mxt_free_object_table(data);
err_disable_regulators: err_disable_regulators:
regulator_bulk_disable(ARRAY_SIZE(data->regulators), regulator_bulk_disable(ARRAY_SIZE(data->regulators),
data->regulators); data->regulators);
...@@ -3371,7 +3359,6 @@ static void mxt_remove(struct i2c_client *client) ...@@ -3371,7 +3359,6 @@ static void mxt_remove(struct i2c_client *client)
struct mxt_data *data = i2c_get_clientdata(client); struct mxt_data *data = i2c_get_clientdata(client);
disable_irq(data->irq); disable_irq(data->irq);
sysfs_remove_group(&client->dev.kobj, &mxt_attr_group);
mxt_free_input_device(data); mxt_free_input_device(data);
mxt_free_object_table(data); mxt_free_object_table(data);
regulator_bulk_disable(ARRAY_SIZE(data->regulators), regulator_bulk_disable(ARRAY_SIZE(data->regulators),
...@@ -3455,6 +3442,7 @@ MODULE_DEVICE_TABLE(i2c, mxt_id); ...@@ -3455,6 +3442,7 @@ MODULE_DEVICE_TABLE(i2c, mxt_id);
static struct i2c_driver mxt_driver = { static struct i2c_driver mxt_driver = {
.driver = { .driver = {
.name = "atmel_mxt_ts", .name = "atmel_mxt_ts",
.dev_groups = mxt_groups,
.of_match_table = mxt_of_match, .of_match_table = mxt_of_match,
.acpi_match_table = ACPI_PTR(mxt_acpi_id), .acpi_match_table = ACPI_PTR(mxt_acpi_id),
.pm = pm_sleep_ptr(&mxt_pm_ops), .pm = pm_sleep_ptr(&mxt_pm_ops),
......
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