From patchwork Tue Mar 31 13:52:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacek Anaszewski X-Patchwork-Id: 6130241 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1244FBF4A6 for ; Tue, 31 Mar 2015 13:54:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1B15120154 for ; Tue, 31 Mar 2015 13:54:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0C1E820149 for ; Tue, 31 Mar 2015 13:54:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754132AbbCaNyD (ORCPT ); Tue, 31 Mar 2015 09:54:03 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:47886 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753943AbbCaNyC (ORCPT ); Tue, 31 Mar 2015 09:54:02 -0400 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NM2007BMXA1RW00@mailout1.samsung.com>; Tue, 31 Mar 2015 22:54:01 +0900 (KST) X-AuditID: cbfee61a-f79c06d000004e71-aa-551aa6f9b0ce Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 5F.32.20081.9F6AA155; Tue, 31 Mar 2015 22:54:01 +0900 (KST) Received: from AMDC2362.DIGITAL.local ([106.120.53.23]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NM200JI4X7ZTQ90@mmp1.samsung.com>; Tue, 31 Mar 2015 22:54:01 +0900 (KST) From: Jacek Anaszewski To: linux-leds@vger.kernel.org, linux-media@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 v4 02/12] leds: unify the location of led-trigger API Date: Tue, 31 Mar 2015 15:52:38 +0200 Message-id: <1427809965-25540-3-git-send-email-j.anaszewski@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1427809965-25540-1-git-send-email-j.anaszewski@samsung.com> References: <1427809965-25540-1-git-send-email-j.anaszewski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrALMWRmVeSWpSXmKPExsVy+t9jAd2fy6RCDT58ELQ4unMik0Xv1eeM Fmeb3rBbbH2zjtGiZ8NWVou7p46yWeze9ZTV4vCbdlaLM/tXsjlweuycdZfd4/DXhSwee+b/ YPXo27KK0WPF6u/sHp83yQWwRXHZpKTmZJalFunbJXBl7L7iV7BEquLp0bWMDYx7xboYOTkk BEwkvm86wwRhi0lcuLeeDcQWEljEKLHldnAXIxeQ/ZNR4ueRZ2BFbAKGEj9fvAazRQSsJWYd ms4CUsQssIFR4vKERiCHg0NYwFVibaMrSA2LgKrE2fatLCA2r4CHxMHX08BKJAQUJOZMsgEJ cwp4SnSu2skOsddD4vPbPewTGHkXMDKsYhRNLUguKE5KzzXUK07MLS7NS9dLzs/dxAgOt2dS OxhXNlgcYhTgYFTi4b1wTzJUiDWxrLgy9xCjBAezkgjvz4lSoUK8KYmVValF+fFFpTmpxYcY pTlYlMR5lezbQoQE0hNLUrNTUwtSi2CyTBycUg2MFyKvn17ZdHiG+u8XJRVzbU5uCb3+cmHr le17XKQdJuhaTr8cbHtGX4ClQX3DxKmrZi48oj0p2b14sb5YLeO13LhvS7a7i80vvr/lV54F 2yfPZaG31f7pXvyW8kjoxQ99gR8LBNxPP9uxrjHJK/zRtWfH81fx3Tnl3v47+Iph4odw6Wv3 3VJY/iuxFGckGmoxFxUnAgDPTBg3MwIAAA== 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 Part of led-trigger API was in the private drivers/leds/leds.h header. Move it to the include/linux/leds.h header to unify the API location and announce it as public. It has been already exported from led-triggers.c with EXPORT_SYMBOL_GPL macro. Signed-off-by: Jacek Anaszewski Acked-by: Kyungmin Park Acked-by: Sakari Ailus Cc: Bryan Wu Cc: Richard Purdie --- drivers/leds/leds.h | 24 ------------------------ include/linux/leds.h | 24 ++++++++++++++++++++++++ 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/drivers/leds/leds.h b/drivers/leds/leds.h index 79efe57..bc89d7a 100644 --- a/drivers/leds/leds.h +++ b/drivers/leds/leds.h @@ -13,7 +13,6 @@ #ifndef __LEDS_H_INCLUDED #define __LEDS_H_INCLUDED -#include #include #include @@ -50,27 +49,4 @@ void led_stop_software_blink(struct led_classdev *led_cdev); extern struct rw_semaphore leds_list_lock; extern struct list_head leds_list; -#ifdef CONFIG_LEDS_TRIGGERS -void led_trigger_set_default(struct led_classdev *led_cdev); -void led_trigger_set(struct led_classdev *led_cdev, - struct led_trigger *trigger); -void led_trigger_remove(struct led_classdev *led_cdev); - -static inline void *led_get_trigger_data(struct led_classdev *led_cdev) -{ - return led_cdev->trigger_data; -} - -#else -#define led_trigger_set_default(x) do {} while (0) -#define led_trigger_set(x, y) do {} while (0) -#define led_trigger_remove(x) do {} while (0) -#define led_get_trigger_data(x) (NULL) -#endif - -ssize_t led_trigger_store(struct device *dev, struct device_attribute *attr, - const char *buf, size_t count); -ssize_t led_trigger_show(struct device *dev, struct device_attribute *attr, - char *buf); - #endif /* __LEDS_H_INCLUDED */ diff --git a/include/linux/leds.h b/include/linux/leds.h index 9a2b000..0579708 100644 --- a/include/linux/leds.h +++ b/include/linux/leds.h @@ -12,6 +12,7 @@ #ifndef __LINUX_LEDS_H_INCLUDED #define __LINUX_LEDS_H_INCLUDED +#include #include #include #include @@ -222,6 +223,29 @@ struct led_trigger { struct list_head next_trig; }; +#ifdef CONFIG_LEDS_TRIGGERS +void led_trigger_set_default(struct led_classdev *led_cdev); +void led_trigger_set(struct led_classdev *led_cdev, + struct led_trigger *trigger); +void led_trigger_remove(struct led_classdev *led_cdev); + +static inline void *led_get_trigger_data(struct led_classdev *led_cdev) +{ + return led_cdev->trigger_data; +} + +#else +#define led_trigger_set_default(x) do {} while (0) +#define led_trigger_set(x, y) do {} while (0) +#define led_trigger_remove(x) do {} while (0) +#define led_get_trigger_data(x) (NULL) +#endif + +ssize_t led_trigger_store(struct device *dev, struct device_attribute *attr, + const char *buf, size_t count); +ssize_t led_trigger_show(struct device *dev, struct device_attribute *attr, + char *buf); + /* Registration functions for complex triggers */ extern int led_trigger_register(struct led_trigger *trigger); extern void led_trigger_unregister(struct led_trigger *trigger);