From patchwork Tue Jan 19 13:14:02 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 73865 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id o0JDEwc1022919 for ; Tue, 19 Jan 2010 13:14:58 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752300Ab0ASNOz (ORCPT ); Tue, 19 Jan 2010 08:14:55 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751523Ab0ASNOz (ORCPT ); Tue, 19 Jan 2010 08:14:55 -0500 Received: from smtp.nokia.com ([192.100.122.230]:54486 "EHLO mgw-mx03.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751632Ab0ASNOx (ORCPT ); Tue, 19 Jan 2010 08:14:53 -0500 Received: from vaebh105.NOE.Nokia.com (vaebh105.europe.nokia.com [10.160.244.31]) by mgw-mx03.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id o0JDEbDQ029263; Tue, 19 Jan 2010 15:14:49 +0200 Received: from vaebh104.NOE.Nokia.com ([10.160.244.30]) by vaebh105.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 19 Jan 2010 15:14:39 +0200 Received: from mgw-da01.ext.nokia.com ([147.243.128.24]) by vaebh104.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Tue, 19 Jan 2010 15:14:38 +0200 Received: from localhost.localdomain (esdhcp04088.research.nokia.com [172.21.40.88]) by mgw-da01.ext.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id o0JDESMn002814; Tue, 19 Jan 2010 15:14:33 +0200 From: Felipe Balbi To: Tony Lindgren Cc: Linux OMAP Mailing List , felipe.balbi@nokia.com Subject: [PATCH/USB 03/16] USB: musb: move to sysfs_groups Date: Tue, 19 Jan 2010 15:14:02 +0200 Message-Id: <1263906855-28341-4-git-send-email-felipe.balbi@nokia.com> X-Mailer: git-send-email 1.6.6.rc0 In-Reply-To: <1263906855-28341-1-git-send-email-felipe.balbi@nokia.com> References: <1263906855-28341-1-git-send-email-felipe.balbi@nokia.com> X-OriginalArrivalTime: 19 Jan 2010 13:14:38.0842 (UTC) FILETIME=[5AAB6DA0:01CA9909] X-Nokia-AV: Clean Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index 91c31f2..52295bc 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c @@ -1759,6 +1759,19 @@ static DEVICE_ATTR(srp, 0644, NULL, musb_srp_store); #endif /* CONFIG_USB_GADGET_MUSB_HDRC */ +static struct attribute *musb_attributes[] = { + &dev_attr_mode.attr, + &dev_attr_vbus.attr, +#ifdef CONFIG_USB_GADGET_MUSB_HDRC + &dev_attr_srp.attr, +#endif + NULL +}; + +static const struct attribute_group musb_attr_group = { + .attrs = musb_attributes, +}; + #endif /* sysfs */ /* Only used to provide driver mode change events */ @@ -1833,11 +1846,7 @@ static void musb_free(struct musb *musb) */ #ifdef CONFIG_SYSFS - device_remove_file(musb->controller, &dev_attr_mode); - device_remove_file(musb->controller, &dev_attr_vbus); -#ifdef CONFIG_USB_GADGET_MUSB_HDRC - device_remove_file(musb->controller, &dev_attr_srp); -#endif + sysfs_remove_group(&musb->controller->kobj, &musb_attr_group); #endif #ifdef CONFIG_USB_GADGET_MUSB_HDRC @@ -2079,12 +2088,7 @@ bad_config: } #ifdef CONFIG_SYSFS - status = device_create_file(dev, &dev_attr_mode); - status = device_create_file(dev, &dev_attr_vbus); -#ifdef CONFIG_USB_GADGET_MUSB_HDRC - status = device_create_file(dev, &dev_attr_srp); -#endif /* CONFIG_USB_GADGET_MUSB_HDRC */ - status = 0; + status = sysfs_create_group(&musb->controller->kobj, &musb_attr_group); #endif if (status) goto fail2; @@ -2092,13 +2096,6 @@ bad_config: return 0; fail2: -#ifdef CONFIG_SYSFS - device_remove_file(musb->controller, &dev_attr_mode); - device_remove_file(musb->controller, &dev_attr_vbus); -#ifdef CONFIG_USB_GADGET_MUSB_HDRC - device_remove_file(musb->controller, &dev_attr_srp); -#endif -#endif musb_platform_exit(musb); fail: dev_err(musb->controller,