From patchwork Wed Jul 31 12:43:43 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: 11067771 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 E18EE14DB for ; Wed, 31 Jul 2019 12:44:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CDBC3288C3 for ; Wed, 31 Jul 2019 12:44:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C26DF288C4; Wed, 31 Jul 2019 12:44:17 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5DB362843B for ; Wed, 31 Jul 2019 12:44:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728703AbfGaMoQ (ORCPT ); Wed, 31 Jul 2019 08:44:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:36546 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388013AbfGaMoO (ORCPT ); Wed, 31 Jul 2019 08:44:14 -0400 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 AC5C82089E; Wed, 31 Jul 2019 12:44:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564577053; bh=mYJJh27t+/bVqb2P718LNvvV/gjJuz87nyy7thlZJXE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BCt5O2rqUxNFHOYho9ko4FSTDwEKfpYA21/ZZQ36r9aIv0cjPJUCnSxB6UhEsZUk5 18xUHVSQYnqCFpwDzlKbBMZ98TrhcDbnIqze71sULACdVKdWaQrv1aCSxMuPNl5irt rpEL3LxDSu5v3OGKPR+i0EUbHbW3st2mipezsbxE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org, Richard Gong , Dmitry Torokhov Cc: Greg Kroah-Hartman , Andy Shevchenko , Florian Fainelli , linux-input@vger.kernel.org Subject: [PATCH v2 04/10] input: axp20x-pek: convert platform driver to use dev_groups Date: Wed, 31 Jul 2019 14:43:43 +0200 Message-Id: <20190731124349.4474-5-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190731124349.4474-1-gregkh@linuxfoundation.org> References: <20190731124349.4474-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org 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 sysfs group of attributes. Cc: Dmitry Torokhov Cc: Andy Shevchenko Cc: Florian Fainelli Cc: linux-input@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/input/misc/axp20x-pek.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers/input/misc/axp20x-pek.c b/drivers/input/misc/axp20x-pek.c index debeeaeb8812..235925b28772 100644 --- a/drivers/input/misc/axp20x-pek.c +++ b/drivers/input/misc/axp20x-pek.c @@ -195,15 +195,12 @@ DEVICE_ATTR(startup, 0644, axp20x_show_attr_startup, axp20x_store_attr_startup); DEVICE_ATTR(shutdown, 0644, axp20x_show_attr_shutdown, axp20x_store_attr_shutdown); -static struct attribute *axp20x_attributes[] = { +static struct attribute *axp20x_attrs[] = { &dev_attr_startup.attr, &dev_attr_shutdown.attr, NULL, }; - -static const struct attribute_group axp20x_attribute_group = { - .attrs = axp20x_attributes, -}; +ATTRIBUTE_GROUPS(axp20x); static irqreturn_t axp20x_pek_irq(int irq, void *pwr) { @@ -356,13 +353,6 @@ static int axp20x_pek_probe(struct platform_device *pdev) axp20x_pek->info = (struct axp20x_info *)match->driver_data; - error = devm_device_add_group(&pdev->dev, &axp20x_attribute_group); - if (error) { - dev_err(&pdev->dev, "Failed to create sysfs attributes: %d\n", - error); - return error; - } - platform_set_drvdata(pdev, axp20x_pek); return 0; @@ -411,6 +401,7 @@ static struct platform_driver axp20x_pek_driver = { .driver = { .name = "axp20x-pek", .pm = &axp20x_pek_pm_ops, + .dev_groups = axp20x_groups, }, }; module_platform_driver(axp20x_pek_driver);