linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 01/22] Input: cros_ec_keyb - use device core to create driver-specific device attributes
@ 2023-07-29  0:51 Dmitry Torokhov
  2023-07-29  0:51 ` [PATCH 02/22] Input: cyapa " Dmitry Torokhov
                   ` (22 more replies)
  0 siblings, 23 replies; 34+ messages in thread
From: Dmitry Torokhov @ 2023-07-29  0:51 UTC (permalink / raw)
  To: linux-input
  Cc: linux-kernel, Greg Kroah-Hartman, Benson Leung, Guenter Roeck,
	chrome-platform

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/keyboard/cros_ec_keyb.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/input/keyboard/cros_ec_keyb.c b/drivers/input/keyboard/cros_ec_keyb.c
index e7ecfca838df..313b7a69dd69 100644
--- a/drivers/input/keyboard/cros_ec_keyb.c
+++ b/drivers/input/keyboard/cros_ec_keyb.c
@@ -686,10 +686,11 @@ static umode_t cros_ec_keyb_attr_is_visible(struct kobject *kobj,
 	return attr->mode;
 }
 
-static const struct attribute_group cros_ec_keyb_attr_group = {
+static const struct attribute_group cros_ec_keyb_group = {
 	.is_visible = cros_ec_keyb_attr_is_visible,
 	.attrs = cros_ec_keyb_attrs,
 };
+__ATTRIBUTE_GROUPS(cros_ec_keyb);
 
 static int cros_ec_keyb_probe(struct platform_device *pdev)
 {
@@ -730,12 +731,6 @@ static int cros_ec_keyb_probe(struct platform_device *pdev)
 		return err;
 	}
 
-	err = devm_device_add_group(dev, &cros_ec_keyb_attr_group);
-	if (err) {
-		dev_err(dev, "failed to create attributes: %d\n", err);
-		return err;
-	}
-
 	ckdev->notifier.notifier_call = cros_ec_keyb_work;
 	err = blocking_notifier_chain_register(&ckdev->ec->event_notifier,
 					       &ckdev->notifier);
@@ -782,6 +777,7 @@ static struct platform_driver cros_ec_keyb_driver = {
 	.remove = cros_ec_keyb_remove,
 	.driver = {
 		.name = "cros-ec-keyb",
+		.dev_groups = cros_ec_keyb_groups,
 		.of_match_table = of_match_ptr(cros_ec_keyb_of_match),
 		.acpi_match_table = ACPI_PTR(cros_ec_keyb_acpi_match),
 		.pm = pm_sleep_ptr(&cros_ec_keyb_pm_ops),
-- 
2.41.0.487.g6d72f3e995-goog


^ permalink raw reply related	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2023-08-02 13:01 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH 09/22] Input: elants_i2c " Dmitry Torokhov
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

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).