From patchwork Tue Oct 8 01:27:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 2999841 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id F0B249F1E1 for ; Tue, 8 Oct 2013 02:16:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0B8082012F for ; Tue, 8 Oct 2013 02:16:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 26E3A2018A for ; Tue, 8 Oct 2013 02:16:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753926Ab3JHCQY (ORCPT ); Mon, 7 Oct 2013 22:16:24 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:35863 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753802Ab3JHCQX (ORCPT ); Mon, 7 Oct 2013 22:16:23 -0400 Received: from localhost (unknown [32.162.39.137]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 1DF8E992; Tue, 8 Oct 2013 02:16:17 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , Dmitry Torokhov , Subject: [PATCH 3/8] input: gameport: convert bus code to use dev_groups Date: Mon, 7 Oct 2013 18:27:37 -0700 Message-Id: <1381195662-28009-4-git-send-email-gregkh@linuxfoundation.org> X-Mailer: git-send-email 1.8.4.6.g82e253f.dirty In-Reply-To: <1381195662-28009-1-git-send-email-gregkh@linuxfoundation.org> References: <1381195662-28009-1-git-send-email-gregkh@linuxfoundation.org> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The dev_attrs field of struct bus_type is going away soon, dev_groups should be used instead. This converts the gameport bus code to use the correct field. Cc: Dmitry Torokhov Cc: Signed-off-by: Greg Kroah-Hartman --- Dmitry, I can take this through my driver-core tree if you don't want to take it through yours, just let me know what works best for you. drivers/input/gameport/gameport.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/drivers/input/gameport/gameport.c b/drivers/input/gameport/gameport.c index 922a7fe..24c41ba 100644 --- a/drivers/input/gameport/gameport.c +++ b/drivers/input/gameport/gameport.c @@ -422,14 +422,15 @@ static struct gameport *gameport_get_pending_child(struct gameport *parent) * Gameport port operations */ -static ssize_t gameport_show_description(struct device *dev, struct device_attribute *attr, char *buf) +static ssize_t gameport_description_show(struct device *dev, struct device_attribute *attr, char *buf) { struct gameport *gameport = to_gameport_port(dev); return sprintf(buf, "%s\n", gameport->name); } +static DEVICE_ATTR(description, S_IRUGO, gameport_description_show, NULL); -static ssize_t gameport_rebind_driver(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) +static ssize_t drvctl_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct gameport *gameport = to_gameport_port(dev); struct device_driver *drv; @@ -457,12 +458,14 @@ static ssize_t gameport_rebind_driver(struct device *dev, struct device_attribut return error ? error : count; } +static DEVICE_ATTR_WO(drvctl); -static struct device_attribute gameport_device_attrs[] = { - __ATTR(description, S_IRUGO, gameport_show_description, NULL), - __ATTR(drvctl, S_IWUSR, NULL, gameport_rebind_driver), - __ATTR_NULL +static struct attribute *gameport_device_attrs[] = { + &dev_attr_description.attr, + &dev_attr_drvctl.attr, + NULL, }; +ATTRIBUTE_GROUPS(gameport_device); static void gameport_release_port(struct device *dev) { @@ -750,7 +753,7 @@ static int gameport_bus_match(struct device *dev, struct device_driver *drv) static struct bus_type gameport_bus = { .name = "gameport", - .dev_attrs = gameport_device_attrs, + .dev_groups = gameport_device_groups, .drv_groups = gameport_driver_groups, .match = gameport_bus_match, .probe = gameport_driver_probe,