Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp6010977ybi; Wed, 31 Jul 2019 06:59:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqxdXimzg9GPgUbzDqavibfM67XkrHBvgWwvEtf1+cC4E1x+EJ9OgOYrrAIdSEJ2iFcqce6o X-Received: by 2002:a65:68c8:: with SMTP id k8mr29439263pgt.192.1564581564052; Wed, 31 Jul 2019 06:59:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564581564; cv=none; d=google.com; s=arc-20160816; b=lIoKZ8O6UliVnC0AUp6uG+y6za4XRhVZk4+tVpJeMXHk/FUu/j7Ms9Hni6zvWrpNHs Q4ilOLeoeZzUqPEl1HcIjD/nVDJJTX3siM31VR4yeAFEB6w7lVEPuIpabLge+SKtUvKh cuii40xPSftueeYltxgjKHpbfE7CUF4pQ4z2az/wW0YiGKUJ6z6WLU2W+Y/G6S2onvhN 1q23P5yc7XA95V8fgtDyCHdbt+TUa1XBcdw5dMI0gZV7tpMXh+7iwaC7CY30bVeRMxmO wQ6AgR+NGQL/NQH3DZUg0wkR1NOU4vSlDdHQgiV7eCj7B9x/vl799DSxcJ03NARz0Xn2 VkAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=iYldW5IH1DUsleY58ycD/O4vH7Tj1qObK5XwSRhB+TY=; b=X6FuWwsR1w5GiFsKkbbYhQpGj9941O5Xq9CU9TGuuJ8vsKgx2dU+Js8UNoogISmeFq POi4j9nsu5CVIUHlYqptigic9kCW0OW3/5xYzYw5CczGiqwqnppzFiOIg/ip0vMyzBCE 77lVY4pufy5ZbRGEPV7lCHqnAC77WHXyVN1VNOdSBxGJUHanvwS4cMa9KrLaO8R8bsej 88FN3efvSUNiWlpNXB/MqzHDIalmgny5m4RqrhuhMMPtukLl0gsTgXmiYZnBArDF6ElA m+gu35oE4cQg1R1tAuNEeHGgRO+o8suRmH5KVtMbStxYfnRi6NJ9AGbT+i4B+Af4vEB0 rYmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BCt5O2rq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e96si29575110plb.123.2019.07.31.06.59.09; Wed, 31 Jul 2019 06:59:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BCt5O2rq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388026AbfGaMoS (ORCPT + 99 others); Wed, 31 Jul 2019 08:44:18 -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 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); -- 2.22.0