Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1793222ybb; Thu, 2 Apr 2020 07:29:30 -0700 (PDT) X-Google-Smtp-Source: APiQypLESBsgonN0txA6rYlYl23WuqWiWNFfFJArzxVaxbib4b0QaxlhoUAXJ5bK2CNLO0tn4kh2 X-Received: by 2002:a4a:c315:: with SMTP id c21mr2951495ooq.13.1585837769937; Thu, 02 Apr 2020 07:29:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585837769; cv=none; d=google.com; s=arc-20160816; b=Z9yLeZRueFckq6XngQOZs3QJhbSyBT85SnuiNljqGCpxnj86mcCDaZZDbS30Kce2ls UFk8OrsoVaYPGJNH/kYU5Lv3Ux8vjWZTNS18bEfJljBheOEQpbRSRptGLdITSJRWzZGf DBwcJnJqNgKs5+ZbZlKiwRYmZGNxuoN/T5AfekWey7fMhEL6IYHPK2cI5Yr37RFprUwY FX3m04sTDilwR9phYiVEE1kFGseUz84mO8/i0HkYeKzJX7s0qAHVE4v04H9qfI3R8v1k q1VsRElVOx5+VGBhUExopxa54biBL1KcjwI7Zfvn/4sKi/kjGVpL4qZKqALqmOeexu6B 9icw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=+cHrwJ2Hn5m/Qb3jLfMLFnnm5DKsUGWGJFUk2Y++pX0=; b=DzHOdf+2gKLlDgUVvSWc4/PXFRtKfHV0F17kawyb44ON6tJhBUlroT3HQuXnN7VBxE QRg796/ykGlba2tlkLyC05/U9wpCcAZZLGGs4YsQi5fwKPaCaF7eawONiJMeYdb5AjJA zH8DkAKSOPb177JVCdqAt7VS1rTyLIP0dtVpoyci9HVyGNKI5hrZnHIvpnn+XV/b5qbp iXaBRpiIfmQwlwsUtoFKkREPoI/Cc7UWry6a1tNxzdr+cGcknt2//Lb5rrW9VCtWv1XT Noqz5VWN5rQCKYyFeCrnEexZ4KzJGgbvqqn8MO0kk/wT2qu9MMuVUTneLXkBTsWX51Ri ST/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pULk7rj3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j15si2495287oos.59.2020.04.02.07.29.16; Thu, 02 Apr 2020 07:29:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pULk7rj3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387680AbgDBO2H (ORCPT + 99 others); Thu, 2 Apr 2020 10:28:07 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:40025 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732474AbgDBO2G (ORCPT ); Thu, 2 Apr 2020 10:28:06 -0400 Received: by mail-wr1-f68.google.com with SMTP id s8so2309638wrt.7 for ; Thu, 02 Apr 2020 07:28:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=+cHrwJ2Hn5m/Qb3jLfMLFnnm5DKsUGWGJFUk2Y++pX0=; b=pULk7rj3GE/OloQs/UlEPA3hGEuRaujr/vzLWqxhalI8dIxY/sAGfzu5hMUOuFI9ZB z4tRJJMehohhlfyAQ0DVR4ZCRGLNrQr96ZLmJZzRaMPudcchNQwbcprKP67fb+GqWtCT RYBayP/aWoVYXea164mZ7/tCnVN45RFj4QK/LSk7uvQAC61NyxrvfTjXUGEiiinRRjXv Ao76MhSv6xU/IXBUwLSFaLHo1wVrnRX+035n+amJubfinxJ9jDv+KwhIKyfWE6v5Hzk6 qrsxJ74FSpgyeE7P48mdwLM3legrLvc0/R23PKlQaDIP8vu0IG4qq3wJEei5++wdJxyc CSjw== 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=+cHrwJ2Hn5m/Qb3jLfMLFnnm5DKsUGWGJFUk2Y++pX0=; b=mTxd0I59iDAEIGQWiEGQrSogXlRU+QfpH0/gKpjtlvSo/ruX4oZtoW+2wtiZB73sqT JrdH+tqyxJ2Y7qYx3Adb7EZGrcNTnIlPe0byNKF3SUhAbu6OhsaTaC31dHGRNxjVsARD NTrggUs4M9gwZGdeVn7HZYhVy+t3KSQfBd2aHu82PxPf7cjtBMgC6bDfqC7Ic0JQ9ggq JvGp1NidwG8PqFMha4gR7vcY0Zmt0Fs4Azi3sK++ErHxFfTCzJvxhdTfHvJEwE22rfUG RAjbWzJA6SM3NaQRCmLmc4qNdzOQN+zWqhe4qBEgXZa912O1q6UxFx38HOAKBjMVUUgo umIg== X-Gm-Message-State: AGi0PuZ1qR2FMTtdB8W912hdA/OYo26h27NY2HXXRgjVuCAWQLV3pglq 35YBMrpVxoprRjI1Q6xp6tV0CQ== X-Received: by 2002:adf:b6a9:: with SMTP id j41mr1387106wre.70.1585837684482; Thu, 02 Apr 2020 07:28:04 -0700 (PDT) Received: from mai.imgcgcw.net ([2a01:e34:ed2f:f020:4b2:e366:e86f:261a]) by smtp.gmail.com with ESMTPSA id a7sm7045186wmm.34.2020.04.02.07.28.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Apr 2020 07:28:03 -0700 (PDT) From: Daniel Lezcano To: daniel.lezcano@linaro.org, rui.zhang@intel.com Cc: amit.kucheria@verdurent.com, linux-pm@vger.kernel.org (open list:THERMAL), linux-kernel@vger.kernel.org (open list) Subject: [PATCH V2 3/9] thermal: Move internal IPA functions Date: Thu, 2 Apr 2020 16:27:41 +0200 Message-Id: <20200402142747.8307-3-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200402142747.8307-1-daniel.lezcano@linaro.org> References: <20200402142747.8307-1-daniel.lezcano@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The exported IPA functions are used by the IPA. It is pointless to declare the functions in the thermal.h file. For better self-encapsulation and less impact for the compilation if a change is made on it. Move the code in the thermal core internal header file. As the users depends on THERMAL then it is pointless to have the stub, remove them. Take also the opportunity to fix checkpatch warnings/errors when moving the code around. Signed-off-by: Daniel Lezcano --- drivers/thermal/thermal_core.h | 13 +++++++++++++ include/linux/thermal.h | 24 ------------------------ 2 files changed, 13 insertions(+), 24 deletions(-) diff --git a/drivers/thermal/thermal_core.h b/drivers/thermal/thermal_core.h index 5d08ad60d9df..f99551ce9838 100644 --- a/drivers/thermal/thermal_core.h +++ b/drivers/thermal/thermal_core.h @@ -46,6 +46,19 @@ struct thermal_attr { char name[THERMAL_NAME_LENGTH]; }; +static inline bool cdev_is_power_actor(struct thermal_cooling_device *cdev) +{ + return cdev->ops->get_requested_power && cdev->ops->state2power && + cdev->ops->power2state; +} + +int power_actor_get_max_power(struct thermal_cooling_device *cdev, + struct thermal_zone_device *tz, u32 *max_power); +int power_actor_get_min_power(struct thermal_cooling_device *cdev, + struct thermal_zone_device *tz, u32 *min_power); +int power_actor_set_power(struct thermal_cooling_device *cdev, + struct thermal_instance *ti, u32 power); + /* * This structure is used to describe the behavior of * a certain cooling device on a certain trip point diff --git a/include/linux/thermal.h b/include/linux/thermal.h index 5aa80fb2fb61..e0279f7b43f4 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h @@ -399,18 +399,6 @@ void devm_thermal_zone_of_sensor_unregister(struct device *dev, #endif #if IS_ENABLED(CONFIG_THERMAL) -static inline bool cdev_is_power_actor(struct thermal_cooling_device *cdev) -{ - return cdev->ops->get_requested_power && cdev->ops->state2power && - cdev->ops->power2state; -} - -int power_actor_get_max_power(struct thermal_cooling_device *, - struct thermal_zone_device *tz, u32 *max_power); -int power_actor_get_min_power(struct thermal_cooling_device *, - struct thermal_zone_device *tz, u32 *min_power); -int power_actor_set_power(struct thermal_cooling_device *, - struct thermal_instance *, u32); struct thermal_zone_device *thermal_zone_device_register(const char *, int, int, void *, struct thermal_zone_device_ops *, struct thermal_zone_params *, int, int); @@ -447,18 +435,6 @@ struct thermal_instance *get_thermal_instance(struct thermal_zone_device *, void thermal_cdev_update(struct thermal_cooling_device *); void thermal_notify_framework(struct thermal_zone_device *, int); #else -static inline bool cdev_is_power_actor(struct thermal_cooling_device *cdev) -{ return false; } -static inline int power_actor_get_max_power(struct thermal_cooling_device *cdev, - struct thermal_zone_device *tz, u32 *max_power) -{ return 0; } -static inline int power_actor_get_min_power(struct thermal_cooling_device *cdev, - struct thermal_zone_device *tz, - u32 *min_power) -{ return -ENODEV; } -static inline int power_actor_set_power(struct thermal_cooling_device *cdev, - struct thermal_instance *tz, u32 power) -{ return 0; } static inline struct thermal_zone_device *thermal_zone_device_register( const char *type, int trips, int mask, void *devdata, struct thermal_zone_device_ops *ops, -- 2.17.1