Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4685906pxu; Thu, 10 Dec 2020 03:01:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJzKQGiQewiCTr97baWQtqUqHgtxmJXwjailrQ3+qFEn6Rub+L+rSh+AwoUOyoktRd5kBuQh X-Received: by 2002:a50:9354:: with SMTP id n20mr6312446eda.231.1607598106862; Thu, 10 Dec 2020 03:01:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607598106; cv=none; d=google.com; s=arc-20160816; b=RHRHUPxShxGwUvxKFKps6Ivl+HhhsT6hgQaxmDRbQczWvKF1DAamlVOfzIYwlJ+wcj Ru+57g0CO2//6jLDZddwS6zdA8JvkfBlElbvlyLf9mPuQ3lB3pR0VvD8PxRdkpEP6JZc XLqpH3WBjjGzc7g6UySUMbb4ZjQwbW13uIHATWjyFnObgGriltQYPd769YUM62oaQWcf cQPyA2St24KwSZqH/njx8eGNPqbk/eR+hABDn23WMtH4vps+n6QqJCj8bvtRhrvPhO7P sJq3VnE4uivagG1Vmx8kQvxNzvPXOnXSU7a6WPmzO4LXtMuMBrstsQbUgqoT31k6XMsb dXhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=p0JP7C0xlsVyWNi+wA1zhFtAvLDEH/NgpOed0jz9w0E=; b=qgyq7sKTB+IkX8eC7ffNEf9QnMEunFcWcNLOQnYOMl+btSl7W7vEkjL5AMYSpk7iu6 z22opXyJZDAdNFjLop/8bDnE6sspFImzpHoDRMWaBXabpEtSXFWKHMwXkCxMaukWSFDn /kaId2rXiKms+QO+96DkCXHzXu4l34CDEWU+wLhGEwXGjScUSj45kkxgBqwYpRCvp2kx NEaqhOkZIhF7b640LO/YBGSjdqNZesC6E4k7f2DveQZiFu393IEtRZHcujgJ33we1v6m MsPpSGi/f+sGvT0A2x52GN7u2Z5b1x9KtvjF7LMNvTcLlKSIJlV7FUdqme8jJsaJu1NU afsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="cR/JxMMu"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k11si2431906edq.414.2020.12.10.03.01.23; Thu, 10 Dec 2020 03:01:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="cR/JxMMu"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732933AbgLJGEQ (ORCPT + 99 others); Thu, 10 Dec 2020 01:04:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732896AbgLJGCb (ORCPT ); Thu, 10 Dec 2020 01:02:31 -0500 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1BCAC0613CF; Wed, 9 Dec 2020 22:01:50 -0800 (PST) Received: by mail-pg1-x544.google.com with SMTP id c12so2727085pgm.4; Wed, 09 Dec 2020 22:01:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=p0JP7C0xlsVyWNi+wA1zhFtAvLDEH/NgpOed0jz9w0E=; b=cR/JxMMuhbeJcPwCkqBgdDyFnrMKBa0+fG4l1D6nKLGXwLAnP/YUpXmHxiIae+9R2t F1naM+jlFHUjf4rvun+WO8r12gxABYEgjSKOH6/H/xqpQO3UsemB/PoRUCV8ili5gERt v00GhE1kgrIOmro4IduGfAbyBWAZJK+ZGemOvq43Q/JjMk6QOY/t2bQEqfrv62Li8mPC yeT3vjfgJxqM5xa2b3UIu3jEMfYVqN4dMcCaULpup1wHMlrjOugyGvOus8Eev58uKSfP RfIzQdCf83TBs4S0Nlz8qQEwqZ14ZuGzEghp70JJl03vBiPkRyz2RnAWlNiLqW/7SVdt r/wA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=p0JP7C0xlsVyWNi+wA1zhFtAvLDEH/NgpOed0jz9w0E=; b=b5ASbcV/LguwzPF9LBI+N2ZdhvIsHR8OJo4dHntZunwBMueHxgd6rP2JmedNATpIik wbo1ht84pnGKyjERoYTk2w1AQUse9W/tl4mBP3Hnmn3J6bnw31NoPS6P4dLotfx61f0h vlNIxDDAC4+lEMvsnp2/R6c8PGO4BQ7EKsr87FW0ouUvtu9RpAY9NPydb+JSUT31P5mZ nZX264i7z/1TPjVBdEOo0MYO9C+bJOnLbK/PJcVUmmj6bS6RDl1RdqAir4Gzw7NqvK2W +8SjM/vpfN6RcdSSj6n08rqhBM6ZUfoip96um49Rnk66PgWBL1zk8a0bggyOYxr3oB17 YiBg== X-Gm-Message-State: AOAM533qwHDpsvk9FFv5FY4efq6zdsrpnWq1w2auQAqISH/4oCGgZ5ES Cjjecg0Q0vjySaOKP3+nM6A= X-Received: by 2002:aa7:9af4:0:b029:19d:975a:3ef2 with SMTP id y20-20020aa79af40000b029019d975a3ef2mr5228990pfp.5.1607580110404; Wed, 09 Dec 2020 22:01:50 -0800 (PST) Received: from localhost.localdomain ([2402:7500:568:b3ad:229b:9ee7:b946:7876]) by smtp.gmail.com with ESMTPSA id j19sm4355377pff.74.2020.12.09.22.01.45 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Dec 2020 22:01:49 -0800 (PST) From: Gene Chen To: jacek.anaszewski@gmail.com, pavel@ucw.cz, robh+dt@kernel.org, matthias.bgg@gmail.com Cc: dmurphy@ti.com, linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, gene_chen@richtek.com, Wilma.Wu@mediatek.com, shufan_lee@richtek.com, cy_huang@richtek.com, benjamin.chao@mediatek.com Subject: [PATCH v12 2/5] leds: flash: Fix multicolor no-ops registration by return 0 Date: Thu, 10 Dec 2020 14:00:54 +0800 Message-Id: <1607580057-4408-3-git-send-email-gene.chen.richtek@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1607580057-4408-1-git-send-email-gene.chen.richtek@gmail.com> References: <1607580057-4408-1-git-send-email-gene.chen.richtek@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Gene Chen Fix multicolor no-ops registration by return 0, and move the same registration functions outside of #ifdef block. Signed-off-by: Gene Chen Acked-by: Jacek Anaszewski --- include/linux/led-class-multicolor.h | 42 +++++++++++++----------------------- 1 file changed, 15 insertions(+), 27 deletions(-) diff --git a/include/linux/led-class-multicolor.h b/include/linux/led-class-multicolor.h index 5116f9a..210d57b 100644 --- a/include/linux/led-class-multicolor.h +++ b/include/linux/led-class-multicolor.h @@ -44,12 +44,6 @@ int led_classdev_multicolor_register_ext(struct device *parent, struct led_classdev_mc *mcled_cdev, struct led_init_data *init_data); -static inline int led_classdev_multicolor_register(struct device *parent, - struct led_classdev_mc *mcled_cdev) -{ - return led_classdev_multicolor_register_ext(parent, mcled_cdev, NULL); -} - /** * led_classdev_multicolor_unregister - unregisters an object of led_classdev * class with support for multicolor LEDs @@ -68,13 +62,6 @@ int devm_led_classdev_multicolor_register_ext(struct device *parent, struct led_classdev_mc *mcled_cdev, struct led_init_data *init_data); -static inline int devm_led_classdev_multicolor_register(struct device *parent, - struct led_classdev_mc *mcled_cdev) -{ - return devm_led_classdev_multicolor_register_ext(parent, mcled_cdev, - NULL); -} - void devm_led_classdev_multicolor_unregister(struct device *parent, struct led_classdev_mc *mcled_cdev); #else @@ -83,27 +70,33 @@ static inline int led_classdev_multicolor_register_ext(struct device *parent, struct led_classdev_mc *mcled_cdev, struct led_init_data *init_data) { - return -EINVAL; -} - -static inline int led_classdev_multicolor_register(struct device *parent, - struct led_classdev_mc *mcled_cdev) -{ - return led_classdev_multicolor_register_ext(parent, mcled_cdev, NULL); + return 0; } static inline void led_classdev_multicolor_unregister(struct led_classdev_mc *mcled_cdev) {}; static inline int led_mc_calc_color_components(struct led_classdev_mc *mcled_cdev, enum led_brightness brightness) { - return -EINVAL; + return 0; } static inline int devm_led_classdev_multicolor_register_ext(struct device *parent, struct led_classdev_mc *mcled_cdev, struct led_init_data *init_data) { - return -EINVAL; + return 0; +} + +static inline void devm_led_classdev_multicolor_unregister(struct device *parent, + struct led_classdev_mc *mcled_cdev) +{}; + +#endif /* IS_ENABLED(CONFIG_LEDS_CLASS_MULTICOLOR) */ + +static inline int led_classdev_multicolor_register(struct device *parent, + struct led_classdev_mc *mcled_cdev) +{ + return led_classdev_multicolor_register_ext(parent, mcled_cdev, NULL); } static inline int devm_led_classdev_multicolor_register(struct device *parent, @@ -113,9 +106,4 @@ static inline int devm_led_classdev_multicolor_register(struct device *parent, NULL); } -static inline void devm_led_classdev_multicolor_unregister(struct device *parent, - struct led_classdev_mc *mcled_cdev) -{}; - -#endif /* IS_ENABLED(CONFIG_LEDS_CLASS_MULTICOLOR) */ #endif /* _LINUX_MULTICOLOR_LEDS_H_INCLUDED */ -- 2.7.4