From patchwork Fri Mar 27 13:49:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacek Anaszewski X-Patchwork-Id: 6107191 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 65F74BF90F for ; Fri, 27 Mar 2015 13:50:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B794D20386 for ; Fri, 27 Mar 2015 13:50:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4CA2C203FB for ; Fri, 27 Mar 2015 13:50:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753091AbbC0NuI (ORCPT ); Fri, 27 Mar 2015 09:50:08 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:22288 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752937AbbC0NuF (ORCPT ); Fri, 27 Mar 2015 09:50:05 -0400 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NLV00IAOIFFZHD0@mailout4.samsung.com>; Fri, 27 Mar 2015 22:50:03 +0900 (KST) X-AuditID: cbfee61b-f79d76d0000024d6-8f-5515600b2fab Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 71.C1.09430.B0065155; Fri, 27 Mar 2015 22:50:03 +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 <0NLV000ODIF0Y850@mmp1.samsung.com>; Fri, 27 Mar 2015 22:50:03 +0900 (KST) From: Jacek Anaszewski To: linux-leds@vger.kernel.org, linux-media@vger.kernel.org Cc: devicetree@vger.kernel.org, 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 v2 01/11] leds: unify the location of led-trigger API Date: Fri, 27 Mar 2015 14:49:35 +0100 Message-id: <1427464185-27950-2-git-send-email-j.anaszewski@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1427464185-27950-1-git-send-email-j.anaszewski@samsung.com> References: <1427464185-27950-1-git-send-email-j.anaszewski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrOLMWRmVeSWpSXmKPExsVy+t9jAV3uBNFQg1m3NS2O7pzIZDH/yDlW i96rzxktzja9YbfY+mYdo0XPhq2sFndPHWWz2L3rKavF4TftrBZn9q9kc+Dy2DnrLrvH4a8L WTz2zP/B6tG3ZRWjx4rV39k9Pm+SC2CL4rJJSc3JLEst0rdL4Mo4uq2XveCtZMWW02uZGhi7 xboYOTkkBEwk/s6bwAZhi0lcuLceyObiEBJYxChxacoGFgjnJ6PEg0XT2UGq2AQMJX6+eM0E YosIWEvMOjSdBcRmFjjDKDFtqi2ILSzgKtF29y4jiM0ioCrxpf8mK4jNK+AhceLHHqA5HEDb FCTmTLIBCXMKeErsvbQKbIwQUMmMTTfYJjDyLmBkWMUomlqQXFCclJ5rpFecmFtcmpeul5yf u4kRHHzPpHcwrmqwOMQowMGoxMP7Y7dIqBBrYllxZe4hRgkOZiURXpUg0VAh3pTEyqrUovz4 otKc1OJDjNIcLErivEr2bSFCAumJJanZqakFqUUwWSYOTqkGxsyFk17tiLwz6cpzreojip3V 22ac2VaW6b9235EPgjmHzry79O93Y0RKs5FKw07L5Jlh4UsLsjttGA//bX4m6P0jwH9DzIuP G7o+K+z7/dx+wtWZhor/c3mLbFMj/oco/P2yTco7yU6Wo0L916G0/fdPVC2cfeqx8c+zik/5 T0Xb1ns39R7126HEUpyRaKjFXFScCABFXHtZOgIAAA== 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 Cc: Bryan Wu Cc: Richard Purdie Acked-by: Sakari Ailus --- 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);