From patchwork Sat Jul 29 00:51:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 708160 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 12D2FC001DE for ; Sat, 29 Jul 2023 00:55:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237261AbjG2AzV (ORCPT ); Fri, 28 Jul 2023 20:55:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233870AbjG2Ay5 (ORCPT ); Fri, 28 Jul 2023 20:54:57 -0400 Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4C054498; Fri, 28 Jul 2023 17:53:52 -0700 (PDT) Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-1bbf3da0ea9so5449445ad.2; Fri, 28 Jul 2023 17:53:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690591897; x=1691196697; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=6jtitKPmPv1QZ35jWw/TxRZ9JZX7OXyPiqS7eZQkRX0=; b=ZLrGn05MUkHmy9umqhyalvo6jULTXifsXM898LgnZypiokj4DbhjGA2DKicQPylNZT bsHjkWRTsweAmrnW45in3M5LlfLJlb/BdWnvDJ6/iSj99oJo58PBy8L1wWtX9ojkLAIg ZA7J1phe7ohuI6F1saudthk0P3MEGpTLuXOO7Wydxqc2SmBo6g4iZJ+z/3wQEuRp39zI aW83IzmOs9balI94wHr4x83W9RbgCVokkkGgv+Kk+V7FSk2//UI3IDchr2sahlJaNhZd Zs6ynTqSZzEgqNkv3AkqEexfYs4Qx7JTtF1sJIBa/A9ONGMb96/x171Phf1CjcLQoMJ/ 6NCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690591897; x=1691196697; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=6jtitKPmPv1QZ35jWw/TxRZ9JZX7OXyPiqS7eZQkRX0=; b=Y64rcDy2G8SDuAwaxzamYebPeY0V6NXAxboHAtrGkwjJiRK/K9GCL/TSpgaDhLws7A 88G4J0CHz6Ym51Qsfcq67sBk3RVqwmcJGbVzKNDjSt9D0UgAbALfgMLD80gQN2yxEM+G Ph1FZUhARfXPoQT65eSQWXafG3Aq5IczmqKtvxEBYSjfHIvbw2MThMxnfgaJg2Bf1aih EetBYDohN5zDpVmOVo6RFlu2s787yB/mozNqHOlQFLjqPOewqTv54lfe48eUZ4jfqBhx BuisESG/vYEUaxm1COhy3t4AFa/J8mWaNNyqQ4a6OMK879fI0i/cm9V8rJOREDsh78hy aZdQ== X-Gm-Message-State: ABy/qLYLigbwvRNIcreGs3s37H6fljSUwRvJhlhD3sYgpv47QBf876WI rfffJGZvFb+IdAzDXFO+BCbRMrOAHNk= X-Google-Smtp-Source: APBJJlE1c+ch5XpoWIAq/65XLons7xmMFKcehpJoYCmLqy5YYddBugUThZZxJGZXqs+SYttzVNxZVg== X-Received: by 2002:a17:902:b7c5:b0:1b8:9b5e:a218 with SMTP id v5-20020a170902b7c500b001b89b5ea218mr2523742plz.42.1690591897281; Fri, 28 Jul 2023 17:51:37 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:9d:2:bc93:3749:59cc:1d5c]) by smtp.gmail.com with ESMTPSA id h12-20020a170902704c00b001bb97e51ab4sm4149524plt.98.2023.07.28.17.51.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jul 2023 17:51:36 -0700 (PDT) From: Dmitry Torokhov To: linux-input@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Benson Leung , Guenter Roeck , chrome-platform@lists.linux.dev Subject: [PATCH 01/22] Input: cros_ec_keyb - use device core to create driver-specific device attributes Date: Fri, 28 Jul 2023 17:51:10 -0700 Message-ID: <20230729005133.1095051-1-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org 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 Reviewed-by: Guenter Roeck Reviewed-by: Greg Kroah-Hartman --- 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), From patchwork Sat Jul 29 00:51:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 708352 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8DAF1C001DE for ; Sat, 29 Jul 2023 00:55:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237042AbjG2AzJ (ORCPT ); Fri, 28 Jul 2023 20:55:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237041AbjG2Ayp (ORCPT ); Fri, 28 Jul 2023 20:54:45 -0400 Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E36EE559A; Fri, 28 Jul 2023 17:53:39 -0700 (PDT) Received: by mail-pj1-f45.google.com with SMTP id 98e67ed59e1d1-26854159c05so1584645a91.2; Fri, 28 Jul 2023 17:53:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690591898; x=1691196698; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=z1OytN0ue9ni3jtAUdTpAVvFgRrAknSTdRSvg9LBsxw=; b=ZV6kF4ZQaKSSXPRpulLU3lw0CkuKf3x4WNqUSfPx2mZo8SjYvygXxOjd5i32YXgGau xdM2fUf9PunPg3VUit6/1r6bfxLsfdIPVya/89C3e2N/duEynrq74T0qjJKQsGUsu1oj 9fD9sVZLrBNiA48zmx++v78VS7gfKxhmin5fsitdrqHI9+aK9lULKcsPpKXArnrehhdu llCng2cjU7EuWsiZmGr7/4PJs7f7SGlhesHXV/OfWfXbwsX/ZIakIAAIK1iH5tGqhXjh xIef2J84J6MTkOzP4lelYmME/Vx4q1/RwtB6gdjol3EsHCjJzy65md7VowQXMF/xpAbQ hgyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690591898; x=1691196698; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=z1OytN0ue9ni3jtAUdTpAVvFgRrAknSTdRSvg9LBsxw=; b=K39VE5/+YeZetkFxBzcjtfQ8Pq4Q8cr1VEgQE0kHh4uOaRKYR/9ou/zrq/J3PopT3d 7CSh47VBRj13+DVlefzwgkLIM1tsByim9A/7E19OQYRWdSZqxWfHEpz8IYe3X970UuoS Uj6yAioqKjqN8fP8OynLHL3gwvSomZLHfCKDKZsjxKjbTE4xP3ImAQUVCvMlVDJ9Sv/W JUNRIgqKp4Deomu8uNTP6fXjyDwmWU1gFYNji0Xf+oLCeu13vozyrvBC/o6gSPLF4zcl FSIqvS6usEK87BnHzjg50J0nHsYsQMz8M088VsJpvod9tKCfVZIyZn7mvdSbGoh4mpNI SLjQ== X-Gm-Message-State: ABy/qLbP6ZGj2KvmRhQ7jVsmlNj/LIZbNes37vzfTpUX7Na+HgZsy483 gafJyZEebhhSvtXWAK76Ggj7kR/UbjI= X-Google-Smtp-Source: APBJJlFay8COHXJLtUVNgH0E/pRyc9mXF6LuA/OWWh+px5PfExVnxKJLqcbArJCPe1ZALCjj7Mmbpg== X-Received: by 2002:a17:90b:e07:b0:268:2543:723 with SMTP id ge7-20020a17090b0e0700b0026825430723mr2957906pjb.5.1690591897994; Fri, 28 Jul 2023 17:51:37 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:9d:2:bc93:3749:59cc:1d5c]) by smtp.gmail.com with ESMTPSA id h12-20020a170902704c00b001bb97e51ab4sm4149524plt.98.2023.07.28.17.51.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jul 2023 17:51:37 -0700 (PDT) From: Dmitry Torokhov To: linux-input@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman Subject: [PATCH 02/22] Input: cyapa - use device core to create driver-specific device attributes Date: Fri, 28 Jul 2023 17:51:11 -0700 Message-ID: <20230729005133.1095051-2-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog In-Reply-To: <20230729005133.1095051-1-dmitry.torokhov@gmail.com> References: <20230729005133.1095051-1-dmitry.torokhov@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org 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 --- drivers/input/mouse/cyapa.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/drivers/input/mouse/cyapa.c b/drivers/input/mouse/cyapa.c index 6a876ba617ef..f9b4a7458b4e 100644 --- a/drivers/input/mouse/cyapa.c +++ b/drivers/input/mouse/cyapa.c @@ -1225,7 +1225,7 @@ static DEVICE_ATTR(baseline, S_IRUGO, cyapa_show_baseline, NULL); static DEVICE_ATTR(calibrate, S_IWUSR, NULL, cyapa_calibrate_store); static DEVICE_ATTR(mode, S_IRUGO, cyapa_show_mode, NULL); -static struct attribute *cyapa_sysfs_entries[] = { +static struct attribute *cyapa_attrs[] = { &dev_attr_firmware_version.attr, &dev_attr_product_id.attr, &dev_attr_update_fw.attr, @@ -1234,10 +1234,7 @@ static struct attribute *cyapa_sysfs_entries[] = { &dev_attr_mode.attr, NULL, }; - -static const struct attribute_group cyapa_sysfs_group = { - .attrs = cyapa_sysfs_entries, -}; +ATTRIBUTE_GROUPS(cyapa); static void cyapa_disable_regulator(void *data) { @@ -1304,12 +1301,6 @@ static int cyapa_probe(struct i2c_client *client) return error; } - error = devm_device_add_group(dev, &cyapa_sysfs_group); - if (error) { - dev_err(dev, "failed to create sysfs entries: %d\n", error); - return error; - } - error = cyapa_prepare_wakeup_controls(cyapa); if (error) { dev_err(dev, "failed to prepare wakeup controls: %d\n", error); @@ -1486,6 +1477,7 @@ MODULE_DEVICE_TABLE(of, cyapa_of_match); static struct i2c_driver cyapa_driver = { .driver = { .name = "cyapa", + .dev_groups = cyapa_groups, .pm = pm_ptr(&cyapa_pm_ops), .acpi_match_table = ACPI_PTR(cyapa_acpi_id), .of_match_table = of_match_ptr(cyapa_of_match), From patchwork Sat Jul 29 00:51:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 708170 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E08BAEB64DD for ; Sat, 29 Jul 2023 00:53:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234455AbjG2AxJ (ORCPT ); Fri, 28 Jul 2023 20:53:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233739AbjG2AxI (ORCPT ); Fri, 28 Jul 2023 20:53:08 -0400 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1AAB935A8; Fri, 28 Jul 2023 17:52:42 -0700 (PDT) Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-1bb2468257fso16171525ad.0; Fri, 28 Jul 2023 17:52:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690591899; x=1691196699; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=lOqwUZOD3iGOUgPMbPI/eioSmDoBO3NjKtRLPGRngeo=; b=lhNeigezZwzRoJxUcVIY8eGjZOf6ViWmOH8wNGgE904YXd/PWlxKLBMtpcxnC2O7uU LaiStYLBngBWZHLJ6LIPGJ1KgyPllwqqH6KnVObuqbimpo0wYm6EnnYZ58yG++rSu8pS ahc4RzUerC6KqoK1fxF9OUCS70SkW1kS1TbOV1/Rcdi/CYGCHmuB+o9Tfd0zLe1QnmpX j5DzzllfDYhoeXk5fnXnmQ2urzbRuSj7OgA7tMhOPwsvofaeE6c+500dmmWmridyQBKI b634CB/e9qIlGo2QnJhkY3XDovSkRF3YWmvzP/KPUUwzvHluXDqKr8p81S5hZ6fP98mK +OgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690591899; x=1691196699; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lOqwUZOD3iGOUgPMbPI/eioSmDoBO3NjKtRLPGRngeo=; b=MWhRrFRS7z1pt5xY+lOlSFAgXWKxe4pbICyhuI3CHkqM9DF1ckn2kDkGZy0fWpdcdE xHnekH2IdxwoWokixXo7maQ+E1jYEmLoZo1C6maLfOk7NAd5D60sUrWiH9df2hs5Rrew B65q4s5XRArblWoJV6vl45uOeU876XmwNn/ywi4825ay724XSRvo/KvJARv/6m63TyZk DLkR2i2lz4UODBTRYinBryhExcS3Y4eef90DBFwhT1yqAujACFhMEuaf06XCtre3cist DvvUmGVPiljkwLwUaLNyvsUEi4FSBlGuN4SBcWjZrvB22xAynovjoEaFmxqPM+bMRLUc fFSw== X-Gm-Message-State: ABy/qLYj2SPuRwYzyHce9WVjbPocE+rW/H45Km89C/aunvSpY5kCp4/0 9j/xNd6++zEWeX8EjsPMrus8HkDmpsw= X-Google-Smtp-Source: APBJJlE4WYWVihtD0HtEWfNAjBmNOjMXBbBlyhlU2Jj6cdGH2CzmhllEiTfzl6zveHjaqH43JuZ+SA== X-Received: by 2002:a17:903:32d1:b0:1bb:d59d:8c57 with SMTP id i17-20020a17090332d100b001bbd59d8c57mr3190807plr.18.1690591898798; Fri, 28 Jul 2023 17:51:38 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:9d:2:bc93:3749:59cc:1d5c]) by smtp.gmail.com with ESMTPSA id h12-20020a170902704c00b001bb97e51ab4sm4149524plt.98.2023.07.28.17.51.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jul 2023 17:51:38 -0700 (PDT) From: Dmitry Torokhov To: linux-input@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Jeff LaBundy , Mattijs Korpershoek Subject: [PATCH 03/22] Input: iqs269a - use device core to create driver-specific device attributes Date: Fri, 28 Jul 2023 17:51:12 -0700 Message-ID: <20230729005133.1095051-3-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog In-Reply-To: <20230729005133.1095051-1-dmitry.torokhov@gmail.com> References: <20230729005133.1095051-1-dmitry.torokhov@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org 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 Reviewed-by: Jeff LaBundy Reviewed-by: Mattijs Korpershoek --- drivers/input/misc/iqs269a.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/input/misc/iqs269a.c b/drivers/input/misc/iqs269a.c index c0a085639870..3c636c75e8a1 100644 --- a/drivers/input/misc/iqs269a.c +++ b/drivers/input/misc/iqs269a.c @@ -1586,10 +1586,7 @@ static struct attribute *iqs269_attrs[] = { &dev_attr_ati_trigger.attr, NULL, }; - -static const struct attribute_group iqs269_attr_group = { - .attrs = iqs269_attrs, -}; +ATTRIBUTE_GROUPS(iqs269); static const struct regmap_config iqs269_regmap_config = { .reg_bits = 8, @@ -1671,10 +1668,6 @@ static int iqs269_probe(struct i2c_client *client) return error; } - error = devm_device_add_group(&client->dev, &iqs269_attr_group); - if (error) - dev_err(&client->dev, "Failed to add attributes: %d\n", error); - return error; } @@ -1743,6 +1736,7 @@ MODULE_DEVICE_TABLE(of, iqs269_of_match); static struct i2c_driver iqs269_i2c_driver = { .driver = { .name = "iqs269a", + .dev_groups = iqs269_groups, .of_match_table = iqs269_of_match, .pm = pm_sleep_ptr(&iqs269_pm), }, From patchwork Sat Jul 29 00:51:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 708361 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E43ABC001DE for ; Sat, 29 Jul 2023 00:53:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236568AbjG2AxM (ORCPT ); Fri, 28 Jul 2023 20:53:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234079AbjG2AxI (ORCPT ); Fri, 28 Jul 2023 20:53:08 -0400 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46B2D3A94; Fri, 28 Jul 2023 17:52:42 -0700 (PDT) Received: by mail-pj1-x102e.google.com with SMTP id 98e67ed59e1d1-26837895fc8so1539956a91.0; Fri, 28 Jul 2023 17:52:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690591900; x=1691196700; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=kEmwUppJ9g7P3H3N3s8Z1q91hqRjAwdzuiQ4B09xoj0=; b=OD64285w4UKfHpbN+DM3V6gzSpnafC7xHmbrGbRQPDa8MxDiRBh6+2cYASGNFsHnth I74dqfNRHzMOGV+yTlFOeR60D2n9o5Sgd6Xdffo0ZwZtBeQg0Kh53RioKPEMEZTvJhsp j3LIfWjIYAexPKT1+lh0PtS9a9HkI9Hbb1QifiHCkJxH8+dbTWavetpNiKtSg5G0JaLt FQTnCBJn+ELEZzzcaCd56U/LXqK+Kc7s+Ar5ijc50s6hmLNhdpUrdYMojW87naXBJAAk 6vpM4ousdTsZ9vQV6/RIvRl/tvqFnfejzLfxkS+r1v42wPyzJ86QH6QoMe1SAsgjSvT9 2GMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690591900; x=1691196700; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kEmwUppJ9g7P3H3N3s8Z1q91hqRjAwdzuiQ4B09xoj0=; b=af+ouN8dPaFmE+ZD863oK7f+eAd3WYdMbkFENYDLnPwErR5hAMYCjO0kj9ceZ4JK6t DxvPHh+56Vupws2kAIpYPETmv3LPpLehq8zc3gIonmo0pGdYHs3faLEtoAY4OH0e6XVH M7vWCealPofeeSEnNqtJPv26e5bqzBAF8UStV41Dshq6GRBQLhXsPO83HXJqrhLzsvNo eR8PP6YuvgOb75+I3LxeBmHc2/L3F8XiICj+EbW6gTEjY/2fnaJZTX3g3cXl0p7Gea9D Gt5QQ2kHkU6TuN0XZ2g2grN3RuoCTpZUutIfxIaIi7ppYUd7LrmvcLwZ347uCapbQKlK SHcg== X-Gm-Message-State: ABy/qLZOSVHwJEsRJSaEl72TLTrfUJtlxnG3wReyp94t0fYDFZTyN8VG KAig7cuBJh/9XZ2mykyu4KR1i+VGmy8= X-Google-Smtp-Source: APBJJlHFklk1NKaULoJmdWSaTrt6MLg6u9yzF6aB0tIuvuSNUs7nfEchSDrsPMwiqoMm4TQGBZBzqw== X-Received: by 2002:a17:90a:8905:b0:268:6e77:2024 with SMTP id u5-20020a17090a890500b002686e772024mr2579485pjn.22.1690591899828; Fri, 28 Jul 2023 17:51:39 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:9d:2:bc93:3749:59cc:1d5c]) by smtp.gmail.com with ESMTPSA id h12-20020a170902704c00b001bb97e51ab4sm4149524plt.98.2023.07.28.17.51.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jul 2023 17:51:39 -0700 (PDT) From: Dmitry Torokhov To: linux-input@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman Subject: [PATCH 04/22] Input: kxtj9 - use device core to create driver-specific device attributes Date: Fri, 28 Jul 2023 17:51:13 -0700 Message-ID: <20230729005133.1095051-4-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog In-Reply-To: <20230729005133.1095051-1-dmitry.torokhov@gmail.com> References: <20230729005133.1095051-1-dmitry.torokhov@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org 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 --- drivers/input/misc/kxtj9.c | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/drivers/input/misc/kxtj9.c b/drivers/input/misc/kxtj9.c index 912e614d039d..d47269b10e9a 100644 --- a/drivers/input/misc/kxtj9.c +++ b/drivers/input/misc/kxtj9.c @@ -334,14 +334,25 @@ static ssize_t kxtj9_set_poll(struct device *dev, struct device_attribute *attr, static DEVICE_ATTR(poll, S_IRUGO|S_IWUSR, kxtj9_get_poll, kxtj9_set_poll); -static struct attribute *kxtj9_attributes[] = { +static struct attribute *kxtj9_attrs[] = { &dev_attr_poll.attr, NULL }; -static struct attribute_group kxtj9_attribute_group = { - .attrs = kxtj9_attributes +static umode_t kxtj9_attr_is_visible(struct kobject *kobj, + struct attribute *attr, int n) +{ + struct device *dev = kobj_to_dev(kobj); + struct i2c_client *client = to_i2c_client(dev); + + return client->irq ? attr->mode : 0; +} + +static struct attribute_group kxtj9_group = { + .attrs = kxtj9_attrs, + .is_visible = kxtj9_attr_is_visible, }; +__ATTRIBUTE_GROUPS(kxtj9); static void kxtj9_poll(struct input_dev *input) { @@ -482,13 +493,6 @@ static int kxtj9_probe(struct i2c_client *client) dev_err(&client->dev, "request irq failed: %d\n", err); return err; } - - err = devm_device_add_group(&client->dev, - &kxtj9_attribute_group); - if (err) { - dev_err(&client->dev, "sysfs create failed: %d\n", err); - return err; - } } return 0; @@ -535,8 +539,9 @@ MODULE_DEVICE_TABLE(i2c, kxtj9_id); static struct i2c_driver kxtj9_driver = { .driver = { - .name = NAME, - .pm = pm_sleep_ptr(&kxtj9_pm_ops), + .name = NAME, + .dev_groups = kxtj9_groups, + .pm = pm_sleep_ptr(&kxtj9_pm_ops), }, .probe = kxtj9_probe, .id_table = kxtj9_id, From patchwork Sat Jul 29 00:51:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 708169 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B3551EB64DD for ; Sat, 29 Jul 2023 00:53:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236770AbjG2AxN (ORCPT ); Fri, 28 Jul 2023 20:53:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230137AbjG2AxI (ORCPT ); Fri, 28 Jul 2023 20:53:08 -0400 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5B064C18; Fri, 28 Jul 2023 17:52:43 -0700 (PDT) Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-1bbc7b2133fso17280535ad.1; Fri, 28 Jul 2023 17:52:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690591900; x=1691196700; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=OwCo368h8I/PSrTBOGTf7U7WL91FxVTMHVax+dxpNss=; b=B7DC46bJ4n/GqAMHWKQ/8twIiwPzTAvJUbvGSyCaVo4NrxGNK8IWfrNJa4Pyb/jJ7a 5qeW47pROCDP+a1bEZpDLAKja68SUTVuxTsW+8KDPTq1d9cMyUtTBY6zIivtfdWaCXDe T1s2VgHJe8npEpp6kvUl7KZsD4bze2s9/h+xbJOpf6MB/PlnINv/y6zA67BeJpTg3OTK IiWPS0iT1pOPVxjcMZuRtkgd9qtlEC7Px718rWoxGwyeOpQ/U+eQl4pzj9+vjg0I0KQx o6jQX7ElIQsb5Lxt1mhohrMcixJ5+yYnBiJvJZwNtalqOWk1Tc8grS1prNxLRTLgwRTh rRXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690591900; x=1691196700; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OwCo368h8I/PSrTBOGTf7U7WL91FxVTMHVax+dxpNss=; b=CtJYoZkS1Fe22BjZhpWEr0yyfR5ZwRKRAR+RnbQRYJ01Y28uVnWYkIu/9z51Qf7yYa 7EfxaCJx0LNzGZbK4wZ/0usIwLFTl9isBtnJNXI7ic2/+p4LgQi4jP0BEor6n2ZASNZK 4g5gz4LqEHGz7rVQr/nDmLIIODTmnenYYUXbX/CrL02FcRaUMcspUK8PRTlqxTj0C1mB K6OO/hdKoNVOnFLahTCHEdJLqztiuZHt1B0hnV91vo479bCTd5uKJuTg0kWqHo03fOMq BXICQEpLov1YD9OKWYZudxT+Htm4eREZxAu82hL0uLrWrs+TAD77DS9zhXvleCze9L2Q ABbQ== X-Gm-Message-State: ABy/qLYMnmAQ6sWGwGElqyOCSpg1HDT5+65UFGlukDu8UoFet/9BXTYz RUWEf1dlW5Qk28lHnaFkwM0/9YIhdHk= X-Google-Smtp-Source: APBJJlHnW2ERZB+WxlawIQJUGZYfhZJd4TAfNggGkuKjz8oBrQ+v64kkkGIb/Bw+jkB1EilmtVKdDQ== X-Received: by 2002:a17:903:32ce:b0:1b6:79e3:636d with SMTP id i14-20020a17090332ce00b001b679e3636dmr3657985plr.58.1690591900609; Fri, 28 Jul 2023 17:51:40 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:9d:2:bc93:3749:59cc:1d5c]) by smtp.gmail.com with ESMTPSA id h12-20020a170902704c00b001bb97e51ab4sm4149524plt.98.2023.07.28.17.51.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jul 2023 17:51:40 -0700 (PDT) From: Dmitry Torokhov To: linux-input@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Michael Hennerich Subject: [PATCH 05/22] Input: ad7877 - use device core to create driver-specific device attributes Date: Fri, 28 Jul 2023 17:51:14 -0700 Message-ID: <20230729005133.1095051-5-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog In-Reply-To: <20230729005133.1095051-1-dmitry.torokhov@gmail.com> References: <20230729005133.1095051-1-dmitry.torokhov@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org 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 Acked-by: Michael Hennerich --- drivers/input/touchscreen/ad7877.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/input/touchscreen/ad7877.c b/drivers/input/touchscreen/ad7877.c index edb36d663f22..a0598e9c7aff 100644 --- a/drivers/input/touchscreen/ad7877.c +++ b/drivers/input/touchscreen/ad7877.c @@ -612,10 +612,11 @@ static umode_t ad7877_attr_is_visible(struct kobject *kobj, return mode; } -static const struct attribute_group ad7877_attr_group = { +static const struct attribute_group ad7877_group = { .is_visible = ad7877_attr_is_visible, .attrs = ad7877_attributes, }; +__ATTRIBUTE_GROUPS(ad7877); static void ad7877_setup_ts_def_msg(struct spi_device *spi, struct ad7877 *ts) { @@ -777,10 +778,6 @@ static int ad7877_probe(struct spi_device *spi) return err; } - err = devm_device_add_group(&spi->dev, &ad7877_attr_group); - if (err) - return err; - err = input_register_device(input_dev); if (err) return err; @@ -810,8 +807,9 @@ static DEFINE_SIMPLE_DEV_PM_OPS(ad7877_pm, ad7877_suspend, ad7877_resume); static struct spi_driver ad7877_driver = { .driver = { - .name = "ad7877", - .pm = pm_sleep_ptr(&ad7877_pm), + .name = "ad7877", + .dev_groups = ad7877_groups, + .pm = pm_sleep_ptr(&ad7877_pm), }, .probe = ad7877_probe, }; From patchwork Sat Jul 29 00:51:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 708362 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 00C92EB64DD for ; Sat, 29 Jul 2023 00:53:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229619AbjG2AxG (ORCPT ); Fri, 28 Jul 2023 20:53:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230137AbjG2AxF (ORCPT ); Fri, 28 Jul 2023 20:53:05 -0400 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 066D449FE; Fri, 28 Jul 2023 17:52:39 -0700 (PDT) Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-1bbc06f830aso17411795ad.0; Fri, 28 Jul 2023 17:52:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690591901; x=1691196701; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=6UTNSsrWWKR414OaN79464JHIccJK6ZuB40p7bHAcZ8=; b=hW51BN/P4IpHkVxw8Wi6tqtee6bd7dz3hngx4W5l++mdPiioUYXOqQUqQk1TLTBuaE DNw8QIShKcYJ6BQH9Gvi+RXAzAAv0jq+O+UUF3PP5Vyf6n3u1HX5D547I/dEbi0TKbfs D47ScINacoknwCdBf2z2EkY8zBMj5q6vIT11AWjDWT883RdwkybMgoFG6DzrZB4tUQWe wtFWasZMl0wlnzW5z+8tD6wdlo9g8MqYaUDl6gDVSIMgTt6c8U868TVSlA02nc3XfES/ Q2ZjXRo69KxnPdvNfnYfLhtfw4dfa9QfteH+9XnqTBOm7aK6UzkOWiHJk2CXpQQGhPIC m0RA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690591901; x=1691196701; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6UTNSsrWWKR414OaN79464JHIccJK6ZuB40p7bHAcZ8=; b=TAjHCdgx77EXd3LCZxibucwrBmXb0x0Kps5s8qe4dGCljio6uVMvFzIcxwMTXvLdnt +gCU29bds8lIFW09oJn8r/yv6QFW5wmk4Ds08y8dtqJLiFuWiXpnJypti1zTRLBuMIYh VnQbYFRlrl8Nl+/Nyt9+0j0sJPVAOZrL12qQDCOWYKSSNVJuTBdyIEqC6vZkQL3YhrjM 76nAt+7R6GhWEXZYgmyiHt3bT77A9SxDp2x78/uysjsg4e6Gk3LMSY4J0BwAaDGIpLOI CKtQpEILC+TMDYWShGOiPMZ8hWFIDG0iwxWOPFobGBwHTOltWEXd9yCz6xtIr020YalC uHAQ== X-Gm-Message-State: ABy/qLZVy6VH0uGQtHJaXGcqSLe3AiOtQDfM1U8d+7L60ko8tpMxH3gn iPTDhKcbkgs41Fr7coHMYw8gm97gNv4= X-Google-Smtp-Source: APBJJlGDfrW38jnbORBCtKu41B/I3PZ5cujziWau8w95X6AvhUUV1TCWHR8ilPc2QEiIeUyGDTeoZw== X-Received: by 2002:a17:903:2281:b0:1b8:c63:4b79 with SMTP id b1-20020a170903228100b001b80c634b79mr4572402plh.19.1690591901385; Fri, 28 Jul 2023 17:51:41 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:9d:2:bc93:3749:59cc:1d5c]) by smtp.gmail.com with ESMTPSA id h12-20020a170902704c00b001bb97e51ab4sm4149524plt.98.2023.07.28.17.51.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jul 2023 17:51:41 -0700 (PDT) From: Dmitry Torokhov To: linux-input@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Michael Hennerich Subject: [PATCH 06/22] Input: ad7879 - use device core to create driver-specific device attributes Date: Fri, 28 Jul 2023 17:51:15 -0700 Message-ID: <20230729005133.1095051-6-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog In-Reply-To: <20230729005133.1095051-1-dmitry.torokhov@gmail.com> References: <20230729005133.1095051-1-dmitry.torokhov@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org 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 Acked-by: Michael Hennerich --- drivers/input/touchscreen/ad7879-i2c.c | 7 ++++--- drivers/input/touchscreen/ad7879-spi.c | 7 ++++--- drivers/input/touchscreen/ad7879.c | 10 ++++++---- drivers/input/touchscreen/ad7879.h | 3 +++ 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/drivers/input/touchscreen/ad7879-i2c.c b/drivers/input/touchscreen/ad7879-i2c.c index feaa6f8b01ed..5c094ab74698 100644 --- a/drivers/input/touchscreen/ad7879-i2c.c +++ b/drivers/input/touchscreen/ad7879-i2c.c @@ -58,9 +58,10 @@ MODULE_DEVICE_TABLE(of, ad7879_i2c_dt_ids); static struct i2c_driver ad7879_i2c_driver = { .driver = { - .name = "ad7879", - .pm = &ad7879_pm_ops, - .of_match_table = of_match_ptr(ad7879_i2c_dt_ids), + .name = "ad7879", + .dev_groups = ad7879_groups, + .pm = &ad7879_pm_ops, + .of_match_table = of_match_ptr(ad7879_i2c_dt_ids), }, .probe = ad7879_i2c_probe, .id_table = ad7879_id, diff --git a/drivers/input/touchscreen/ad7879-spi.c b/drivers/input/touchscreen/ad7879-spi.c index 50e889846800..064968fe57cf 100644 --- a/drivers/input/touchscreen/ad7879-spi.c +++ b/drivers/input/touchscreen/ad7879-spi.c @@ -56,9 +56,10 @@ MODULE_DEVICE_TABLE(of, ad7879_spi_dt_ids); static struct spi_driver ad7879_spi_driver = { .driver = { - .name = "ad7879", - .pm = &ad7879_pm_ops, - .of_match_table = of_match_ptr(ad7879_spi_dt_ids), + .name = "ad7879", + .dev_groups = ad7879_groups, + .pm = &ad7879_pm_ops, + .of_match_table = of_match_ptr(ad7879_spi_dt_ids), }, .probe = ad7879_spi_probe, }; diff --git a/drivers/input/touchscreen/ad7879.c b/drivers/input/touchscreen/ad7879.c index e850853328f1..e5d69bf2276e 100644 --- a/drivers/input/touchscreen/ad7879.c +++ b/drivers/input/touchscreen/ad7879.c @@ -391,6 +391,12 @@ static const struct attribute_group ad7879_attr_group = { .attrs = ad7879_attributes, }; +const struct attribute_group *ad7879_groups[] = { + &ad7879_attr_group, + NULL +}; +EXPORT_SYMBOL_GPL(ad7879_groups); + #ifdef CONFIG_GPIOLIB static int ad7879_gpio_direction_input(struct gpio_chip *chip, unsigned gpio) @@ -612,10 +618,6 @@ int ad7879_probe(struct device *dev, struct regmap *regmap, __ad7879_disable(ts); - err = devm_device_add_group(dev, &ad7879_attr_group); - if (err) - return err; - err = ad7879_gpio_add(ts); if (err) return err; diff --git a/drivers/input/touchscreen/ad7879.h b/drivers/input/touchscreen/ad7879.h index ae8aa1428e56..d71a8e787290 100644 --- a/drivers/input/touchscreen/ad7879.h +++ b/drivers/input/touchscreen/ad7879.h @@ -8,11 +8,14 @@ #ifndef _AD7879_H_ #define _AD7879_H_ +#include #include +struct attribute_group; struct device; struct regmap; +extern const struct attribute_group *ad7879_groups[]; extern const struct dev_pm_ops ad7879_pm_ops; int ad7879_probe(struct device *dev, struct regmap *regmap, From patchwork Sat Jul 29 00:51:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 708355 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D29E6C001DF for ; Sat, 29 Jul 2023 00:53:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237180AbjG2Axu (ORCPT ); Fri, 28 Jul 2023 20:53:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236968AbjG2AxR (ORCPT ); Fri, 28 Jul 2023 20:53:17 -0400 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80727449C; Fri, 28 Jul 2023 17:52:54 -0700 (PDT) Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-1b8b2b60731so16004265ad.2; Fri, 28 Jul 2023 17:52:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690591902; x=1691196702; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BQaf9NpFPpFxvg172bFM+rU/3s6Fkcu6Hx5BLm6nRzI=; b=iCO1ciZy/FKKo8yEdQy1pphZ1KJGOB9qLgdH2bZKg2CGbrCXMHwDmTIhM55tt2LvSZ UOZwnSdP0kko3ZsPj/j/kisza6Blieyh+HZ+MADBbrP9WfVGiKSG0VsN8TQV4n4ToxKl stkMjeeMmjjDCn3mjnzMey4hK0e63+I7UcxKxkCFPt4xxtliLb3ugUpmy7sjTIgXMV/H W3wh7IqtUK8F78lxYww9jXMZr8WaipqJr00LWSVKevjwhGInvoxvHiSMYZX++MgF2Ojn 8DmJcZfGv8XuGSOLlZPE2OmuxwShG7JBLocUbKsmJXhuNa/Xg9tbgUluuVaDyd3pCmmu NDMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690591902; x=1691196702; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BQaf9NpFPpFxvg172bFM+rU/3s6Fkcu6Hx5BLm6nRzI=; b=bGFQwTYji5PFiCI8KSkRvgSyVhj5iPkQqpmAa6t09Uvqf3RKkL2IpsW/y0z7ALzney iUyg3tcmUx8ElxchJ9CGWxooSVabDEYBUeP1HPqdV+yhwQPual/SIEeLGDYcQ1UE+aRq gauYiUowEx+HZN3FifTaNyJmz98I+kiD+766dzLnQqf7GqP+BOTAu7NEJK97uT0vQgY+ F/kjb0NsM3eb42XyNy8DY2PVcO9n1SvA3fcrNtPismegS4xTKgjOxEkbFVkxsAqv1ANt FN5JWEWHbX2gTyXeYXPRM+u8T2o72JJz8xxRfUgD2F1Sk60S/XtkSkDBc6h/sp1yoFrA jO4w== X-Gm-Message-State: ABy/qLYUNEMCZnYaGl/fkaVTD+MTovp9wpnGChi+cMVLQFcHdsp0zU8b Bqr7BRlg+/LItoYebdRQ/MasnmHsVyE= X-Google-Smtp-Source: APBJJlE9i5igr5fbBkHSYefpwwHnG5PrQPyTV6KHoGdNa7tbXqyUdNUYn37aj2nz8/gWejwJByNDGg== X-Received: by 2002:a17:903:44e:b0:1bb:bc6d:457 with SMTP id iw14-20020a170903044e00b001bbbc6d0457mr2558551plb.36.1690591902140; Fri, 28 Jul 2023 17:51:42 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:9d:2:bc93:3749:59cc:1d5c]) by smtp.gmail.com with ESMTPSA id h12-20020a170902704c00b001bb97e51ab4sm4149524plt.98.2023.07.28.17.51.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jul 2023 17:51:41 -0700 (PDT) From: Dmitry Torokhov To: linux-input@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman Subject: [PATCH 07/22] Input: ads7846 - use device core to create driver-specific device attributes Date: Fri, 28 Jul 2023 17:51:16 -0700 Message-ID: <20230729005133.1095051-7-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog In-Reply-To: <20230729005133.1095051-1-dmitry.torokhov@gmail.com> References: <20230729005133.1095051-1-dmitry.torokhov@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org 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 --- drivers/input/touchscreen/ads7846.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c index bb1058b1e7fd..5601ceb7e26b 100644 --- a/drivers/input/touchscreen/ads7846.c +++ b/drivers/input/touchscreen/ads7846.c @@ -628,15 +628,12 @@ static ssize_t ads7846_disable_store(struct device *dev, static DEVICE_ATTR(disable, 0664, ads7846_disable_show, ads7846_disable_store); -static struct attribute *ads784x_attributes[] = { +static struct attribute *ads784x_attrs[] = { &dev_attr_pen_down.attr, &dev_attr_disable.attr, NULL, }; - -static const struct attribute_group ads784x_attr_group = { - .attrs = ads784x_attributes, -}; +ATTRIBUTE_GROUPS(ads784x); /*--------------------------------------------------------------------------*/ @@ -1395,10 +1392,6 @@ static int ads7846_probe(struct spi_device *spi) else (void) ads7846_read12_ser(dev, READ_12BIT_SER(vaux)); - err = devm_device_add_group(dev, &ads784x_attr_group); - if (err) - return err; - err = input_register_device(input_dev); if (err) return err; @@ -1424,9 +1417,10 @@ static void ads7846_remove(struct spi_device *spi) static struct spi_driver ads7846_driver = { .driver = { - .name = "ads7846", - .pm = pm_sleep_ptr(&ads7846_pm), - .of_match_table = of_match_ptr(ads7846_dt_ids), + .name = "ads7846", + .dev_groups = ads784x_groups, + .pm = pm_sleep_ptr(&ads7846_pm), + .of_match_table = of_match_ptr(ads7846_dt_ids), }, .probe = ads7846_probe, .remove = ads7846_remove, From patchwork Sat Jul 29 00:51:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 708163 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4EB0CEB64DD for ; Sat, 29 Jul 2023 00:53:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233729AbjG2Axx (ORCPT ); Fri, 28 Jul 2023 20:53:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236999AbjG2AxS (ORCPT ); Fri, 28 Jul 2023 20:53:18 -0400 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0AB7535A9; Fri, 28 Jul 2023 17:52:57 -0700 (PDT) Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-1b8b4748fe4so18131915ad.1; Fri, 28 Jul 2023 17:52:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690591903; x=1691196703; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9WiWlMo8N7BlJCcEKqNfovjCGj8L0gu267265Oyn+TE=; b=kbl1HaHS+2YZjTHveApVxjEtqiUIsRv1EdXLmi6Qy7JIRfNRnfIE0Ut7WiF4IicsdC kACFr8KmokzdUXQkQs6sXaLavSOCfOk8FJTolFFbpeAnv35i+qKvvg83Kp9y/1xN0YYO V8ZVqE3Qmk1BMcktogvv+Qcf4vJbcMDycIyhsjn1QPPlNyAkyCtI+Y8mjKMreHaRDXrD rOZ9Y72p32KOxPOmNzRh91Wm2Mk2EwIfF4u4US3TWE6QWAtglYGN2FpXE05UKzFVRPhr +N+BLeNhKyGN019tTJZzO4o6n4z0+ZYNUOCE9MO4q0xWXJKTq9mFGNwtntoXzW4fb2mi +hRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690591903; x=1691196703; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9WiWlMo8N7BlJCcEKqNfovjCGj8L0gu267265Oyn+TE=; b=O+w4cHHSyViLiWiCnW8FVXLrGsgFtGqfRw6MPnIepoldkbwAQTbibM5KNOfWgiHrun 3Xi/qT9tGjlrvbBHAY+oPt+EsXm46g4yxElKO2XY46cgmybHLljlHkRN9W8JibutfDh8 Q7gSpzyZ76JIe2zF9Bn6M68Mquq7ebrbFnxLzdL+8cTUQL/fQL2npxBylODbY5tDk0WA /e7wVeiQd19We9i9sErSHDRN2JCPvQAcHZptpKzWYlPHkIgMkxkmjuST6j75MMOUm7q9 qggcYT2YKlcUUFF1cL3pJf3C0TJOaYZq5D0Pnm2IS/T/kijB30uMAgHvqkQy0XpHiH8C yQNw== X-Gm-Message-State: ABy/qLYz9rboaRWI+xRi/Z1BLF+S9PbAj0kSGU5RZ9BieH/5l6HfrcY1 5n3tTqDePdpFZpLxKhCHaGzGjgru3TU= X-Google-Smtp-Source: APBJJlGt/TFeeE/ypV3gcZitnaGyMEIOuasIyG1MUGGYJvxpsio3AHO+DEXBARzRhif6+kIdc8bYEA== X-Received: by 2002:a17:902:7242:b0:1b8:7fd7:e022 with SMTP id c2-20020a170902724200b001b87fd7e022mr2552370pll.28.1690591902847; Fri, 28 Jul 2023 17:51:42 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:9d:2:bc93:3749:59cc:1d5c]) by smtp.gmail.com with ESMTPSA id h12-20020a170902704c00b001bb97e51ab4sm4149524plt.98.2023.07.28.17.51.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jul 2023 17:51:42 -0700 (PDT) From: Dmitry Torokhov To: linux-input@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman Subject: [PATCH 08/22] Input: edt-ft5x06 - use device core to create driver-specific device attributes Date: Fri, 28 Jul 2023 17:51:17 -0700 Message-ID: <20230729005133.1095051-8-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog In-Reply-To: <20230729005133.1095051-1-dmitry.torokhov@gmail.com> References: <20230729005133.1095051-1-dmitry.torokhov@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org 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 --- drivers/input/touchscreen/edt-ft5x06.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c index 457d53337fbb..3e102bcc4a1c 100644 --- a/drivers/input/touchscreen/edt-ft5x06.c +++ b/drivers/input/touchscreen/edt-ft5x06.c @@ -580,10 +580,7 @@ static struct attribute *edt_ft5x06_attrs[] = { &dev_attr_crc_errors.attr, NULL }; - -static const struct attribute_group edt_ft5x06_attr_group = { - .attrs = edt_ft5x06_attrs, -}; +ATTRIBUTE_GROUPS(edt_ft5x06); static void edt_ft5x06_restore_reg_parameters(struct edt_ft5x06_ts_data *tsdata) { @@ -1330,10 +1327,6 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client) return error; } - error = devm_device_add_group(&client->dev, &edt_ft5x06_attr_group); - if (error) - return error; - error = input_register_device(input); if (error) return error; @@ -1502,6 +1495,7 @@ MODULE_DEVICE_TABLE(of, edt_ft5x06_of_match); static struct i2c_driver edt_ft5x06_ts_driver = { .driver = { .name = "edt_ft5x06", + .dev_groups = edt_ft5x06_groups, .of_match_table = edt_ft5x06_of_match, .pm = pm_sleep_ptr(&edt_ft5x06_ts_pm_ops), .probe_type = PROBE_PREFER_ASYNCHRONOUS, From patchwork Sat Jul 29 00:51:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 708354 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 89C2FEB64DD for ; Sat, 29 Jul 2023 00:54:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237236AbjG2AyE (ORCPT ); Fri, 28 Jul 2023 20:54:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237029AbjG2AxT (ORCPT ); Fri, 28 Jul 2023 20:53:19 -0400 Received: from mail-pg1-x534.google.com (mail-pg1-x534.google.com [IPv6:2607:f8b0:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4234644A9; Fri, 28 Jul 2023 17:52:58 -0700 (PDT) Received: by mail-pg1-x534.google.com with SMTP id 41be03b00d2f7-54290603887so1631042a12.1; Fri, 28 Jul 2023 17:52:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690591904; x=1691196704; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=M2J00FDl/2dzmub7biLB0NwIVNSlyZGs+22SsVBL+Rk=; b=P8h3hg9vcBW16XQ6Fz/4Eo81SZcoa0Ttrh7v/SDyQsWVVrZ8bVZmWSkTgrrRpBtnJD /YibsVTiItQKPjTD1wvaar4K5mbPeg3shsZvvs39BhYtUmF7Fn8QYx/GSb99+G7LLEvH Ug3/tQop3PglTr2evoz32ppERGEcGHfCdzQ6QBtpgly1kl3fuc5wJywZnGLvBGJB96hx 6EMVjoLC8b3qbA9OtHC//MTlLsyuh5ScFlHGknY9LzZy2QkZr5yT86v0FqTQfKg0BKxk TFNPHidE5ZdLNci8vQpudSwshOVUMEWBCOBY5J6efMuCZ7D7JkG2BbhYPWgJDo6DDp3W 6wJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690591904; x=1691196704; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=M2J00FDl/2dzmub7biLB0NwIVNSlyZGs+22SsVBL+Rk=; b=gjg/lCr/bG7tswfh9UV8/ZLwo4xYz5dSHjvTFsWWqKhrnCIfy0Z712O1MoyZ1eT7yH B+FsJb8yQi+1wwaEdLETFQgCYim62FLw3vpyLZWwX+ssF2J3tyrY6zKqmFTpoze8OrAf KYwWTUmhxDpC5l/TZL7KtXA5cepnUJs4VkSGHaNXrVM6qHA1vGuyOVF5Q/O8O6lluMVC VB+afIMevGP7d8PksgVBMS2JLX0Ha/+xlOz7+9IyM1avleal3UgVaPbIz8MCvLDg1iO4 WQYUm5AqorkVHZx5uiV7orl3DML1hSV9OgQF7/thUZ8I4KxUqDldoY8GYfYuFNzSBDcP IlKQ== X-Gm-Message-State: ABy/qLZm/6x8GwErDnQ6PcuroCenARsxM16Ky1t+LUWzbSSeNiWoRC7A 4O5n/EW/p6CWHeYKO24eFDORWcIzihA= X-Google-Smtp-Source: APBJJlGhjy8MDDzPlgA3gWXisxwQrXLnP7CBYEY13mNxr04k9VTB7qNViQtnvKKp8Lo7LHdgh7lRmg== X-Received: by 2002:a17:90b:1403:b0:268:1e9:53bf with SMTP id jo3-20020a17090b140300b0026801e953bfmr2686931pjb.37.1690591903675; Fri, 28 Jul 2023 17:51:43 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:9d:2:bc93:3749:59cc:1d5c]) by smtp.gmail.com with ESMTPSA id h12-20020a170902704c00b001bb97e51ab4sm4149524plt.98.2023.07.28.17.51.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jul 2023 17:51:43 -0700 (PDT) From: Dmitry Torokhov To: linux-input@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Douglas Anderson , Raul E Rangel 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 Message-ID: <20230729005133.1095051-9-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog In-Reply-To: <20230729005133.1095051-1-dmitry.torokhov@gmail.com> References: <20230729005133.1095051-1-dmitry.torokhov@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org 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 --- 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), From patchwork Sat Jul 29 00:51:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 708357 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0848DC001DE for ; Sat, 29 Jul 2023 00:53:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236711AbjG2AxV (ORCPT ); Fri, 28 Jul 2023 20:53:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234281AbjG2AxN (ORCPT ); Fri, 28 Jul 2023 20:53:13 -0400 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC8853C34; Fri, 28 Jul 2023 17:52:49 -0700 (PDT) Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-1b9c368f4b5so24837005ad.0; Fri, 28 Jul 2023 17:52:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690591904; x=1691196704; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=W11bDslsZDrGr3Qeuq0bXM64dJbwpUwMR1R8xbGg1gA=; b=dE7GU2Tco7wDRgQMqoVcBsaSAYvDFi8voSDX0grkGsEhJFBiAKcddbWd080zPj7LGQ uFJHVrHiG7bpJkhPgdXChnkkhcdF32zGGQZjwH4boBlm07P0qKoe01gXih2i95CcOyWC PQ6R2K4ZbCfNigBCuqN6x8kNAcd9m5rlYzoosjJeMDzu9/PszIEExyw1p5kh1l6+Cdbw a5Ju6nXKqvyv/8qjo3osFuaauLsssKqXFPpLDpBe276wSx6rpWgJ0iAgX6wLTb2ePHM4 BFS2ARbioLhzoA1eVBOba4USgd3XmkDph03K+EgYenp26xitd8y2w9BzbKNeyWUdh10b W57Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690591904; x=1691196704; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=W11bDslsZDrGr3Qeuq0bXM64dJbwpUwMR1R8xbGg1gA=; b=aUZuCytLzDljLxodBX7hUT7lTOqzZLPgxuiFVrxGrkw8wG8xUdqVkv3isrTSTNXC/I WG5HAZABFSDvvjxsDKtEW9R4Ybx971qA4cU82echNWUnXO11CIQc/daxUuOHL22fj03Y P+V6qTxIbpmphXIsbTAQhaZZbs2PLxO5pmV6P7e8Ov4hlwVPCLtKBVYWNIGMZ3sxhdK1 wym5701l9TFHsUxC5TOohD8cis2jF+e9dRSFEmw6hIpwXqhxZfiKD0NXxPF2W/ZwSUEl NjWnmLXQSe3YuGLEGB7MRYKk6KlbSicwchfVN0KqQpNpOC6vz/Ljc6BpXVuSlKl/0cmf x4zg== X-Gm-Message-State: ABy/qLZd8AM/vJBLaA0K8n3c1MyHiBz7BA1ptm3rl45V2mY7CJqRh0Lw iQC0BJfAaAmkTGXqRVyOBkIYYlKkyQg= X-Google-Smtp-Source: APBJJlFVJ6yvCHCmXe5sBsywuZZ6X1oIYSnYpGMv9CPAGq+Hc8sTqLc+MWoqmJicmVZiVUXnmQ32GA== X-Received: by 2002:a17:903:186:b0:1bb:9efe:b1be with SMTP id z6-20020a170903018600b001bb9efeb1bemr4148861plg.30.1690591904392; Fri, 28 Jul 2023 17:51:44 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:9d:2:bc93:3749:59cc:1d5c]) by smtp.gmail.com with ESMTPSA id h12-20020a170902704c00b001bb97e51ab4sm4149524plt.98.2023.07.28.17.51.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jul 2023 17:51:44 -0700 (PDT) From: Dmitry Torokhov To: linux-input@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman Subject: [PATCH 10/22] Input: exc3000 - use device core to create driver-specific device attributes Date: Fri, 28 Jul 2023 17:51:19 -0700 Message-ID: <20230729005133.1095051-10-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog In-Reply-To: <20230729005133.1095051-1-dmitry.torokhov@gmail.com> References: <20230729005133.1095051-1-dmitry.torokhov@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org 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 --- drivers/input/touchscreen/exc3000.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/input/touchscreen/exc3000.c b/drivers/input/touchscreen/exc3000.c index 4c0d99aae9e0..a4030cc9ff60 100644 --- a/drivers/input/touchscreen/exc3000.c +++ b/drivers/input/touchscreen/exc3000.c @@ -325,16 +325,13 @@ static ssize_t type_show(struct device *dev, } static DEVICE_ATTR_RO(type); -static struct attribute *sysfs_attrs[] = { +static struct attribute *exc3000_attrs[] = { &dev_attr_fw_version.attr, &dev_attr_model.attr, &dev_attr_type.attr, NULL }; - -static struct attribute_group exc3000_attribute_group = { - .attrs = sysfs_attrs -}; +ATTRIBUTE_GROUPS(exc3000); static int exc3000_probe(struct i2c_client *client) { @@ -437,10 +434,6 @@ static int exc3000_probe(struct i2c_client *client) i2c_set_clientdata(client, data); - error = devm_device_add_group(&client->dev, &exc3000_attribute_group); - if (error) - return error; - return 0; } @@ -473,6 +466,7 @@ MODULE_DEVICE_TABLE(acpi, exc3000_acpi_match); static struct i2c_driver exc3000_driver = { .driver = { .name = "exc3000", + .dev_groups = exc3000_groups, .of_match_table = of_match_ptr(exc3000_of_match), .acpi_match_table = ACPI_PTR(exc3000_acpi_match), }, From patchwork Sat Jul 29 00:51:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 708164 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C1691C001DF for ; Sat, 29 Jul 2023 00:53:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236652AbjG2Axh (ORCPT ); Fri, 28 Jul 2023 20:53:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236889AbjG2AxP (ORCPT ); Fri, 28 Jul 2023 20:53:15 -0400 Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77DFC3AB4; Fri, 28 Jul 2023 17:52:52 -0700 (PDT) Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-1b8ad8383faso22173165ad.0; Fri, 28 Jul 2023 17:52:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690591905; x=1691196705; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xavxab7fE6BTORYI6YBoGvd5tEdjUx93KODPnqkxvR0=; b=i8rRuaznTbxKDT8qIjwW6J6o2OwYbtcbaMZ74rUyPVoo2qR7fy0/0GCB+dWxaIXqjH DB3YIfICmbglL0sDGqIBfhiNjmL12ZIit+vHF3Icxdb8kk1U45MhNkg5ohb/z43jwxTD OXFgJBOjQEQLsGE+VZ50tnWPnASCOQjMh+GmxW02SK9UtRSzxB+ACytTonlAxUrU7azt IDIYGsvSM548cfC7WW8OSvYx1Z3m+RAIQiPFOGkai3piCHvDC7Y4vCUvjVcyFbJm4ybn GgEeHrKDXTdEoKiaHBgmuZKeN45ZtsDDox7BJ+NgHDy+gYMBj/uXyKeBvGmft5iH4e+f C5dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690591905; x=1691196705; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xavxab7fE6BTORYI6YBoGvd5tEdjUx93KODPnqkxvR0=; b=RsqYngpNMsx7D7VAQi8ZDjDNaD/KB96IXNx/0efqgNAhO7ChDv+dWEIbhDxnk3doYB AXJAvqKSXIesGIsEi6aF9phThsjM5BgUGzTzyi8MpNKDkGatP/UkurxfZiPoDBdFQVOe VhhkNE+3yrYnVF2Y4W/g57cqTfhpOiD7c2fgiRXNHF8fdlgOSzVm6rMhNImgSm/XLRr3 mlsd0gJqqK232fsRyotpm5jhOOQLwvQCGfR842FqZxKVNQ//I/8Bmnm4j66KM8umqUxG JmgYeCmeNz/gCNBw2DOzCTPaokdZ8HCp5oao2QwNseO4C1xkFjR7Lyug075gUpy9crMz 3qpQ== X-Gm-Message-State: ABy/qLbD6zt/EusBJmCKPhf2OMlgtQemElAoBzokvGdo11Yn2Gqw5Nic 8OM2f5bu3PhWo6sWaqNWLtvKpMLHMFg= X-Google-Smtp-Source: APBJJlEID0Ip0DtR27FJA+cMBJgZJvVSNknZqau26FLSTVwBNoZ9PsJTDQJR2UqOKVq+Gj4UIvR0Dg== X-Received: by 2002:a17:902:c3c1:b0:1bb:d586:d2a5 with SMTP id j1-20020a170902c3c100b001bbd586d2a5mr3191815plj.45.1690591905124; Fri, 28 Jul 2023 17:51:45 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:9d:2:bc93:3749:59cc:1d5c]) by smtp.gmail.com with ESMTPSA id h12-20020a170902704c00b001bb97e51ab4sm4149524plt.98.2023.07.28.17.51.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jul 2023 17:51:44 -0700 (PDT) From: Dmitry Torokhov To: linux-input@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman Subject: [PATCH 11/22] Input: hideep - use device core to create driver-specific device attributes Date: Fri, 28 Jul 2023 17:51:20 -0700 Message-ID: <20230729005133.1095051-11-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog In-Reply-To: <20230729005133.1095051-1-dmitry.torokhov@gmail.com> References: <20230729005133.1095051-1-dmitry.torokhov@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org 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 --- drivers/input/touchscreen/hideep.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers/input/touchscreen/hideep.c b/drivers/input/touchscreen/hideep.c index 404153338df7..0f58258306bf 100644 --- a/drivers/input/touchscreen/hideep.c +++ b/drivers/input/touchscreen/hideep.c @@ -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), From patchwork Sat Jul 29 00:51:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 708353 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 46155EB64DD for ; Sat, 29 Jul 2023 00:54:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235595AbjG2AyH (ORCPT ); Fri, 28 Jul 2023 20:54:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237049AbjG2AxW (ORCPT ); Fri, 28 Jul 2023 20:53:22 -0400 Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86B2E468D; Fri, 28 Jul 2023 17:53:00 -0700 (PDT) Received: by mail-pg1-x535.google.com with SMTP id 41be03b00d2f7-54290603887so1631053a12.1; Fri, 28 Jul 2023 17:53:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690591906; x=1691196706; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=X6P0d7byHHNtJO1JXxwKJCS4iMd8OKYPtQDr5thS1SA=; b=CHcqyOcYveO+wTZy/3wyW9xMzNh1wutopV/+CeIcgPoo8ZU3uObWft/RVSV/X18qQ4 4xHtxJaYys3sRL9VrL71rioqxormQbeNn9uddKGET02a72AkCa6LF6ddoQFMUDgjHx6d 6+WlLnKJ6dUCFdBocs9Sxw8A4qNx9t2PEobJEYHiKBOZAbWExzgXrX+ytySjh8Leb/BX eB0p6QwI5Z9aRpnMg1hyCo9QA3B6SUM2TcueNp5FF/5c02+iuyCDiUN4zA6t09Z01M5v wulHvlDNX3eGoMJ5F/lu6C0efS13r9GM16oBj+zgGc9VNnT3ssFGLDDK9d/WL4tvr7J8 fDBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690591906; x=1691196706; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=X6P0d7byHHNtJO1JXxwKJCS4iMd8OKYPtQDr5thS1SA=; b=W+xQUQNQ6Z5AP4IiQe9rnsDcO3AhVm+j9N69ZGJHe7CZBUePe1TfDAyjMoVihk4SCU SZLwL6UGq0g58rPrGZyNLHf6+nfbrN+z6tRZlGf6Kxyod78IxclXa7VlMYjlsbOQpiyc 1n0lj6DjWG/eC/ofvCkhJc4Jnu4etaL3ImO3m5SDQH+78QMXfy9jDqwyKdoJpyc0WXz4 aY7RX8DB9LKuEclUowGeJOgCg0Yobbo8AjiiBmZBN2rV4J0+0DNydK8SgD1AQWVgS/1W oTukZDT9NuKZOpKhHkFTycB9H13odxVvRqDtZoaodPeTua+SA0WUrnGXUBFAzsP6108x 4vuQ== X-Gm-Message-State: ABy/qLbmsjlA+hECpgDIoZgs916pZY+ZEPSDH0dhGDDQpSRCMUnRfv4t 4neS9YXrXNZhJHDzVeWJt+EOzWfj0YE= X-Google-Smtp-Source: APBJJlGl8B4xwMAJ4UBbtNH3KWxW92k/PB1Vf16B4VwsIb8hqtSbE3Ffcw9joFIrk46A/R5Cz2Y5iA== X-Received: by 2002:a17:902:cec6:b0:1bb:c224:908b with SMTP id d6-20020a170902cec600b001bbc224908bmr3084758plg.61.1690591905903; Fri, 28 Jul 2023 17:51:45 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:9d:2:bc93:3749:59cc:1d5c]) by smtp.gmail.com with ESMTPSA id h12-20020a170902704c00b001bb97e51ab4sm4149524plt.98.2023.07.28.17.51.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jul 2023 17:51:45 -0700 (PDT) From: Dmitry Torokhov To: linux-input@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Giulio Benetti Subject: [PATCH 12/22] Input: hycon-hy46xx - use device core to create driver-specific device attributes Date: Fri, 28 Jul 2023 17:51:21 -0700 Message-ID: <20230729005133.1095051-12-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog In-Reply-To: <20230729005133.1095051-1-dmitry.torokhov@gmail.com> References: <20230729005133.1095051-1-dmitry.torokhov@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org 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 --- drivers/input/touchscreen/hycon-hy46xx.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/input/touchscreen/hycon-hy46xx.c b/drivers/input/touchscreen/hycon-hy46xx.c index 2450cfa14de9..d0f257989fd6 100644 --- a/drivers/input/touchscreen/hycon-hy46xx.c +++ b/drivers/input/touchscreen/hycon-hy46xx.c @@ -274,10 +274,7 @@ static struct attribute *hycon_hy46xx_attrs[] = { &hycon_hy46xx_attr_bootloader_version.dattr.attr, NULL }; - -static const struct attribute_group hycon_hy46xx_attr_group = { - .attrs = hycon_hy46xx_attrs, -}; +ATTRIBUTE_GROUPS(hycon_hy46xx); static void hycon_hy46xx_get_defaults(struct device *dev, struct hycon_hy46xx_data *tsdata) { @@ -535,10 +532,6 @@ static int hycon_hy46xx_probe(struct i2c_client *client) return error; } - error = devm_device_add_group(&client->dev, &hycon_hy46xx_attr_group); - if (error) - return error; - error = input_register_device(input); if (error) return error; @@ -576,6 +569,7 @@ MODULE_DEVICE_TABLE(of, hycon_hy46xx_of_match); static struct i2c_driver hycon_hy46xx_driver = { .driver = { .name = "hycon_hy46xx", + .dev_groups = hycon_hy46xx_groups, .of_match_table = hycon_hy46xx_of_match, .probe_type = PROBE_PREFER_ASYNCHRONOUS, }, From patchwork Sat Jul 29 00:51:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 708161 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DED40C001DF for ; Sat, 29 Jul 2023 00:54:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230484AbjG2AyJ (ORCPT ); Fri, 28 Jul 2023 20:54:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233739AbjG2Ax0 (ORCPT ); Fri, 28 Jul 2023 20:53:26 -0400 Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 464B049D8; Fri, 28 Jul 2023 17:53:03 -0700 (PDT) Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-1bb8e45185bso17379605ad.1; Fri, 28 Jul 2023 17:53:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690591907; x=1691196707; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qh239bx9Q1ammpCNJ5dKdqtd7HeLRoc7XKTXlpa6yXw=; b=psXW/SFetN1vx8Gdl0lLaxC3tlWzZe7SSBV4JnyDhjqn2A5jFZLilEypT6NlgC/epJ Kw9NIdWGYzfIrRxq5R32FmjNwWqMJOrW2IpDxj0IWfqVMsSvjy/Us8sTjS8VujCEvia+ XozD0pFOIg6j2qUah21ytpAd6qUAFMNiKX2x7i0EaYtu+mjxHWycRBNrWRC23ctN4tnm yMEk32ZadqU4OVPBoVyWOAzJ+KvtIVe/OcJC4OZC5sFG11vGMWJdZQ9cu4PwEo1RIFOH WXx0CNxVDGaqbSNYVHk1KyyGaxKkzZeQETxm9ZUQBTe3YfIi2HTV8fyybHHkTr0p0d8Y o26A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690591907; x=1691196707; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qh239bx9Q1ammpCNJ5dKdqtd7HeLRoc7XKTXlpa6yXw=; b=CWxx3DFipgQWzzi1O076ru5R/U1RPp2zS8ZqaNMo3TmpCzU3gNBhhtsE58RM8rQT0Q j8I7yKM20AHfjuGe8OwD0+F1qdNLUkBZBrTsbcoia19MVbBUAJ78JI5tmMNTJSoKQWOr DeDj8x/Vgct4Am1r6Yqrteu8PHrVyZJR5WdpLzJvZkwcYICfuhG7LC6v2/0czeS4e9xt 9yxhDY5xuZ9twwZur05RTaKCf7PtX9ieoLsSNyXS4Qslm6KYoVZRZeOs3OK36dRwlawS lH3TXGD9s93+vCa55fQkyP7EKR82T29tZgdy423/Mov54xtJ4BWx/4eS1Uuef/NToasO EF+A== X-Gm-Message-State: ABy/qLYb1LEctRzd8xgZfURjbc3247CrbUryWF9l7IPFYbqg48lquAC1 mDkD+Kj5/HcB3Mha5DnohBtaMnffzh4= X-Google-Smtp-Source: APBJJlG7LFWHXY0VwiN0sVb2S9Y2FQ1zum1GGXBOdgVi9FNpT+KaxmzUi57QOjo0mti3qnvtEwAJeQ== X-Received: by 2002:a17:902:f547:b0:1ba:fe63:6616 with SMTP id h7-20020a170902f54700b001bafe636616mr3311407plf.6.1690591906665; Fri, 28 Jul 2023 17:51:46 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:9d:2:bc93:3749:59cc:1d5c]) by smtp.gmail.com with ESMTPSA id h12-20020a170902704c00b001bb97e51ab4sm4149524plt.98.2023.07.28.17.51.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jul 2023 17:51:46 -0700 (PDT) From: Dmitry Torokhov To: linux-input@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Marek Vasut Subject: [PATCH 13/22] Input: ili210x - use device core to create driver-specific device attributes Date: Fri, 28 Jul 2023 17:51:22 -0700 Message-ID: <20230729005133.1095051-13-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog In-Reply-To: <20230729005133.1095051-1-dmitry.torokhov@gmail.com> References: <20230729005133.1095051-1-dmitry.torokhov@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org 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 --- drivers/input/touchscreen/ili210x.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/input/touchscreen/ili210x.c b/drivers/input/touchscreen/ili210x.c index ad6828e4f2e2..31ffdc2a93f3 100644 --- a/drivers/input/touchscreen/ili210x.c +++ b/drivers/input/touchscreen/ili210x.c @@ -876,7 +876,7 @@ static ssize_t ili210x_firmware_update_store(struct device *dev, static DEVICE_ATTR(firmware_update, 0200, NULL, ili210x_firmware_update_store); -static struct attribute *ili210x_attributes[] = { +static struct attribute *ili210x_attrs[] = { &dev_attr_calibrate.attr, &dev_attr_firmware_update.attr, &dev_attr_firmware_version.attr, @@ -904,10 +904,11 @@ static umode_t ili210x_attributes_visible(struct kobject *kobj, return attr->mode; } -static const struct attribute_group ili210x_attr_group = { - .attrs = ili210x_attributes, +static const struct attribute_group ili210x_group = { + .attrs = ili210x_attrs, .is_visible = ili210x_attributes_visible, }; +__ATTRIBUTE_GROUPS(ili210x); static void ili210x_power_down(void *data) { @@ -1013,13 +1014,6 @@ static int ili210x_i2c_probe(struct i2c_client *client) if (error) return error; - error = devm_device_add_group(dev, &ili210x_attr_group); - if (error) { - dev_err(dev, "Unable to create sysfs attributes, err: %d\n", - error); - return error; - } - error = input_register_device(priv->input); if (error) { dev_err(dev, "Cannot register input device, err: %d\n", error); @@ -1050,6 +1044,7 @@ MODULE_DEVICE_TABLE(of, ili210x_dt_ids); static struct i2c_driver ili210x_ts_driver = { .driver = { .name = "ili210x_i2c", + .dev_groups = ili210x_groups, .of_match_table = ili210x_dt_ids, }, .id_table = ili210x_i2c_id, From patchwork Sat Jul 29 00:51:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 708360 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 43873C001DF for ; Sat, 29 Jul 2023 00:53:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236815AbjG2AxO (ORCPT ); Fri, 28 Jul 2023 20:53:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233072AbjG2AxJ (ORCPT ); Fri, 28 Jul 2023 20:53:09 -0400 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1264F4C20; Fri, 28 Jul 2023 17:52:44 -0700 (PDT) Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1bb81809ca8so20759455ad.3; Fri, 28 Jul 2023 17:52:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690591907; x=1691196707; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=x8EWWPn2TqtaSPPFS1yD2I79GrwiYmktBuYVOfz6KWc=; b=ICPLEqL+DzywUKaGGVCjRpAnYdAzXsE74QEIlXe2QcneXLbs8koND9oxoKboucm99T 8rjrvzPsvk8lfVUPFiQ9VsCA66FXfP3vUp6TLTsjYsc+In6jSfyWshsgqIrBY5uCppNd JMHlrc425nS7Fg80a03gdVNtB4qf9l7RWlW2GlJWYkKZIASk4KtHgtdPZkrojbkmYLcN FrjsajbbLUJPm3aMUnqsQVazTG6eOvpBwtXZ6Zw6n49XGt1BsUxpBaqtd1D2W9vWdcsb 02Lu9wfOY7THF8YLZlXA2l+4C2IeYsTKkvYmDobpOY5ZwwkQUPgKQSHXlOYcrUkKN3bA zjuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690591907; x=1691196707; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=x8EWWPn2TqtaSPPFS1yD2I79GrwiYmktBuYVOfz6KWc=; b=H+lSzeI0npZBuLT/8r/NcOjBa6tpX72cUaK6GQdvSPScYxr572hFIX3PJWaXuVFn8D EpHInAUnkKKz/KxJB0Sm9pPaO3zFIez9MMzLeFeWZrNEK+btnrP/WTUt6o4nUYKMdTUh ghH3Wy+LiNqeIN0wZkHuXmLWtm5yEmx8JxjblYjOtnYcMOExQKDfS+fEHynK74ne6Q2P R0QXGDnHJf3e3IANKZLNPYGImJSsIkaK8FXeSMZ1eCFgST8Pq6WSgemEDxXIyMOMhbUF r2P6XZCn5OkmIB/IySBKlFtArLB+lTHCqKLxINfqjPzE4R95jbTJCbXMQv5B1awqsxq8 x27A== X-Gm-Message-State: ABy/qLZA7KS5YJlABX6n5d+FdbIA0kYpx01/pN93qUb71ZSphrWO+IVq vnaPnPuZIEsT451OfkVq9i9x42tXyPE= X-Google-Smtp-Source: APBJJlGXl6SVpo3gw5l6fHNGQq4x4hZy8+IccDOMOwPTwUtxyYtwsL8X2tzbrWV7EonRX4HinIbn5Q== X-Received: by 2002:a17:902:e542:b0:1b8:90bd:d157 with SMTP id n2-20020a170902e54200b001b890bdd157mr4331342plf.26.1690591907437; Fri, 28 Jul 2023 17:51:47 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:9d:2:bc93:3749:59cc:1d5c]) by smtp.gmail.com with ESMTPSA id h12-20020a170902704c00b001bb97e51ab4sm4149524plt.98.2023.07.28.17.51.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jul 2023 17:51:47 -0700 (PDT) From: Dmitry Torokhov To: linux-input@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Joe Hung Subject: [PATCH 14/22] Input: ilitek_ts_i2c - use device core to create driver-specific device attributes Date: Fri, 28 Jul 2023 17:51:23 -0700 Message-ID: <20230729005133.1095051-14-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog In-Reply-To: <20230729005133.1095051-1-dmitry.torokhov@gmail.com> References: <20230729005133.1095051-1-dmitry.torokhov@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org 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 --- drivers/input/touchscreen/ilitek_ts_i2c.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/input/touchscreen/ilitek_ts_i2c.c b/drivers/input/touchscreen/ilitek_ts_i2c.c index 2f872e95fbba..90c4934e750a 100644 --- a/drivers/input/touchscreen/ilitek_ts_i2c.c +++ b/drivers/input/touchscreen/ilitek_ts_i2c.c @@ -537,10 +537,7 @@ static struct attribute *ilitek_sysfs_attrs[] = { &dev_attr_product_id.attr, NULL }; - -static struct attribute_group ilitek_attrs_group = { - .attrs = ilitek_sysfs_attrs, -}; +ATTRIBUTE_GROUPS(ilitek_sysfs); static int ilitek_ts_i2c_probe(struct i2c_client *client) { @@ -595,12 +592,6 @@ static int ilitek_ts_i2c_probe(struct i2c_client *client) return error; } - error = devm_device_add_group(dev, &ilitek_attrs_group); - if (error) { - dev_err(dev, "sysfs create group failed: %d\n", error); - return error; - } - return 0; } @@ -675,6 +666,7 @@ MODULE_DEVICE_TABLE(of, ilitek_ts_i2c_match); static struct i2c_driver ilitek_ts_i2c_driver = { .driver = { .name = ILITEK_TS_NAME, + .dev_groups = ilitek_sysfs_groups, .pm = pm_sleep_ptr(&ilitek_pm_ops), .of_match_table = of_match_ptr(ilitek_ts_i2c_match), .acpi_match_table = ACPI_PTR(ilitekts_acpi_id), From patchwork Sat Jul 29 00:51:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 708359 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8505EC001DF for ; Sat, 29 Jul 2023 00:53:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236976AbjG2AxR (ORCPT ); Fri, 28 Jul 2023 20:53:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236348AbjG2AxM (ORCPT ); Fri, 28 Jul 2023 20:53:12 -0400 Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 528293C22; Fri, 28 Jul 2023 17:52:46 -0700 (PDT) Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-1b9c368f4b5so24837095ad.0; Fri, 28 Jul 2023 17:52:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690591908; x=1691196708; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=QcbA7VXwVFtFuTMrK9gecBZGBHC/yp4CxVuqNzuvBTk=; b=ImtOLwbAdOovXTFQhxq45BStb4JK2HiBIdGmZLMbdrZtuC9LewUnM4EN5cgwSSJ2Ez JY8HTNl74dtmMNy2rxiivOllpo15VNs2L6crbKtgOaEhP0vEIlzStI3v0ojDIGzm3s/4 0Vf88rxRi8rAyIZhpJiMOhJm/74g5pOWiUJmRbmf3ChPxhiEyZf/IQ8+bZMw682gYhM3 2mjKzjex4buLi1G/qjqAh9fLNJIFmqfdN10gVJlMiXBKVIIgxDKRlTX30iifvpK2RyZz QyWTwpp1FIIKzgldA53LCJFURvAROwaZq4JUCOl2aD1pP9M2yKWbjSJvUvo5gtT2aUtn X7Yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690591908; x=1691196708; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QcbA7VXwVFtFuTMrK9gecBZGBHC/yp4CxVuqNzuvBTk=; b=KCRXHBfWJEEqNN9p6hNFbG8TpR+QPphnVKs/UnhXJOd7jAwci/QoZYBwmNaJy71zjX n6qUEHL2lTaRKDUd7hqmu5c0SOBgc6hAkNnAXRZ4Atk/Ul6nbt3Q8lroENGaWeyCJmG1 aVgvEq15x4QYa79s7B9CkHDIVfRmTVsVaFtO2ShoMFr0PICD+5UbD6i+ixoMB2CeM59E 2waAjDKpD1qacVsM0ha8c+cHMHhGn5PI8Mxb2BaTPKPSmyjBgKDblbpIwoYRHC1Ocs1x QKY9JN1eYYCO2ihHt7AIh9xRW4HgML2ipUwn6njmw4d/zifpJKC+ON05nJbRK8qzU6Vm aCrw== X-Gm-Message-State: ABy/qLYjRgWEsSvJFoyHc3fdyfhIIhcBZ2r/SakiFtWNqKQ9Kbtnj13h uWZ08HGsj9V10TNgpJL4dzs9GOG7sZA= X-Google-Smtp-Source: APBJJlEQ16G1vApZYvVnFvAIe0m+RfsVYTzGlpcREKUYW17v/fapKsasKWQToJReDZCmYLLN4yHvsA== X-Received: by 2002:a17:903:11c9:b0:1b9:d38d:f08d with SMTP id q9-20020a17090311c900b001b9d38df08dmr4130752plh.18.1690591908217; Fri, 28 Jul 2023 17:51:48 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:9d:2:bc93:3749:59cc:1d5c]) by smtp.gmail.com with ESMTPSA id h12-20020a170902704c00b001bb97e51ab4sm4149524plt.98.2023.07.28.17.51.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jul 2023 17:51:47 -0700 (PDT) From: Dmitry Torokhov To: linux-input@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Jeff LaBundy Subject: [PATCH 15/22] Input: iqs5xx - use device core to create driver-specific device attributes Date: Fri, 28 Jul 2023 17:51:24 -0700 Message-ID: <20230729005133.1095051-15-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog In-Reply-To: <20230729005133.1095051-1-dmitry.torokhov@gmail.com> References: <20230729005133.1095051-1-dmitry.torokhov@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org 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 Reviewed-by: Jeff LaBundy --- drivers/input/touchscreen/iqs5xx.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/input/touchscreen/iqs5xx.c b/drivers/input/touchscreen/iqs5xx.c index b4768b66eb10..a3f4fb85bee5 100644 --- a/drivers/input/touchscreen/iqs5xx.c +++ b/drivers/input/touchscreen/iqs5xx.c @@ -974,10 +974,11 @@ static umode_t iqs5xx_attr_is_visible(struct kobject *kobj, return attr->mode; } -static const struct attribute_group iqs5xx_attr_group = { +static const struct attribute_group iqs5xx_group = { .is_visible = iqs5xx_attr_is_visible, .attrs = iqs5xx_attrs, }; +__ATTRIBUTE_GROUPS(iqs5xx); static int iqs5xx_suspend(struct device *dev) { @@ -1053,12 +1054,6 @@ static int iqs5xx_probe(struct i2c_client *client) return error; } - error = devm_device_add_group(&client->dev, &iqs5xx_attr_group); - if (error) { - dev_err(&client->dev, "Failed to add attributes: %d\n", error); - return error; - } - if (iqs5xx->input) { error = input_register_device(iqs5xx->input); if (error) @@ -1089,6 +1084,7 @@ MODULE_DEVICE_TABLE(of, iqs5xx_of_match); static struct i2c_driver iqs5xx_i2c_driver = { .driver = { .name = "iqs5xx", + .dev_groups = iqs5xx_groups, .of_match_table = iqs5xx_of_match, .pm = pm_sleep_ptr(&iqs5xx_pm), }, From patchwork Sat Jul 29 00:51:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 708168 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4C109C001DE for ; Sat, 29 Jul 2023 00:53:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235401AbjG2AxP (ORCPT ); Fri, 28 Jul 2023 20:53:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234803AbjG2AxK (ORCPT ); Fri, 28 Jul 2023 20:53:10 -0400 Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A39054C23; Fri, 28 Jul 2023 17:52:45 -0700 (PDT) Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-1bbc7b2133fso17280855ad.1; Fri, 28 Jul 2023 17:52:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690591909; x=1691196709; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=RhjavH3Fl28NglOqou/JvG3XUomwygW/aMjIJstyA5E=; b=BGAfF10nL++omXc7+bwaAOM2MreVw58HteryuBDOUweKsX/qyzYjdQF/GbSoxr8zPW 43RgiystT7Logz8KH4mkphXpv6EeYiNYEFixzVItFvtJz9TAZrmtq8GcyX3yGcm8u2u7 PUp6ga5ymIgqRSx1CsWVoJ+0BaJTcK+kKTErSCMugUrlgJ+y6ELdbuXB3V49V3wiAwte hWVkdMvLS1wgWYA4A5suuj/7GXHWfvWpF3h0JcXrtDUf7QaX4wtdgL405hIdLYrhc4dt +tnnS5p3Ods8pxjh/KZ+FYno6rbXv4UQfDSgG7nnWl9tZ05kiwQeEhogFxsZnDhVyJ5m M/lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690591909; x=1691196709; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RhjavH3Fl28NglOqou/JvG3XUomwygW/aMjIJstyA5E=; b=WhCKP99pg5UQ96EJO8vGO9igJHeqnzQ/LFA9lbdQFDhp+WJXar1qeAUA5JXbK2keB+ BFgNswrO4RRWYojk64If+kA7WuNk+mSoASiz/go7kwO1cib9ldj6I9Rj5LpmQ7hMvaTE zYIrsO+h3CrTLvWyhc6V5L9ZkNItD/rps+ImFf2JcFxxcq0WzP7Ac2uFGGiK0cfgb8QA pdDER1nBdrFw+kwYjhAyed/VPG99VaImzqY9nc2vuHN0KG/dBoYOHDutzyWYp7ZsITLU 0EzHBHDYmrj3SH2UUFneLYpWmQb8HclK+3baElQKBJyPALoM+KeWUIr9b4WJogfsQRea OYSQ== X-Gm-Message-State: ABy/qLZFNeaWhhX5qnL8/Rl9Hx9l5T5pSk6GIxkUShi0cyPCWhaKKO33 IItioBe0JQhKAUrAnzpeyUYcf+p82Oc= X-Google-Smtp-Source: APBJJlHphoodiAj3ieh8++jVlnP9OkfS7Tmu+sksb9lAaNMjbljF66BCE9c8/ej1UMZRSUPyCVxUMg== X-Received: by 2002:a17:902:da83:b0:1b8:9b1b:ae8e with SMTP id j3-20020a170902da8300b001b89b1bae8emr3627857plx.59.1690591909145; Fri, 28 Jul 2023 17:51:49 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:9d:2:bc93:3749:59cc:1d5c]) by smtp.gmail.com with ESMTPSA id h12-20020a170902704c00b001bb97e51ab4sm4149524plt.98.2023.07.28.17.51.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jul 2023 17:51:48 -0700 (PDT) From: Dmitry Torokhov To: linux-input@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman , JungHoon Hyun Subject: [PATCH 16/22] Input: melfas-mip4 - use device core to create driver-specific device attributes Date: Fri, 28 Jul 2023 17:51:25 -0700 Message-ID: <20230729005133.1095051-16-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog In-Reply-To: <20230729005133.1095051-1-dmitry.torokhov@gmail.com> References: <20230729005133.1095051-1-dmitry.torokhov@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org 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 --- drivers/input/touchscreen/melfas_mip4.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/input/touchscreen/melfas_mip4.c b/drivers/input/touchscreen/melfas_mip4.c index 2ac4483fbc25..aa325486f618 100644 --- a/drivers/input/touchscreen/melfas_mip4.c +++ b/drivers/input/touchscreen/melfas_mip4.c @@ -1419,10 +1419,7 @@ static struct attribute *mip4_attrs[] = { &dev_attr_update_fw.attr, NULL, }; - -static const struct attribute_group mip4_attr_group = { - .attrs = mip4_attrs, -}; +ATTRIBUTE_GROUPS(mip4); static int mip4_probe(struct i2c_client *client) { @@ -1514,13 +1511,6 @@ static int mip4_probe(struct i2c_client *client) return error; } - error = devm_device_add_group(&client->dev, &mip4_attr_group); - if (error) { - dev_err(&client->dev, - "Failed to create sysfs attribute group: %d\n", error); - return error; - } - return 0; } @@ -1589,6 +1579,7 @@ static struct i2c_driver mip4_driver = { .probe = mip4_probe, .driver = { .name = MIP4_DEVICE_NAME, + .dev_groups = mip4_groups, .of_match_table = of_match_ptr(mip4_of_match), .acpi_match_table = ACPI_PTR(mip4_acpi_match), .pm = pm_sleep_ptr(&mip4_pm_ops), From patchwork Sat Jul 29 00:51:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 708167 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1E3F0C001DE for ; Sat, 29 Jul 2023 00:53:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236632AbjG2AxS (ORCPT ); Fri, 28 Jul 2023 20:53:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236519AbjG2AxM (ORCPT ); Fri, 28 Jul 2023 20:53:12 -0400 Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F7583C07; Fri, 28 Jul 2023 17:52:47 -0700 (PDT) Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1bbf8cb694aso2558885ad.3; Fri, 28 Jul 2023 17:52:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690591910; x=1691196710; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=AEDoSnYN8pIcJUWaBkLfUGpLv63ZtjAclUqLuL9MJWg=; b=q97EfmlRSwu7PhjemxZaCZq9kEYkVcmhW57MnL9wCBgBhoK2c5WSIvW4Y0dZ2eKXDZ yQUcEqiVVo8USMqplSLn+QSUlnOFnI4BsLhIqNWEwJaqP2Fw6HWOmCjqkH0MGN0QVhUX 80bd2oBNQ+WtVOsI1Rtm3OkDbFkmwgqaEcDGECYH2T7j/qzzHZMj3TUR1uRZBnzCgz+U YrR3ThhkOl2PDgrdyhNYBhKB7HTEXwMX22HnpUAki7nEidPOOha/Wwm3tfmv1cL0ZDtM r3ruX0w3bdydCJiG0n14LpCdaS9OG182Xb6ARoUJV/9nNXZ1jpWgtg4Iy5VcKaz+lI4H NVOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690591910; x=1691196710; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AEDoSnYN8pIcJUWaBkLfUGpLv63ZtjAclUqLuL9MJWg=; b=hKk9G/U8IXdF9yeBjHKY+A4hPLzKwKigStqy0EdxubwREDFM733YN5fSiiP5BTzjMK vOpDvC0vEJcBVHL/PxxWyIYFrYI9/EYv0QUg+69bm/OJLaYufffLAqlMSvWIdCbronzm 9WJED5WySRWl2CGo0EkERVnbEtgSTVPfEFotheulTtf4SJNFKCEeel34s6/nQe6wtQvd 04xevSP3ABxjfBSN1IZwWgQTB1E30hegfQBzm8ryf3/KgGqGbnQomZYDKEm/puU2Ct56 sHrMeFrwR++CCh7FDaAD6ABQZKU49/JGHoCcOQYnHq0WH80qsn38+J6Wa5WVbIKWgw0G Ozqw== X-Gm-Message-State: ABy/qLZsyL6jJA3SfikyS7O+4rMPtNcT7pa/EqC6D2Iq8goLdvOv0Dza XJAkkRA7R58DvDu8R2iFRee5iUOAV+A= X-Google-Smtp-Source: APBJJlFOKiXh5lBJIX98M2bnZulRSlTRUTQGSYlx77hItApYDn0syyDYQ7kCchQhfRa5xPUOfWaExA== X-Received: by 2002:a17:902:7b85:b0:1b8:33d4:77f8 with SMTP id w5-20020a1709027b8500b001b833d477f8mr3385406pll.23.1690591909917; Fri, 28 Jul 2023 17:51:49 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:9d:2:bc93:3749:59cc:1d5c]) by smtp.gmail.com with ESMTPSA id h12-20020a170902704c00b001bb97e51ab4sm4149524plt.98.2023.07.28.17.51.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jul 2023 17:51:49 -0700 (PDT) From: Dmitry Torokhov To: linux-input@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Raul E Rangel Subject: [PATCH 17/22] Input: raydium_i2c_ts - use device core to create driver-specific device attributes Date: Fri, 28 Jul 2023 17:51:26 -0700 Message-ID: <20230729005133.1095051-17-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog In-Reply-To: <20230729005133.1095051-1-dmitry.torokhov@gmail.com> References: <20230729005133.1095051-1-dmitry.torokhov@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org 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 --- drivers/input/touchscreen/raydium_i2c_ts.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/drivers/input/touchscreen/raydium_i2c_ts.c b/drivers/input/touchscreen/raydium_i2c_ts.c index 78dd3059d585..13c500e776f6 100644 --- a/drivers/input/touchscreen/raydium_i2c_ts.c +++ b/drivers/input/touchscreen/raydium_i2c_ts.c @@ -1004,7 +1004,7 @@ static DEVICE_ATTR(boot_mode, S_IRUGO, raydium_i2c_boot_mode_show, NULL); static DEVICE_ATTR(update_fw, S_IWUSR, NULL, raydium_i2c_update_fw_store); static DEVICE_ATTR(calibrate, S_IWUSR, NULL, raydium_i2c_calibrate_store); -static struct attribute *raydium_i2c_attributes[] = { +static struct attribute *raydium_i2c_attrs[] = { &dev_attr_update_fw.attr, &dev_attr_boot_mode.attr, &dev_attr_fw_version.attr, @@ -1012,10 +1012,7 @@ static struct attribute *raydium_i2c_attributes[] = { &dev_attr_calibrate.attr, NULL }; - -static const struct attribute_group raydium_i2c_attribute_group = { - .attrs = raydium_i2c_attributes, -}; +ATTRIBUTE_GROUPS(raydium_i2c); static int raydium_i2c_power_on(struct raydium_data *ts) { @@ -1174,14 +1171,6 @@ static int raydium_i2c_probe(struct i2c_client *client) return error; } - error = devm_device_add_group(&client->dev, - &raydium_i2c_attribute_group); - if (error) { - dev_err(&client->dev, "failed to create sysfs attributes: %d\n", - error); - return error; - } - return 0; } @@ -1265,6 +1254,7 @@ static struct i2c_driver raydium_i2c_driver = { .id_table = raydium_i2c_id, .driver = { .name = "raydium_ts", + .dev_groups = raydium_i2c_groups, .pm = pm_sleep_ptr(&raydium_i2c_pm_ops), .acpi_match_table = ACPI_PTR(raydium_acpi_id), .of_match_table = of_match_ptr(raydium_of_match), From patchwork Sat Jul 29 00:51:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 708358 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B78BBEB64DD for ; Sat, 29 Jul 2023 00:53:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236672AbjG2AxT (ORCPT ); Fri, 28 Jul 2023 20:53:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236652AbjG2AxN (ORCPT ); Fri, 28 Jul 2023 20:53:13 -0400 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75DF03C33; Fri, 28 Jul 2023 17:52:48 -0700 (PDT) Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-1bbf3da0ea9so5449945ad.2; Fri, 28 Jul 2023 17:52:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690591911; x=1691196711; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=kRJxLZ3EGDE+HcejVJHN5WgMKPYKV/494+/KjMoBMUQ=; b=R00RD94BaZMbiQEo/jBpDeNL2kfq3Al+ce4OmH1DU/fe7C8nGurSFGTxt+QVRAAGs5 hPiuZut5zGHyNCrANXXNzQ2jG3/hNVYnuXaD7YjcKoONekEI0kWGRV9qtOoJcNOeJZyk S2uTeabqRJuwnSJZus7d5mnu04kJWSG3/dxYlG3hQnl4eoaHnhXEbgN0YxwucYpkXkSn E69zUIa6cPaDr0kXXnhH+I/7k39L9dhYRdPIjhF6nrlxgySh/M17f8VXGftVkB2YDFx9 eS0pCQVWA258/7LjZ6WqHVvFhizlaiMyloqxE8MWQps2lWsEU+I2GOdQvJWAvUyimvVU vO4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690591911; x=1691196711; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kRJxLZ3EGDE+HcejVJHN5WgMKPYKV/494+/KjMoBMUQ=; b=dQNGZXO8cvog/wigypSWhvJdhFfaLsuq6J3l9pcgmMrEuL2fdCT7bM6NOuCzTIJhc6 rCbAfz8pdztjUQYGkdlCKSRaAem2YiBHlXbmfa311SF1hnzhMfZ2lDIm0G9FnsmyeNyb 1MotCm4eERfb6f+PoykclwT/N+8O2dy5bZiIyHXhEr55uYc6bqO3EZSD0khJ3TZiJg5L ARl1ZIbfR4oKT9ECB9tE4qA+VUulG2xsX1owVLEtkU1GFDbennHpjmKEngEp4v4CX5NL Z3Wpps+zEupsmo2UtqBh5lU58CvUX5xrx7n1kK6By2qVcGtKJrvtHviPsfoQ2ysoZb2n d6BQ== X-Gm-Message-State: ABy/qLZEVmd253U2OjkFyOnAV1Kzvrw0p1kVff+T3A3g8hd0h1upTgff dkrAKJzlEBZIHmJfsE+5ptYcPR2m8zM= X-Google-Smtp-Source: APBJJlHAGWzpakcxwoD37LuGCcOTh86tsClJzvBraXWGt4S8tziEbN+cNgBGot9UuAXDwW7J+gRQYw== X-Received: by 2002:a17:902:d489:b0:1b8:8069:d432 with SMTP id c9-20020a170902d48900b001b88069d432mr2915832plg.16.1690591910675; Fri, 28 Jul 2023 17:51:50 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:9d:2:bc93:3749:59cc:1d5c]) by smtp.gmail.com with ESMTPSA id h12-20020a170902704c00b001bb97e51ab4sm4149524plt.98.2023.07.28.17.51.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jul 2023 17:51:50 -0700 (PDT) From: Dmitry Torokhov To: linux-input@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman Subject: [PATCH 18/22] Input: rohm_bu21023 - use device core to create driver-specific device attributes Date: Fri, 28 Jul 2023 17:51:27 -0700 Message-ID: <20230729005133.1095051-18-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog In-Reply-To: <20230729005133.1095051-1-dmitry.torokhov@gmail.com> References: <20230729005133.1095051-1-dmitry.torokhov@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org 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 --- drivers/input/touchscreen/rohm_bu21023.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/input/touchscreen/rohm_bu21023.c b/drivers/input/touchscreen/rohm_bu21023.c index 240424f06b98..4493ad0c9322 100644 --- a/drivers/input/touchscreen/rohm_bu21023.c +++ b/drivers/input/touchscreen/rohm_bu21023.c @@ -854,10 +854,7 @@ static struct attribute *rohm_ts_attrs[] = { &dev_attr_inv_y.attr, NULL, }; - -static const struct attribute_group rohm_ts_attr_group = { - .attrs = rohm_ts_attrs, -}; +ATTRIBUTE_GROUPS(rohm_ts); static int rohm_ts_device_init(struct i2c_client *client, u8 setup2) { @@ -1164,12 +1161,6 @@ static int rohm_bu21023_i2c_probe(struct i2c_client *client) return error; } - error = devm_device_add_group(dev, &rohm_ts_attr_group); - if (error) { - dev_err(dev, "failed to create sysfs group: %d\n", error); - return error; - } - return error; } @@ -1182,6 +1173,7 @@ MODULE_DEVICE_TABLE(i2c, rohm_bu21023_i2c_id); static struct i2c_driver rohm_bu21023_i2c_driver = { .driver = { .name = BU21023_NAME, + .dev_groups = rohm_ts_groups, }, .probe = rohm_bu21023_i2c_probe, .id_table = rohm_bu21023_i2c_id, From patchwork Sat Jul 29 00:51:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 708166 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C6047C00528 for ; Sat, 29 Jul 2023 00:53:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233935AbjG2AxU (ORCPT ); Fri, 28 Jul 2023 20:53:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236759AbjG2AxN (ORCPT ); Fri, 28 Jul 2023 20:53:13 -0400 Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30D663C3B; Fri, 28 Jul 2023 17:52:49 -0700 (PDT) Received: by mail-pg1-x536.google.com with SMTP id 41be03b00d2f7-563f4e49ff9so1539952a12.3; Fri, 28 Jul 2023 17:52:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690591911; x=1691196711; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=OHWHJPusj/tr4ofRWYliJ6SaLkd1ssdiXE1hqXu1re0=; b=F4vxxi4kwHOZdYfgmMA0F5BVaCEIykgpQd8vSCVz1MXNb986hs8DzylodiUYCBo5B4 mOzkMukYC/v514T23WE180NX4vc2NbsTKdrqJZZX5yrhNtTE0A4kfdPJGqE4Ldhu7fpP cttRiBiI+lV7B5cfSnyco0QxeBREcBK195xUiOOkU61bnWAXJRknK2I+S8BWNySyVUed x1zgm4LciCOugW4/e9jVVBdlwSa7U0ZU23VzrqPKnCkhueT7N1lIVCoW1JW4DgE/ZQLw Eg/U420+VARIyBaE9ATDSEc91KpL323VwkKxDMl00sqFdSxYHwvZaNJXXjrERRFvH+PS 31TQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690591911; x=1691196711; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OHWHJPusj/tr4ofRWYliJ6SaLkd1ssdiXE1hqXu1re0=; b=YVNVF69+TZIf6nbVisiHDOyi+CiTLF0GbxhnlqYCtALFreXbLP0zaLD67qnokHHYVo 5N3xzfj6Eb89pawLE/OGlrgF1X7yG4aBN+KNZfL4FeZoWP/zFPNwXygLhnSF7WAcrZ/g W+peo+IlGltt99WCGEmMZZOOIEvMJyWKKL363dcZEpPXHln5/lMVW/pXbGjM7jgmxNoS tM+re1GY+syNtoZnCa+NdWC3FgPE0UkNLYt3flLAuaHa6TLF59z20rhrn2BfUBvXxCNM qeCXkotwjFPIRDqFM9gBvYYbLQk+drKXI9j3LGs7yAI7UCeTWV9q9Dl6WCqT8I1AVmCW slAQ== X-Gm-Message-State: ABy/qLZTaPLJpgqctMp7OOe38nAhEL8xpbAZP1QRf30IGvHnRFzP5sdy BSx4yTEihIAiY+p6hMwOVMHXVzwL62k= X-Google-Smtp-Source: APBJJlF7RGwf+zbqv4Ag1IqqCQ+Hz6WZoc0vXCQB92RiINcNvZ7bf5Bq2oS15kO5BAhU/vC6QLbxkg== X-Received: by 2002:a17:902:bc87:b0:1b3:f5c3:7682 with SMTP id bb7-20020a170902bc8700b001b3f5c37682mr2716594plb.68.1690591911435; Fri, 28 Jul 2023 17:51:51 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:9d:2:bc93:3749:59cc:1d5c]) by smtp.gmail.com with ESMTPSA id h12-20020a170902704c00b001bb97e51ab4sm4149524plt.98.2023.07.28.17.51.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jul 2023 17:51:51 -0700 (PDT) From: Dmitry Torokhov To: linux-input@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Andi Shyti Subject: [PATCH 19/22] Input: s6sy761 - use device core to create driver-specific device attributes Date: Fri, 28 Jul 2023 17:51:28 -0700 Message-ID: <20230729005133.1095051-19-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog In-Reply-To: <20230729005133.1095051-1-dmitry.torokhov@gmail.com> References: <20230729005133.1095051-1-dmitry.torokhov@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org 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 Reviewed-by: Andi Shyti --- drivers/input/touchscreen/s6sy761.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/input/touchscreen/s6sy761.c b/drivers/input/touchscreen/s6sy761.c index 998d99d18911..149cc2c4925e 100644 --- a/drivers/input/touchscreen/s6sy761.c +++ b/drivers/input/touchscreen/s6sy761.c @@ -286,10 +286,7 @@ static struct attribute *s6sy761_sysfs_attrs[] = { &dev_attr_devid.attr, NULL }; - -static struct attribute_group s6sy761_attribute_group = { - .attrs = s6sy761_sysfs_attrs -}; +ATTRIBUTE_GROUPS(s6sy761_sysfs); static int s6sy761_power_on(struct s6sy761_data *sdata) { @@ -465,10 +462,6 @@ static int s6sy761_probe(struct i2c_client *client) if (err) return err; - err = devm_device_add_group(&client->dev, &s6sy761_attribute_group); - if (err) - return err; - pm_runtime_enable(&client->dev); return 0; @@ -535,6 +528,7 @@ MODULE_DEVICE_TABLE(i2c, s6sy761_id); static struct i2c_driver s6sy761_driver = { .driver = { .name = S6SY761_DEV_NAME, + .dev_groups = s6sy761_sysfs_groups, .of_match_table = of_match_ptr(s6sy761_of_match), .pm = pm_ptr(&s6sy761_pm_ops), }, From patchwork Sat Jul 29 00:51:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 708165 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CB89DEB64DD for ; Sat, 29 Jul 2023 00:53:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236844AbjG2Axf (ORCPT ); Fri, 28 Jul 2023 20:53:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233385AbjG2AxP (ORCPT ); Fri, 28 Jul 2023 20:53:15 -0400 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15F89421D; Fri, 28 Jul 2023 17:52:52 -0700 (PDT) Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1b9c5e07c1bso22012705ad.2; Fri, 28 Jul 2023 17:52:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690591912; x=1691196712; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=YOdo3WS1rinIQ73LQo2Hq0iDUs9lcLtFTTbcX/WR8IM=; b=fTWaWXEjBF6L7h4TWCGYSuwqt8Aq8CszC6zBArWUbQ72N6vWhebdZoVkX0Z1q72Ys3 BHaAZdDICKDRA6fEcEeLUFGJUiI3fBR95QUaHXh0iGBlQu/B4oMCIMeRDPtM/ZdZeQ2b acTIXWPMKJMdZoE+TbwCwVRFBbWOY5NI3DXMLemZ9hKg+gJL4GixyPPSpJd3SwjraXUx Ygk06FdnvQMfmfzQyRz2lfSXxRTEKOheobQNFQBUo1tR6UNs1UvY7S3UiuYNfSL9+RoI hMG0yw0PFLZJWkLRfqh2W1z02ojFXUThwnrNiGWt1Ahilfsmm3R8cTt0eOXbU40Qri0N Crmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690591912; x=1691196712; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YOdo3WS1rinIQ73LQo2Hq0iDUs9lcLtFTTbcX/WR8IM=; b=RvhGrE7FHLnUueAigR/hpG/e2bN90cXk3KOveWDwl50f7WAeYqf0E6JqJL44IOSZQQ YUrNMtVzf2qKnkWOkY6qnymrv/w1bSDnX4awMQOW+d0sTl+vpuYz+mjjsTHA2byVnFYE 65z+WMcoDIqpKOjAptm3Biz3TwPLCwL6KUV0HNlfYA5ZLevdddaL9eM9tV4UPhzAgAqQ jssrYEJPin2HeAJ5ATjkwcElCl+fqbba2/XoWR/EJ4LikB3UHGd0NmURhLnftq7IoFVp GCIuufnK27WIaYl8RJZJQWJLhNrxh/SjVtAxLRnUY3b3PMywXZUC22wBi1PDiOGbN5j5 9kkw== X-Gm-Message-State: ABy/qLbT/6EHRMLD0dczuzvMnFzjocCqDkU0xUdTzXtodCfBRG9k+FZZ CPcitvb9ZLHR2lxHem/LmBqwHQSR9yY= X-Google-Smtp-Source: APBJJlGTjnNzq1tqygHb0Oce5NEBSya7FDgbbVya48yIukMVYn5UlNcYt12RfDcWrK47vUfR27I1iQ== X-Received: by 2002:a17:902:f685:b0:1bb:9f0e:7b46 with SMTP id l5-20020a170902f68500b001bb9f0e7b46mr3684949plg.1.1690591912302; Fri, 28 Jul 2023 17:51:52 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:9d:2:bc93:3749:59cc:1d5c]) by smtp.gmail.com with ESMTPSA id h12-20020a170902704c00b001bb97e51ab4sm4149524plt.98.2023.07.28.17.51.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jul 2023 17:51:52 -0700 (PDT) From: Dmitry Torokhov To: linux-input@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Maxime Coquelin , Alexandre Torgue Subject: [PATCH 20/22] Input: stmfts - use device core to create driver-specific device attributes Date: Fri, 28 Jul 2023 17:51:29 -0700 Message-ID: <20230729005133.1095051-20-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog In-Reply-To: <20230729005133.1095051-1-dmitry.torokhov@gmail.com> References: <20230729005133.1095051-1-dmitry.torokhov@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org 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 Reviewed-by: Andi Shyti --- drivers/input/touchscreen/stmfts.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/input/touchscreen/stmfts.c b/drivers/input/touchscreen/stmfts.c index 56e371fd88fa..85010fa07908 100644 --- a/drivers/input/touchscreen/stmfts.c +++ b/drivers/input/touchscreen/stmfts.c @@ -517,10 +517,7 @@ static struct attribute *stmfts_sysfs_attrs[] = { &dev_attr_hover_enable.attr, NULL }; - -static struct attribute_group stmfts_attribute_group = { - .attrs = stmfts_sysfs_attrs -}; +ATTRIBUTE_GROUPS(stmfts_sysfs); static int stmfts_power_on(struct stmfts_data *sdata) { @@ -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); device_enable_async_suspend(&client->dev); @@ -804,6 +797,7 @@ MODULE_DEVICE_TABLE(i2c, stmfts_id); static struct i2c_driver stmfts_driver = { .driver = { .name = STMFTS_DEV_NAME, + .dev_groups = stmfts_sysfs_groups, .of_match_table = of_match_ptr(stmfts_of_match), .pm = pm_ptr(&stmfts_pm_ops), .probe_type = PROBE_PREFER_ASYNCHRONOUS, From patchwork Sat Jul 29 00:51:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 708162 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 321E4C001DE for ; Sat, 29 Jul 2023 00:54:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237242AbjG2AyF (ORCPT ); Fri, 28 Jul 2023 20:54:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231737AbjG2AxU (ORCPT ); Fri, 28 Jul 2023 20:53:20 -0400 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2CBB311D; Fri, 28 Jul 2023 17:52:59 -0700 (PDT) Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-1bba54f7eefso24730965ad.1; Fri, 28 Jul 2023 17:52:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690591913; x=1691196713; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=tMDQFiWpPsdIpStYi6pM086GS/3ZK2YeWXsTW0i4Ccc=; b=skE3gTkbTy6Rhk5HatUvLDGlVD22333njgEEBIhZ3Yqk8ZkZMQ8hoVSCjO9nz0szL5 DwQG8EaFzT393REVtIftHAOC5iViK9Vx6dZTUFZ/W0jHxNmyqRbGaCE4wHmWX9OnEiqC PE9vZZNXw3Mplj4pmf/pO4rPNqkrxiUhRHf900rsMe7KH9DAXjA6K/tNAXCOyL2SLdha M7pvKB49pB2tzRYTQFSz9cy1iOumFbZHePTZzsR6CwqSGuBOObzFBl8HUUEDqjBU/HVy OnyUPwhZDMtxC9rKZ7Wv7tEtxTefJklgaWSSUIPSdowgJbCfKdSzlewhIyYO667zBgal jBHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690591913; x=1691196713; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tMDQFiWpPsdIpStYi6pM086GS/3ZK2YeWXsTW0i4Ccc=; b=E1x4Z1p9D8f0oJpDvIqABmpgFsp9s0MZL9nFWR8LuC4OuV6bvp2cFHzlBhwS+OySAn 0CVit3/u2uu+DzYtShYSHsiPzU1yo6WQshO62uqGLjOtMtjiT6nGECtWSibg5YTenLNn pjbEXgp+RKh1DEG033N3NUEDZhdLHGHyC5BsUmRYOkA5E5bhenGEZ5+ecNZAMNc9eH1D zJGn/WN7HgORPXrF/JdqnDsFN6RUGlCA1uOWvmI+KaqutzptTYr7vcczweSkt1wrhePs s8E/qkk8K56n7YTc4J1fKwoMkbZCLryJ1na5uKVt5He5AK5sNq1JC1bBcf17Nsdl+Viy wGpA== X-Gm-Message-State: ABy/qLY/e5MfTXSFqBEi7FqqDiIoUjYsgG9hUxZ09CuNSaLBO9ukKSa2 Kxj4ImSZ9vyIoCFDVeMI9YPrP/iFHR0= X-Google-Smtp-Source: APBJJlGFhyQuP/lIsVizD0LLzafNgpedIt+1DaV9vp53ufP0wQrFrXJNTL2fDW5tifD3eA332EHMdQ== X-Received: by 2002:a17:903:186:b0:1bb:9efe:b1be with SMTP id z6-20020a170903018600b001bb9efeb1bemr4149165plg.30.1690591913025; Fri, 28 Jul 2023 17:51:53 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:9d:2:bc93:3749:59cc:1d5c]) by smtp.gmail.com with ESMTPSA id h12-20020a170902704c00b001bb97e51ab4sm4149524plt.98.2023.07.28.17.51.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jul 2023 17:51:52 -0700 (PDT) From: Dmitry Torokhov To: linux-input@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman Subject: [PATCH 21/22] Input: tsc2004/5 - use device core to create driver-specific device attributes Date: Fri, 28 Jul 2023 17:51:30 -0700 Message-ID: <20230729005133.1095051-21-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog In-Reply-To: <20230729005133.1095051-1-dmitry.torokhov@gmail.com> References: <20230729005133.1095051-1-dmitry.torokhov@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Instead of creating driver-specific device attributes with sysfs_create_group() have device core do this by setting up dev_groups pointer in the driver structure. Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/tsc2004.c | 7 ++++--- drivers/input/touchscreen/tsc2005.c | 7 ++++--- drivers/input/touchscreen/tsc200x-core.c | 18 +++++++----------- drivers/input/touchscreen/tsc200x-core.h | 1 + 4 files changed, 16 insertions(+), 17 deletions(-) diff --git a/drivers/input/touchscreen/tsc2004.c b/drivers/input/touchscreen/tsc2004.c index b5e904c5b7c4..89c5248f66f6 100644 --- a/drivers/input/touchscreen/tsc2004.c +++ b/drivers/input/touchscreen/tsc2004.c @@ -63,9 +63,10 @@ MODULE_DEVICE_TABLE(of, tsc2004_of_match); static struct i2c_driver tsc2004_driver = { .driver = { - .name = "tsc2004", - .of_match_table = of_match_ptr(tsc2004_of_match), - .pm = pm_sleep_ptr(&tsc200x_pm_ops), + .name = "tsc2004", + .dev_groups = tsc200x_groups, + .of_match_table = of_match_ptr(tsc2004_of_match), + .pm = pm_sleep_ptr(&tsc200x_pm_ops), }, .id_table = tsc2004_idtable, .probe = tsc2004_probe, diff --git a/drivers/input/touchscreen/tsc2005.c b/drivers/input/touchscreen/tsc2005.c index b6dfbcfc8c19..1b40ce0ca1b9 100644 --- a/drivers/input/touchscreen/tsc2005.c +++ b/drivers/input/touchscreen/tsc2005.c @@ -79,9 +79,10 @@ MODULE_DEVICE_TABLE(of, tsc2005_of_match); static struct spi_driver tsc2005_driver = { .driver = { - .name = "tsc2005", - .of_match_table = of_match_ptr(tsc2005_of_match), - .pm = pm_sleep_ptr(&tsc200x_pm_ops), + .name = "tsc2005", + .dev_groups = tsc200x_groups, + .of_match_table = of_match_ptr(tsc2005_of_match), + .pm = pm_sleep_ptr(&tsc200x_pm_ops), }, .probe = tsc2005_probe, .remove = tsc2005_remove, diff --git a/drivers/input/touchscreen/tsc200x-core.c b/drivers/input/touchscreen/tsc200x-core.c index b799f26fcf8f..a4c0e9db9bb9 100644 --- a/drivers/input/touchscreen/tsc200x-core.c +++ b/drivers/input/touchscreen/tsc200x-core.c @@ -356,6 +356,12 @@ static const struct attribute_group tsc200x_attr_group = { .attrs = tsc200x_attrs, }; +const struct attribute_group *tsc200x_groups[] = { + &tsc200x_attr_group, + NULL +}; +EXPORT_SYMBOL_GPL(tsc200x_groups); + static void tsc200x_esd_work(struct work_struct *work) { struct tsc200x *ts = container_of(work, struct tsc200x, esd_work.work); @@ -553,25 +559,17 @@ int tsc200x_probe(struct device *dev, int irq, const struct input_id *tsc_id, return error; dev_set_drvdata(dev, ts); - error = sysfs_create_group(&dev->kobj, &tsc200x_attr_group); - if (error) { - dev_err(dev, - "Failed to create sysfs attributes, err: %d\n", error); - goto disable_regulator; - } error = input_register_device(ts->idev); if (error) { dev_err(dev, "Failed to register input device, err: %d\n", error); - goto err_remove_sysfs; + goto disable_regulator; } irq_set_irq_wake(irq, 1); return 0; -err_remove_sysfs: - sysfs_remove_group(&dev->kobj, &tsc200x_attr_group); disable_regulator: regulator_disable(ts->vio); return error; @@ -582,8 +580,6 @@ void tsc200x_remove(struct device *dev) { struct tsc200x *ts = dev_get_drvdata(dev); - sysfs_remove_group(&dev->kobj, &tsc200x_attr_group); - regulator_disable(ts->vio); } EXPORT_SYMBOL_GPL(tsc200x_remove); diff --git a/drivers/input/touchscreen/tsc200x-core.h b/drivers/input/touchscreen/tsc200x-core.h index 4ded34425b21..37de91efd78e 100644 --- a/drivers/input/touchscreen/tsc200x-core.h +++ b/drivers/input/touchscreen/tsc200x-core.h @@ -70,6 +70,7 @@ extern const struct regmap_config tsc200x_regmap_config; extern const struct dev_pm_ops tsc200x_pm_ops; +extern const struct attribute_group *tsc200x_groups[]; int tsc200x_probe(struct device *dev, int irq, const struct input_id *tsc_id, struct regmap *regmap, From patchwork Sat Jul 29 00:51:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 708356 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9455CC001DE for ; Sat, 29 Jul 2023 00:53:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236949AbjG2Axg (ORCPT ); Fri, 28 Jul 2023 20:53:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236363AbjG2AxP (ORCPT ); Fri, 28 Jul 2023 20:53:15 -0400 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A70D14497; Fri, 28 Jul 2023 17:52:53 -0700 (PDT) Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-1bbd03cb7c1so17286865ad.3; Fri, 28 Jul 2023 17:52:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690591914; x=1691196714; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fQ4walodynTQZ2cRpT+46l/9m01tQFY85mxqkAELUk0=; b=PxW5h+UHiJAgT5mVL1r7FP+kz1r31kbrQrjeEGzWCDLF1nMzkUip808BWQMt1/T0Dl EfUGkoDB509dUWnsGS5Eu4AhHClMam6J0JuahLDzjLvJHjFoV25Uq7SOEpbeH45TT4zz jpKICdT0hubdS/SvmcafjjDDicz9tqOKI/yBA0fsOL4Qh9hYVxbpFGAcFWo+AS0TITY9 ZlJZsCkgRA2bzw4gHpNvYguetDPTvW7hXACHQ6ny+0kyRpB3hL47TKak7s+CW7yU0S3s E32Os4AQbQMSKYCgz2/aC/af/IpAQOrOcdMVBEbpKSUo0zvQAUIKwKHGVqBVKziO+nkl B5EA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690591914; x=1691196714; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fQ4walodynTQZ2cRpT+46l/9m01tQFY85mxqkAELUk0=; b=Rwm9OUCMR/LoNfpnXu0PlrEOlg5AB+FnNOAYXf2GxHZcZtC3x/RZellvxnSlkGJMng 4t7iCkOjWdk8+Y9G7X9IGoWSKf1bOKiP1YS+U50ZSpwj4W6cfOWw+/fglsaIK5P2w1iY cqe1MqkX2DPqRUl3WypYjQ8CdaQUnNp2xFe//iFwCiVhqMC2C7hG6HigoAA4+AfNzA77 9v8VbmQ6RBc4pNrm2Z4J2UmeFFzN+LuTtXHL8HBjw4UWkLAWad/poxUSBwtXxhyhL567 AXT+cZbWcl+oM6BmbMMH5B5w0ZwyUjaJWoPmDcqzNexWhTinavhaCC4tG9ES1X/bnhvU AlQQ== X-Gm-Message-State: ABy/qLaGEfP7B13RjeEAhKPsaENw8gYey7kq6f12ytGmdisifhvhjB2v 6t1Ng9oMAVmr1ekwcMuC8IGDtRzlA9A= X-Google-Smtp-Source: APBJJlGAgg0daMcw3QeKH9sovfKLojIr17N8/uNic838nCLNaWItcrGk5q5glPqeJ+vRYak+jjomVw== X-Received: by 2002:a17:902:8a85:b0:1b9:e913:b585 with SMTP id p5-20020a1709028a8500b001b9e913b585mr2480753plo.13.1690591913718; Fri, 28 Jul 2023 17:51:53 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:9d:2:bc93:3749:59cc:1d5c]) by smtp.gmail.com with ESMTPSA id h12-20020a170902704c00b001bb97e51ab4sm4149524plt.98.2023.07.28.17.51.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jul 2023 17:51:53 -0700 (PDT) From: Dmitry Torokhov To: linux-input@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman Subject: [PATCH 22/22] Input: wdt87xx_i2c - use device core to create driver-specific device attributes Date: Fri, 28 Jul 2023 17:51:31 -0700 Message-ID: <20230729005133.1095051-22-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog In-Reply-To: <20230729005133.1095051-1-dmitry.torokhov@gmail.com> References: <20230729005133.1095051-1-dmitry.torokhov@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org 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 --- drivers/input/touchscreen/wdt87xx_i2c.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/drivers/input/touchscreen/wdt87xx_i2c.c b/drivers/input/touchscreen/wdt87xx_i2c.c index cbc4750c53f9..128341a6696b 100644 --- a/drivers/input/touchscreen/wdt87xx_i2c.c +++ b/drivers/input/touchscreen/wdt87xx_i2c.c @@ -944,10 +944,7 @@ static struct attribute *wdt87xx_attrs[] = { &dev_attr_update_fw.attr, NULL }; - -static const struct attribute_group wdt87xx_attr_group = { - .attrs = wdt87xx_attrs, -}; +ATTRIBUTE_GROUPS(wdt87xx); static void wdt87xx_report_contact(struct input_dev *input, struct wdt87xx_sys_param *param, @@ -1104,12 +1101,6 @@ static int wdt87xx_ts_probe(struct i2c_client *client) return error; } - error = devm_device_add_group(&client->dev, &wdt87xx_attr_group); - if (error) { - dev_err(&client->dev, "create sysfs failed: %d\n", error); - return error; - } - return 0; } @@ -1172,8 +1163,9 @@ static struct i2c_driver wdt87xx_driver = { .probe = wdt87xx_ts_probe, .id_table = wdt87xx_dev_id, .driver = { - .name = WDT87XX_NAME, - .pm = pm_sleep_ptr(&wdt87xx_pm_ops), + .name = WDT87XX_NAME, + .dev_groups = wdt87xx_groups, + .pm = pm_sleep_ptr(&wdt87xx_pm_ops), .acpi_match_table = ACPI_PTR(wdt87xx_acpi_id), }, };