From patchwork Fri Nov 12 18:18:41 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Achatz X-Patchwork-Id: 320662 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oACIM6kd024647 for ; Fri, 12 Nov 2010 18:22:06 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932674Ab0KLSVP (ORCPT ); Fri, 12 Nov 2010 13:21:15 -0500 Received: from fmmailgate01.web.de ([217.72.192.221]:56689 "EHLO fmmailgate01.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932252Ab0KLSVE (ORCPT ); Fri, 12 Nov 2010 13:21:04 -0500 Received: from smtp02.web.de ( [172.20.0.184]) by fmmailgate01.web.de (Postfix) with ESMTP id EDEC71782F21C; Fri, 12 Nov 2010 19:18:41 +0100 (CET) Received: from [84.57.56.184] (helo=[192.168.0.7]) by smtp02.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.110 #24) id 1PGyCv-0003hf-00; Fri, 12 Nov 2010 19:18:41 +0100 Subject: [PATCH 2/2] HID: roccat: using new sysfs_create_bin_group() in kone driver From: Stefan Achatz To: Greg Kroah-Hartman , "Eric W. Biederman" , "Serge E. Hallyn" , Tejun Heo , Jiri Kosina , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Dmitry Torokhov , Benjamin Thery Date: Fri, 12 Nov 2010 19:18:41 +0100 Message-ID: <1289585921.2629.13.camel@neuromancer> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 (2.30.3-1.fc13) X-Sender: stefan_achatz@web.de X-Provags-ID: V01U2FsdGVkX1/THdQDiyPe6oyAWVlGk8mjP1h0JA89B41Flbut +bt05dZEzLp+bG2hWI2D24zFSvPODw2HOFxGhg5NqqTE5tOc2k HlzVkQl0JyfBbBUzYPEw== Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Fri, 12 Nov 2010 18:22:07 +0000 (UTC) diff --git a/drivers/hid/hid-roccat-kone.c b/drivers/hid/hid-roccat-kone.c index f776957..43f1693 100644 --- a/drivers/hid/hid-roccat-kone.c +++ b/drivers/hid/hid-roccat-kone.c @@ -710,6 +710,20 @@ static struct bin_attribute kone_profile5_attr = { .write = kone_sysfs_write_profile5 }; +static struct attribute *kone_bin_attributes[] = { + &kone_settings_attr.attr, + &kone_profile1_attr.attr, + &kone_profile2_attr.attr, + &kone_profile3_attr.attr, + &kone_profile4_attr.attr, + &kone_profile5_attr.attr, + NULL +}; + +static struct attribute_group kone_bin_attribute_group = { + .attrs = kone_bin_attributes +}; + static int kone_create_sysfs_attributes(struct usb_interface *intf) { int retval; @@ -718,42 +732,12 @@ static int kone_create_sysfs_attributes(struct usb_interface *intf) if (retval) goto exit_1; - retval = sysfs_create_bin_file(&intf->dev.kobj, &kone_settings_attr); + retval = sysfs_create_bin_group(&intf->dev.kobj, &kone_bin_attribute_group); if (retval) goto exit_2; - retval = sysfs_create_bin_file(&intf->dev.kobj, &kone_profile1_attr); - if (retval) - goto exit_3; - - retval = sysfs_create_bin_file(&intf->dev.kobj, &kone_profile2_attr); - if (retval) - goto exit_4; - - retval = sysfs_create_bin_file(&intf->dev.kobj, &kone_profile3_attr); - if (retval) - goto exit_5; - - retval = sysfs_create_bin_file(&intf->dev.kobj, &kone_profile4_attr); - if (retval) - goto exit_6; - - retval = sysfs_create_bin_file(&intf->dev.kobj, &kone_profile5_attr); - if (retval) - goto exit_7; - return 0; -exit_7: - sysfs_remove_bin_file(&intf->dev.kobj, &kone_profile4_attr); -exit_6: - sysfs_remove_bin_file(&intf->dev.kobj, &kone_profile3_attr); -exit_5: - sysfs_remove_bin_file(&intf->dev.kobj, &kone_profile2_attr); -exit_4: - sysfs_remove_bin_file(&intf->dev.kobj, &kone_profile1_attr); -exit_3: - sysfs_remove_bin_file(&intf->dev.kobj, &kone_settings_attr); exit_2: sysfs_remove_group(&intf->dev.kobj, &kone_attribute_group); exit_1: @@ -762,12 +746,7 @@ exit_1: static void kone_remove_sysfs_attributes(struct usb_interface *intf) { - sysfs_remove_bin_file(&intf->dev.kobj, &kone_profile5_attr); - sysfs_remove_bin_file(&intf->dev.kobj, &kone_profile4_attr); - sysfs_remove_bin_file(&intf->dev.kobj, &kone_profile3_attr); - sysfs_remove_bin_file(&intf->dev.kobj, &kone_profile2_attr); - sysfs_remove_bin_file(&intf->dev.kobj, &kone_profile1_attr); - sysfs_remove_bin_file(&intf->dev.kobj, &kone_settings_attr); + sysfs_remove_group(&intf->dev.kobj, &kone_bin_attribute_group); sysfs_remove_group(&intf->dev.kobj, &kone_attribute_group); }