From patchwork Thu Jul 22 09:06:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 483870 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp174532jao; Thu, 22 Jul 2021 02:07:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJysHdNyNVnPtgD0wl1N39xNQ3gK2J8JwsL6jOBP/SrKiKHiB9ntZxznzKFgli6MO4ibiXp+ X-Received: by 2002:aa7:c808:: with SMTP id a8mr53906197edt.245.1626944843856; Thu, 22 Jul 2021 02:07:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626944843; cv=none; d=google.com; s=arc-20160816; b=z4/KuvkMlM6fvVCB+pU8s4Pf9vifc66B6HttlIRbaC2NePMNqaABSCYhFVR3/AHMMV Y//9LCEh2YjPqZVFLg9aSeCAMWBJEq7zKYIptjDWiTUeBsFq4XXxUz4b/iHollpketfg vw9bqRJ9cYH9xAl9ZJpaP6v//JEpWKngtA29YnzEick0xbl9G6aMXA9j27iFhB2chj5S nkXQ6ryUODYPH71XKS/e2xEBAAXJxrFrpH8+cLZchdZxJuoqEjOD6FS4+Ncu5l273aPc KG4d9O0PW+/vbxRp3DGtKLO1xiYr5zt58z07XGSCWh7LksAjJYTyOtOGgGYeZrYsSUjZ mWxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=Fx5t9QU8PXU9z8gEhHfizQsf5RaqNhovfufzrOCt+sA=; b=IB1IL161nwZH70QgHecOz+ZRHaxkre2jP+ERmzfqAOTDSx8poKzKiFyWzKTVvWHIig ZyftwSFAkHkH/fMOa3srrnm+8ScuTGc7zmcau2tZu2eEbmEpqg5bRLhqjxIKQrfqe3Us 8pfOIq/VyF+G/nVxTjSdzt26F8WIorPbkvl+c4MazcYnE5Lk7qpw35afr8IWNmXpLoOe tBonaQZBuuaE0b8IJeda3Ddlw85OjhYBdgz8w0haujc8Tk/vMc5JWIjs+CDTJHWzL9V9 UYYbGBZUzwItsh2zgMtoBFqgdsqOa3ivBwc1PFOGp17mbX+Huig+41H7UNhWuR5cWzY4 csyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="KQeV/yh9"; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d10si5295421ejr.696.2021.07.22.02.07.23; Thu, 22 Jul 2021 02:07:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-pm-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=@kernel.org header.s=k20201202 header.b="KQeV/yh9"; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231237AbhGVI0r (ORCPT + 8 others); Thu, 22 Jul 2021 04:26:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:60408 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230419AbhGVI0r (ORCPT ); Thu, 22 Jul 2021 04:26:47 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3EC9B610F7; Thu, 22 Jul 2021 09:07:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1626944842; bh=G6uggNtHBw06DrLEyrx3+EPLEQiuV1JfBOJ1R+sWWJ8=; h=From:To:Cc:Subject:Date:From; b=KQeV/yh9kA3Pd9NOV0uvBntromN90sb9aiaaPGvLkaYVfUNU7O8bsgBgmvO/GMaao LFhN0mq06HHJtG4ZO2HKrb9Y35Kf+x8VSCBty7LmZAqDvWlAN+01q6+P9hsjnc/pS5 Pq3wCiWrVQU+WsT+gJQa+4fqc6bRKBuB/W6E6fP4MRcNNHIFPUEGqMjbyX03kniPRw HJqqoQZI6u1tjkjzwkx6c9yl/xRlmtD7bGpzoZYgJjaL2KuqMcAP4T7YW/T7wyRzf8 c1CeIPgNxz3WG9CfzPamEggWU3i9gd4RVaDmSPm20nO0AkFK7eBPZkDXhbFe8dLMsB LGD0yeHyDmw0g== From: Arnd Bergmann To: Zhang Rui , Daniel Lezcano , Matthias Brugger , Jean-Francois Dagenais Cc: Arnd Bergmann , Amit Kucheria , Lukasz Luba , Thara Gopinath , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH] thermal: fix thermal_cooling_device_register() prototype Date: Thu, 22 Jul 2021 11:06:44 +0200 Message-Id: <20210722090717.1116748-1-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org From: Arnd Bergmann There are two pairs of declarations for thermal_cooling_device_register() and thermal_of_cooling_device_register(), and only one set was changed in a recent patch, so the other one now causes a compile-time warning: drivers/net/wireless/mediatek/mt76/mt7915/init.c: In function 'mt7915_thermal_init': drivers/net/wireless/mediatek/mt76/mt7915/init.c:134:48: error: passing argument 1 of 'thermal_cooling_device_register' discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers] 134 | cdev = thermal_cooling_device_register(wiphy_name(wiphy), phy, | ^~~~~~~~~~~~~~~~~ In file included from drivers/net/wireless/mediatek/mt76/mt7915/init.c:7: include/linux/thermal.h:407:39: note: expected 'char *' but argument is of type 'const char *' 407 | thermal_cooling_device_register(char *type, void *devdata, | ~~~~~~^~~~ Change the dummy helper functions to have the same arguments as the normal version. Fixes: f991de53a8ab ("thermal: make device_register's type argument const") Signed-off-by: Arnd Bergmann --- include/linux/thermal.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- 2.29.2 Reviewed-by: Jean-Francois Dagenais diff --git a/include/linux/thermal.h b/include/linux/thermal.h index d296f3b88fb9..8050d929a5b4 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h @@ -404,12 +404,13 @@ static inline void thermal_zone_device_unregister( struct thermal_zone_device *tz) { } static inline struct thermal_cooling_device * -thermal_cooling_device_register(char *type, void *devdata, +thermal_cooling_device_register(const char *type, void *devdata, const struct thermal_cooling_device_ops *ops) { return ERR_PTR(-ENODEV); } static inline struct thermal_cooling_device * thermal_of_cooling_device_register(struct device_node *np, - char *type, void *devdata, const struct thermal_cooling_device_ops *ops) + const char *type, void *devdata, + const struct thermal_cooling_device_ops *ops) { return ERR_PTR(-ENODEV); } static inline struct thermal_cooling_device * devm_thermal_of_cooling_device_register(struct device *dev,