From patchwork Tue Aug 20 01:26:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 821209 Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7ADCB33FD for ; Tue, 20 Aug 2024 01:26:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724117186; cv=none; b=kWHXD2DO+dkaR4PGuPiHZyz405zsUf7DLzTu3v36xLKDXyS0Arub4lBRiG7BlILcMDsS0QuCOvirCnsSK7jRtJ9Ct+3CQe17QmvuQm5KQdeTYZbdXeDIUv5vGlrYDl10q6anEGm0N2/WO0G3VzHG+HqSQBQEp21yhPkh5R9iwTA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724117186; c=relaxed/simple; bh=9pvnGxhDwHg/alX2fleUrRu/Znfdb5+ztqmuhkoNCJE=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=aTm/vpzzyePig6g36f7dI3q/2fAZH502bgNuUkegAwDs7J++ZokA2i9L0d8dGdW6XdVON/gDnjNfF4Hm8udpb1X1+G7LhAO5teakCnMtbJXZwifqviyysuDEbBngwlcbSlArJ54hcCwzhh85zBu+GGst032NF1tV7XLGZA0mfXg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=MtmnZqfz; arc=none smtp.client-ip=209.85.216.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MtmnZqfz" Received: by mail-pj1-f50.google.com with SMTP id 98e67ed59e1d1-2d42c59df79so388585a91.1 for ; Mon, 19 Aug 2024 18:26:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724117183; x=1724721983; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=G6ZWR4wFNq/RfK4gRHcyv4MECArx/MA9NIEmfmRX6sU=; b=MtmnZqfzBK5PouzrEika8dvW6/9IZCc54Ky4w/cTnpdd1lAvpgwbXn6ydFkr/KqjeI 8xx8sdSDQ1tixMgjcx3keGRQ6f9YhiEQeRV/6zNWALJGUzj4IwSRWZ854sexMgMhTv2+ BaYrAZETpdKaIhsDMH/wlAh3vwgnF5rAgbkTmyRcfkR7Sf0ue4POJmkraALVYALdysB2 BA2WL30JREcQ1Vg3x+dOVg+gNOXdG9qIHcORNj1rzJc5wcUWFdFFP28lGC4BLH00KAkS wrXVmhKosNVRj5vbGVj1hkgc+YYjQww9DOF+nRBQjgydQo3CnAnIClWmgRzQhT/4X34r Lkug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724117183; x=1724721983; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=G6ZWR4wFNq/RfK4gRHcyv4MECArx/MA9NIEmfmRX6sU=; b=S/vxpI7FCD4BbGcb/vCnQj5lrIupbCBcK6DfiRPikYcp0oq/TOAwydCmvITOabAV+W 3ZiRLvIkU+lHvCZF1YREHVWhkj3qCPcgKypudGL2w4mwO5EYK9hCistEVRE5xKSNHkEL BjwFyDL9yxnZHk9nsJFz4qR/4YwTYN5XdPg/Dla7xzMXveWo9jpur1uqk3DvZ4/jGpia zA8Jb5cszjQgMxsYfEynB1PPHoW+7VS6A8uszsnnQvW7uXx4Z7/74lZC+rTJJ24pTRH3 kVnFuvsOauYFpiswbEwMRi6rNrfBPQei3pAVu9nbZtiqcqjCFPQBMBKcMWlxrOjRCVR+ aTXw== X-Forwarded-Encrypted: i=1; AJvYcCWZi99hUotMjn2/qPfhyp+JIGtxC8zddeqInVPIuKuitR5QlYCWsqtcNJD9oDElu1gJHvAKEot1yw==@vger.kernel.org X-Gm-Message-State: AOJu0Yw+NQTDMYshR/SfNqLXRwIqAE6OAI1EdHlfsm/gPxKcb3S9gskZ +Evaa/QMtHkTuR4PAcixX2K8JtUkwtJtAR0h7P7cSialSSglROfjmZWWMw== X-Google-Smtp-Source: AGHT+IEjUdts40sclSfjPfJOEkVtItfKT7t25KUQuu8yMeX2fIFHd1In5msG49QPFhsMO5etFOyUtg== X-Received: by 2002:a17:902:ea07:b0:202:2af7:b50b with SMTP id d9443c01a7336-2022af7b661mr55888585ad.5.1724117182693; Mon, 19 Aug 2024 18:26:22 -0700 (PDT) Received: from fabio-Precision-3551.. ([2804:14c:485:4b61:9187:7fc0:77bb:926e]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-202405921e6sm23193785ad.265.2024.08.19.18.26.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Aug 2024 18:26:22 -0700 (PDT) From: Fabio Estevam To: daniel.lezcano@linaro.org Cc: rafael@kernel.org, linux-pm@vger.kernel.org, Fabio Estevam Subject: [PATCH v2 1/2] thermal: qoriq: Remove __maybe_unused notations Date: Mon, 19 Aug 2024 22:26:15 -0300 Message-Id: <20240820012616.1449210-1-festevam@gmail.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Fabio Estevam The combined usage of pm_sleep_ptr() and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to evaluate if the suspend/resume() functions are used at build time or are simply dead code. This allows removing __maybe_unused notations from the suspend/resume() functions. Signed-off-by: Fabio Estevam --- Changes since v1: - Use DEFINE_SIMPLE_DEV_PM_OPS() to fix build warnings. drivers/thermal/qoriq_thermal.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/thermal/qoriq_thermal.c b/drivers/thermal/qoriq_thermal.c index 404f01cca4da..52e26be8c53d 100644 --- a/drivers/thermal/qoriq_thermal.c +++ b/drivers/thermal/qoriq_thermal.c @@ -347,7 +347,7 @@ static int qoriq_tmu_probe(struct platform_device *pdev) return 0; } -static int __maybe_unused qoriq_tmu_suspend(struct device *dev) +static int qoriq_tmu_suspend(struct device *dev) { struct qoriq_tmu_data *data = dev_get_drvdata(dev); int ret; @@ -361,7 +361,7 @@ static int __maybe_unused qoriq_tmu_suspend(struct device *dev) return 0; } -static int __maybe_unused qoriq_tmu_resume(struct device *dev) +static int qoriq_tmu_resume(struct device *dev) { int ret; struct qoriq_tmu_data *data = dev_get_drvdata(dev); @@ -374,8 +374,8 @@ static int __maybe_unused qoriq_tmu_resume(struct device *dev) return regmap_update_bits(data->regmap, REGS_TMR, TMR_ME, TMR_ME); } -static SIMPLE_DEV_PM_OPS(qoriq_tmu_pm_ops, - qoriq_tmu_suspend, qoriq_tmu_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(qoriq_tmu_pm_ops, + qoriq_tmu_suspend, qoriq_tmu_resume); static const struct of_device_id qoriq_tmu_match[] = { { .compatible = "fsl,qoriq-tmu", }, @@ -387,7 +387,7 @@ MODULE_DEVICE_TABLE(of, qoriq_tmu_match); static struct platform_driver qoriq_tmu = { .driver = { .name = "qoriq_thermal", - .pm = &qoriq_tmu_pm_ops, + .pm = pm_sleep_ptr(&qoriq_tmu_pm_ops), .of_match_table = qoriq_tmu_match, }, .probe = qoriq_tmu_probe, From patchwork Tue Aug 20 01:26:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 820856 Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 21620B657 for ; Tue, 20 Aug 2024 01:26:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724117187; cv=none; b=JqAaaiJyrLhDz/eqqr/WEEjieTygjc4LWhIJ1R+Sga2Zj3UeHAGtuVEkLhLTmfU5f32bnvu4oJxH4UoiQgTv81BocOA3NhyLuFlmIvaow0Hcrvgdh5QWu7+bfEu5wjXlRjzgCeTZw59AsAKT7To954yligh2XhEg/dSGktZLe5E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724117187; c=relaxed/simple; bh=n0ox3inuNJY4PcPhDinLaTHitqCQE4xQYSQhy2E/Ayc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Gpbmg9e3T79QMGBi5OA6PnMYkbaQjzx8V8OFjpwl8Xj+oiMrO0l2+oi+qGIs5tAjUauCDWsUUQ/RN25tOL0gx1ok8Jt2oiMWBa5K/BYJ3KdZcJwMT2PLitbUn5fpLTWMPnxH5A4gd3bTi0RZOCXsn30roSId+8xvR5Q9XdmskxY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=aAGtY0Um; arc=none smtp.client-ip=209.85.214.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="aAGtY0Um" Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-201e2fe323aso2776785ad.2 for ; Mon, 19 Aug 2024 18:26:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724117185; x=1724721985; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ayKww0j5FdJl6Q5VnO6Xfpm8usKnNXSqgVhAkZT6vlQ=; b=aAGtY0UmGc3C6epFVlpfgj3J9QWj7YkN6WTWc2yQ0Dz9Sxtsut7KA6VtFzyco1R4Jx OXKlvBDRnSApiLWHfTiSAK8AQaxvaLkDURVNAjFJGx7TQEZX+BdB2xWhKYnCpq5ZaAu2 l1ToDK+aDbDvFN09ElrvBLxHvHJPSg+6NBrvs3KxS9M08FiiHJy6kUDBITmLRURUGO3T x12pM9bEG0SFx2ZL5H4/Y9CAj7q8Noyx7/MxXV8pK4stG78rqBdbnL7ec3vr25zlEg/d sPSRmVABrBF7OAHk8jQxzodGxzMNqLwNaf1TG3RZZxP+Xqs0hvTaUR24vOWt96kjLVUy d8og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724117185; x=1724721985; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ayKww0j5FdJl6Q5VnO6Xfpm8usKnNXSqgVhAkZT6vlQ=; b=E4qHNkwPfapIwedQ8F5G5mYjxZggNtuCf5BMQFUsuCKww5toywE71qpXkMNt8NCkEM HOtVYeylvkEgafVM6uzGqOF6ncGJT3w0M79gINDN0VDlb103+sl9ew+6fXt2zsOfidTH RQOwPRqvw4D28xf1JjMQZteIrXckZLnXQ7+ixzbtzHpULM0N/uj2OkRhWbZB3FhpxQI7 bukey+YjmQp30adxm1boay0cwWtiNeYtMYOzK5Vr/QNiYv3kzlUdBBngB8h9apZutvLO 61VKXfUMcFTZHOyWEoEFFCNuptY1r5tedQi195NXemg5PKwaZSacIL49v12SwSG7Hob5 NY+A== X-Forwarded-Encrypted: i=1; AJvYcCWs8/+4AGv7honFJi43ohaXrQ5F0zM257bj1vMciJe0Pla/ULOrcuWkYvsP+a+uswz1FaOC8mm8SfU8K8vDTCRRFb16+MavIjo= X-Gm-Message-State: AOJu0Ywv8TsMY77z1iAxRzIvEwtxmTI/pbt2qUw7K2FgkhtiTzNFFbwc kl0ko11dAgLtGSzdsh+9casa+/Olkc4X+pOD6z2LgeL9Mbpq4JJA X-Google-Smtp-Source: AGHT+IGZq5FxLK2SRjoF4/bHuJHPHUkFxYTDo4gjtSTg1VWULJAOET1/ZAHgIawRZMptvNH19POjtQ== X-Received: by 2002:a17:902:c406:b0:1fb:1ae6:6aa7 with SMTP id d9443c01a7336-202060c4774mr91705755ad.3.1724117185241; Mon, 19 Aug 2024 18:26:25 -0700 (PDT) Received: from fabio-Precision-3551.. ([2804:14c:485:4b61:9187:7fc0:77bb:926e]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-202405921e6sm23193785ad.265.2024.08.19.18.26.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Aug 2024 18:26:24 -0700 (PDT) From: Fabio Estevam To: daniel.lezcano@linaro.org Cc: rafael@kernel.org, linux-pm@vger.kernel.org, Fabio Estevam Subject: [PATCH v2 2/2] thermal: imx: Remove __maybe_unused notations Date: Mon, 19 Aug 2024 22:26:16 -0300 Message-Id: <20240820012616.1449210-2-festevam@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240820012616.1449210-1-festevam@gmail.com> References: <20240820012616.1449210-1-festevam@gmail.com> Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Fabio Estevam Replace SET_RUNTIME_PM_OPS()/SET SYSTEM_SLEEP_PM_OPS() with their modern RUNTIME_PM_OPS() and SYSTEM_SLEEP_PM_OPS() alternatives. The combined usage of pm_ptr() and RUNTIME_PM_OPS/SYSTEM_SLEEP_PM_OPS() allows the compiler to evaluate if the runtime suspend/resume() functions are used at build time or are simply dead code. This allows removing __maybe_unused notations from the suspend/resume() functions. Signed-off-by: Fabio Estevam --- Changes since v1: - None. drivers/thermal/imx_thermal.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c index 091fb30dedf3..495ff2eeb0a1 100644 --- a/drivers/thermal/imx_thermal.c +++ b/drivers/thermal/imx_thermal.c @@ -773,7 +773,7 @@ static void imx_thermal_remove(struct platform_device *pdev) imx_thermal_unregister_legacy_cooling(data); } -static int __maybe_unused imx_thermal_suspend(struct device *dev) +static int imx_thermal_suspend(struct device *dev) { struct imx_thermal_data *data = dev_get_drvdata(dev); int ret; @@ -792,7 +792,7 @@ static int __maybe_unused imx_thermal_suspend(struct device *dev) return pm_runtime_force_suspend(data->dev); } -static int __maybe_unused imx_thermal_resume(struct device *dev) +static int imx_thermal_resume(struct device *dev) { struct imx_thermal_data *data = dev_get_drvdata(dev); int ret; @@ -804,7 +804,7 @@ static int __maybe_unused imx_thermal_resume(struct device *dev) return thermal_zone_device_enable(data->tz); } -static int __maybe_unused imx_thermal_runtime_suspend(struct device *dev) +static int imx_thermal_runtime_suspend(struct device *dev) { struct imx_thermal_data *data = dev_get_drvdata(dev); const struct thermal_soc_data *socdata = data->socdata; @@ -826,7 +826,7 @@ static int __maybe_unused imx_thermal_runtime_suspend(struct device *dev) return 0; } -static int __maybe_unused imx_thermal_runtime_resume(struct device *dev) +static int imx_thermal_runtime_resume(struct device *dev) { struct imx_thermal_data *data = dev_get_drvdata(dev); const struct thermal_soc_data *socdata = data->socdata; @@ -857,15 +857,15 @@ static int __maybe_unused imx_thermal_runtime_resume(struct device *dev) } static const struct dev_pm_ops imx_thermal_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(imx_thermal_suspend, imx_thermal_resume) - SET_RUNTIME_PM_OPS(imx_thermal_runtime_suspend, - imx_thermal_runtime_resume, NULL) + SYSTEM_SLEEP_PM_OPS(imx_thermal_suspend, imx_thermal_resume) + RUNTIME_PM_OPS(imx_thermal_runtime_suspend, + imx_thermal_runtime_resume, NULL) }; static struct platform_driver imx_thermal = { .driver = { .name = "imx_thermal", - .pm = &imx_thermal_pm_ops, + .pm = pm_ptr(&imx_thermal_pm_ops), .of_match_table = of_imx_thermal_match, }, .probe = imx_thermal_probe,