From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: linux-input@vger.kernel.org
Cc: linux-kernel@vger.kernel.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Douglas Anderson <dianders@chromium.org>,
Raul E Rangel <rrangel@chromium.org>
Subject: [PATCH 09/22] Input: elants_i2c - use device core to create driver-specific device attributes
Date: Fri, 28 Jul 2023 17:51:18 -0700 [thread overview]
Message-ID: <20230729005133.1095051-9-dmitry.torokhov@gmail.com> (raw)
In-Reply-To: <20230729005133.1095051-1-dmitry.torokhov@gmail.com>
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.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
drivers/input/touchscreen/elants_i2c.c | 15 +++------------
1 file changed, 3 insertions(+), 12 deletions(-)
diff --git a/drivers/input/touchscreen/elants_i2c.c b/drivers/input/touchscreen/elants_i2c.c
index a1af3de9f310..365765d40e62 100644
--- a/drivers/input/touchscreen/elants_i2c.c
+++ b/drivers/input/touchscreen/elants_i2c.c
@@ -1299,7 +1299,7 @@ static ELANTS_VERSION_ATTR(solution_version);
static ELANTS_VERSION_ATTR(bc_version);
static ELANTS_VERSION_ATTR(iap_version);
-static struct attribute *elants_attributes[] = {
+static struct attribute *elants_i2c_attrs[] = {
&dev_attr_calibrate.attr,
&dev_attr_update_fw.attr,
&dev_attr_iap_mode.attr,
@@ -1313,10 +1313,7 @@ static struct attribute *elants_attributes[] = {
&elants_ver_attr_iap_version.dattr.attr,
NULL
};
-
-static const struct attribute_group elants_attribute_group = {
- .attrs = elants_attributes,
-};
+ATTRIBUTE_GROUPS(elants_i2c);
static int elants_i2c_power_on(struct elants_data *ts)
{
@@ -1552,13 +1549,6 @@ static int elants_i2c_probe(struct i2c_client *client)
return error;
}
- error = devm_device_add_group(&client->dev, &elants_attribute_group);
- if (error) {
- dev_err(&client->dev, "failed to create sysfs attributes: %d\n",
- error);
- return error;
- }
-
return 0;
}
@@ -1667,6 +1657,7 @@ static struct i2c_driver elants_i2c_driver = {
.id_table = elants_i2c_id,
.driver = {
.name = DEVICE_NAME,
+ .dev_groups = elants_i2c_groups,
.pm = pm_sleep_ptr(&elants_i2c_pm_ops),
.acpi_match_table = ACPI_PTR(elants_acpi_id),
.of_match_table = of_match_ptr(elants_of_match),
--
2.41.0.487.g6d72f3e995-goog
next prev parent reply other threads:[~2023-07-29 0:54 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-29 0:51 [PATCH 01/22] Input: cros_ec_keyb - use device core to create driver-specific device attributes Dmitry Torokhov
2023-07-29 0:51 ` [PATCH 02/22] Input: cyapa " Dmitry Torokhov
2023-07-29 0:51 ` [PATCH 03/22] Input: iqs269a " Dmitry Torokhov
2023-07-31 15:41 ` Jeff LaBundy
2023-08-02 13:01 ` Mattijs Korpershoek
2023-07-29 0:51 ` [PATCH 04/22] Input: kxtj9 " Dmitry Torokhov
2023-07-29 0:51 ` [PATCH 05/22] Input: ad7877 " Dmitry Torokhov
2023-07-31 5:23 ` Hennerich, Michael
2023-07-29 0:51 ` [PATCH 06/22] Input: ad7879 " Dmitry Torokhov
2023-07-31 5:23 ` Hennerich, Michael
2023-07-29 0:51 ` [PATCH 07/22] Input: ads7846 " Dmitry Torokhov
2023-07-29 0:51 ` [PATCH 08/22] Input: edt-ft5x06 " Dmitry Torokhov
2023-07-29 0:51 ` Dmitry Torokhov [this message]
2023-07-29 0:51 ` [PATCH 10/22] Input: exc3000 " Dmitry Torokhov
2023-07-29 0:51 ` [PATCH 11/22] Input: hideep " Dmitry Torokhov
2023-07-29 0:51 ` [PATCH 12/22] Input: hycon-hy46xx " Dmitry Torokhov
2023-07-29 0:51 ` [PATCH 13/22] Input: ili210x " Dmitry Torokhov
2023-07-29 15:07 ` Marek Vasut
2023-07-30 11:38 ` Greg Kroah-Hartman
2023-07-30 12:24 ` Marek Vasut
2023-07-29 0:51 ` [PATCH 14/22] Input: ilitek_ts_i2c " Dmitry Torokhov
2023-07-29 0:51 ` [PATCH 15/22] Input: iqs5xx " Dmitry Torokhov
2023-07-31 15:43 ` Jeff LaBundy
2023-07-29 0:51 ` [PATCH 16/22] Input: melfas-mip4 " Dmitry Torokhov
2023-07-29 0:51 ` [PATCH 17/22] Input: raydium_i2c_ts " Dmitry Torokhov
2023-07-29 0:51 ` [PATCH 18/22] Input: rohm_bu21023 " Dmitry Torokhov
2023-07-29 0:51 ` [PATCH 19/22] Input: s6sy761 " Dmitry Torokhov
2023-07-30 13:02 ` Andi Shyti
2023-07-29 0:51 ` [PATCH 20/22] Input: stmfts " Dmitry Torokhov
2023-07-30 13:02 ` Andi Shyti
2023-07-29 0:51 ` [PATCH 21/22] Input: tsc2004/5 " Dmitry Torokhov
2023-07-29 0:51 ` [PATCH 22/22] Input: wdt87xx_i2c " Dmitry Torokhov
2023-07-29 2:40 ` [PATCH 01/22] Input: cros_ec_keyb " Guenter Roeck
2023-07-30 11:39 ` Greg Kroah-Hartman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230729005133.1095051-9-dmitry.torokhov@gmail.com \
--to=dmitry.torokhov@gmail.com \
--cc=dianders@chromium.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rrangel@chromium.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).