Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp6010909ybi; Wed, 31 Jul 2019 06:59:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqyG3Ff1nucTTH/kKtcF24TasJT6GYnE+YZoYhuQ0ho/peJ19mG/f3+qm41YmcfuG3kqcjjH X-Received: by 2002:a62:7994:: with SMTP id u142mr48304269pfc.39.1564581559566; Wed, 31 Jul 2019 06:59:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564581559; cv=none; d=google.com; s=arc-20160816; b=1GWZtwokXkHYIG9Hrzap45+ZzRijUW2M7p53xJk8ShR5atweRQgmd7AjGhPa2VlFna EwVasduftL6JIuJ2z3ok7hzq8m+QWFvHgRMx3EI0wuLd8LYXefeuhzvIgVkPyUtPEajh o5ClV0Krkq6Ewk48QF3VtKEjbn+2r8ZBrmkZrnDEMPxVBrmuOmNoErTvgDL2Q4+NP2Hv 34CvmqXbC/IbzhVabZrBSsaRjWQEQe8z3sTGTAzBrllyXITzpEys3GUrM9AgHN9TXx/l bUGOzbNzC940HE+S+ZEectHgVvlJS6yY661LGbrWZcO19R7wQ+/5gml3zA2n6Pk3MSW8 1pjQ== 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=Rym+4+RI13vaZd5DaenmX9D31L7l7tQw45njnHb3bOs=; b=BHdH8c6QvrTevpnJ4oTa90gbq+n+mWMgqJqRzx9HCFr30LEheb1fcQBEv4ROe22PrX Rda1tXruE5mdzDtcKyBENZzsGxhpd6uCGvBs2skd+j4ev1U28TKxxB5cm/io+WT5s46Y VptR/z7LX1iAfg9Ii2ITvCjCKkG5FGUI9j+8Lp8+YJMyjvELlPeCadosOhxEDPopsPh3 3bJNdH694yEWFvibu7DSW/vNGgq6C+kQBPLWC8U+qWZTGCOHSkWtQ+LmyhcyFfdoU28x ssVRlt+M5m+v8k2DGAAw+tFltTn7/G7VdHGvrwFi2aSmzqy1aakguCiABP8x6sLFIQGC 1C8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=sLmDhPMn; 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 d22si28063544pls.112.2019.07.31.06.59.04; Wed, 31 Jul 2019 06:59:19 -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=sLmDhPMn; 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 S2388016AbfGaMoO (ORCPT + 99 others); Wed, 31 Jul 2019 08:44:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:36474 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388010AbfGaMoL (ORCPT ); Wed, 31 Jul 2019 08:44:11 -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 0C0D92089E; Wed, 31 Jul 2019 12:44:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564577050; bh=9QHmlV3UC/Ih0nbNZ6S7QqAFc2A/UoarGKig2YK8eAI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sLmDhPMnwFa4bHwcL2y6xpUezufEHiDE7DhS2/7BfgfJWrIEYEYxH31VTQZEIsdIt YT+n/CCuy3wNxsvj2858TbE4QSuC4Sv1tSJpwLGWfyh3dJGiqycRYEnlAVsUUETR2P TcU5hYJ8Zp+lZ71ompEcetmnfk4b3G+DjeC9Iog8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org, Richard Gong , Dmitry Torokhov Cc: Greg Kroah-Hartman , Bartlomiej Zolnierkiewicz , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org Subject: [PATCH v2 03/10] input: keyboard: gpio_keys: convert platform driver to use dev_groups Date: Wed, 31 Jul 2019 14:43:42 +0200 Message-Id: <20190731124349.4474-4-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 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 03f4d152f6b7..1373dc5b0765 100644 --- a/drivers/input/keyboard/gpio_keys.c +++ b/drivers/input/keyboard/gpio_keys.c @@ -351,10 +351,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) { @@ -851,13 +848,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", @@ -1026,6 +1016,7 @@ static struct platform_driver gpio_keys_device_driver = { .name = "gpio-keys", .pm = &gpio_keys_pm_ops, .of_match_table = gpio_keys_of_match, + .dev_groups = gpio_keys_groups, } }; -- 2.22.0