From patchwork Thu Jul 4 08:46:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 11031199 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 38E1514DB for ; Thu, 4 Jul 2019 08:46:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2D9471FE84 for ; Thu, 4 Jul 2019 08:46:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 21F2928831; Thu, 4 Jul 2019 08:46:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D3BCA1FE84 for ; Thu, 4 Jul 2019 08:46:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 447E36E303; Thu, 4 Jul 2019 08:46:43 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by gabe.freedesktop.org (Postfix) with ESMTPS id 02D146E303 for ; Thu, 4 Jul 2019 08:46:42 +0000 (UTC) Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 626A0218A6; Thu, 4 Jul 2019 08:46:41 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Subject: [PATCH 10/11] input: keyboard: gpio_keys: convert platform driver to use dev_groups Date: Thu, 4 Jul 2019 10:46:16 +0200 Message-Id: <20190704084617.3602-11-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190704084617.3602-1-gregkh@linuxfoundation.org> References: <20190704084617.3602-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562230001; bh=/nscaZ8tOKoA1xhpKbG/KBNAKedrtqbPGjp5wJ1TSpQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I+DCsUahJo9iDLvMN0Xcu4HnNamjXiAT94J/+uj5N3iNe97RaB4mbBXXducoiirEQ 9SeyP2XeHF8q+au1V8zq5T3zJ5GQXBFD9ndhdnYrrDIQRlPEFKdmUcbbvpsZ3DwoIv P5TLC/YESUEnwbFOB7AJWeQG22osfis4URZS4F78= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Greg Kroah-Hartman , linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, Bartlomiej Zolnierkiewicz Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Platform drivers now have the option to have the platform core create and remove any needed sysfs attribute files. So take advantage of that and do not register "by hand" a bunch of sysfs files. Cc: Bartlomiej Zolnierkiewicz Cc: dri-devel@lists.freedesktop.org Cc: linux-fbdev@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/input/keyboard/gpio_keys.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c index 6cd199e8a370..1f6547440edb 100644 --- a/drivers/input/keyboard/gpio_keys.c +++ b/drivers/input/keyboard/gpio_keys.c @@ -354,10 +354,7 @@ static struct attribute *gpio_keys_attrs[] = { &dev_attr_disabled_switches.attr, NULL, }; - -static const struct attribute_group gpio_keys_attr_group = { - .attrs = gpio_keys_attrs, -}; +ATTRIBUTE_GROUPS(gpio_keys); static void gpio_keys_gpio_report_event(struct gpio_button_data *bdata) { @@ -856,13 +853,6 @@ static int gpio_keys_probe(struct platform_device *pdev) fwnode_handle_put(child); - error = devm_device_add_group(dev, &gpio_keys_attr_group); - if (error) { - dev_err(dev, "Unable to export keys/switches, error: %d\n", - error); - return error; - } - error = input_register_device(input); if (error) { dev_err(dev, "Unable to register input device, error: %d\n", @@ -1025,6 +1015,7 @@ static void gpio_keys_shutdown(struct platform_device *pdev) } static struct platform_driver gpio_keys_device_driver = { + .dev_groups = gpio_keys_groups, .probe = gpio_keys_probe, .shutdown = gpio_keys_shutdown, .driver = {