From patchwork Thu Mar 12 15:45:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacek Anaszewski X-Patchwork-Id: 5996751 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D9B139F318 for ; Thu, 12 Mar 2015 15:49:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1CBE3202DD for ; Thu, 12 Mar 2015 15:49:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3A18020266 for ; Thu, 12 Mar 2015 15:49:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932503AbbCLPp7 (ORCPT ); Thu, 12 Mar 2015 11:45:59 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:62117 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932381AbbCLPpr (ORCPT ); Thu, 12 Mar 2015 11:45:47 -0400 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NL300H8UVS9PS80@mailout2.samsung.com>; Fri, 13 Mar 2015 00:45:45 +0900 (KST) X-AuditID: cbfee61a-f79c06d000004e71-8b-5501b4a90455 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id A5.48.20081.9A4B1055; Fri, 13 Mar 2015 00:45:45 +0900 (KST) Received: from AMDC2362.DIGITAL.local ([106.120.53.23]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0NL300DC9VRGU950@mmp2.samsung.com>; Fri, 13 Mar 2015 00:45:44 +0900 (KST) From: Jacek Anaszewski To: linux-leds@vger.kernel.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Cc: kyungmin.park@samsung.com, pavel@ucw.cz, cooloney@gmail.com, rpurdie@rpsys.net, sakari.ailus@iki.fi, s.nawrocki@samsung.com, Jacek Anaszewski Subject: [PATCH/RFC v13 01/13] leds: flash: Fix the size of sysfs_groups array Date: Thu, 12 Mar 2015 16:45:02 +0100 Message-id: <1426175114-14876-2-git-send-email-j.anaszewski@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1426175114-14876-1-git-send-email-j.anaszewski@samsung.com> References: <1426175114-14876-1-git-send-email-j.anaszewski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrDLMWRmVeSWpSXmKPExsVy+t9jQd2VWxhDDf4/Y7c4unMik8X8I+dY LXqvPme0ONv0ht3i8q45bBZb36xjtOjZsJXV4u6po2wWu3c9ZbU4/Kad1eLM/pVsDtweO2fd Zfc4/HUhi8ee+T9YPfq2rGL0WLH6O7vH501yAWxRXDYpqTmZZalF+nYJXBndi84yFzzjqXj9 oLyB8QVXFyMnh4SAicSGh7dYIWwxiQv31rN1MXJxCAlMZ5R4+7eXEcJpZ5J4+ruLDaSKTcBQ 4ueL10wgtohAucSeO4/ZQYqYBTYwSlye0MgCkhAW8JPo/f4ebCyLgKrEtM3zwGxeAQ+JZbe+ AE3lAFqnIDFnkg1ImFPAU6L7/gdGEFsIqGTyhr/sExh5FzAyrGIUTS1ILihOSs811CtOzC0u zUvXS87P3cQIDsNnUjsYVzZYHGIU4GBU4uGt+MoQKsSaWFZcmXuIUYKDWUmE13Q+Y6gQb0pi ZVVqUX58UWlOavEhRmkOFiVxXiX7thAhgfTEktTs1NSC1CKYLBMHp1QDo/Gc1I3y4bnbLqZ/ kmdbdlVotgxn4+GV2o+1PQIc/ywVWnxh+W1egYYzzw5OlNo158Uy/Q0vr77v9lm81snU/87B O/q/jzCfvrCvhnWP3wV2n6m/JqhqRn0q9S7e3DnrzX3rldFSSzosVB6dLVVhKNh7QSGi7m9K wY2KkhlPtpwSEOYqa79QEKzEUpyRaKjFXFScCACfPyoqPwIAAA== Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 LED_FLASH_MAX_SYSFS_GROUPS macro had value that was relevant for previous version of the patches introducing LED Flash class. Currently it is required to reserve the room for maximum 4 sysfs groups. Since the last element of the struct attribute_group array passed to the function device_create_with_groups has to be NULL, the size of the array has to be greater by one than maximum allowed number of groups. Therefore, the name of the macro is being changed to LED_FLASH_SYSFS_GROUPS_SIZE, to make it more accurrate. Signed-off-by: Jacek Anaszewski Acked-by: Kyungmin Park Cc: Bryan Wu Cc: Richard Purdie --- include/linux/led-class-flash.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/led-class-flash.h b/include/linux/led-class-flash.h index 21ec91e..e97966d 100644 --- a/include/linux/led-class-flash.h +++ b/include/linux/led-class-flash.h @@ -32,7 +32,7 @@ struct led_classdev_flash; #define LED_FAULT_LED_OVER_TEMPERATURE (1 << 8) #define LED_NUM_FLASH_FAULTS 9 -#define LED_FLASH_MAX_SYSFS_GROUPS 7 +#define LED_FLASH_SYSFS_GROUPS_SIZE 5 struct led_flash_ops { /* set flash brightness */ @@ -80,7 +80,7 @@ struct led_classdev_flash { struct led_flash_setting timeout; /* LED Flash class sysfs groups */ - const struct attribute_group *sysfs_groups[LED_FLASH_MAX_SYSFS_GROUPS]; + const struct attribute_group *sysfs_groups[LED_FLASH_SYSFS_GROUPS_SIZE]; }; static inline struct led_classdev_flash *lcdev_to_flcdev(