From patchwork Mon Aug 19 14:26:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 13768438 Received: from mail-oa1-f41.google.com (mail-oa1-f41.google.com [209.85.160.41]) (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 37C4416CD07 for ; Mon, 19 Aug 2024 14:27:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724077632; cv=none; b=kIt6mTDtiOtXGhMWQ5GXp2s1uELKIaPVLZeWgMwPyvhXDASsuEYKvcAanpOpM8QvCNBkZ/NEP2H+xXHLcT3J4y21dkg/c9vSox30G61JV1iflnaACSjczgVlU16XP4X7NAtPs2Z2VKO5FsFYanI6wwhKguOO5Izh9E7aF5qjp4E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724077632; c=relaxed/simple; bh=djtggWgq5eB6M4YakigtMYBrLq8szgHMzT53Yv7u5wo=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=GOEFh2lq8Ss4kqtC1SKkJ9flrTHfh9sogsYFuSUE1Q6imqLIDalOaOS9TrvGSFZPUI3+6GbehlV6fUFdVwum90sXDV2L+Z+s9sjxNA76/rTWRQm5v0beQbsPMg8Q9r034097K378vtG29lMZKvBrkB9H6iBaGt0IJQ2+qxBkyqI= 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=Z0FDRGw6; arc=none smtp.client-ip=209.85.160.41 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="Z0FDRGw6" Received: by mail-oa1-f41.google.com with SMTP id 586e51a60fabf-2635abdc742so550034fac.2 for ; Mon, 19 Aug 2024 07:27:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724077630; x=1724682430; 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=8U11yJMCCz9ocZBsA/XDi4Mb91m2fc2Zz9Q1yQzZ3MI=; b=Z0FDRGw6iy/jpnocCVKsO5iLYixFJSy/BflAoG0PFAYT53A2fufUmAiAvks17HOxHI ThP+Q83pTM3haPMTHw931R9SrD6F9lgRvf9SvbkEo0mCO3/BvRAt7dD2sopBcKz1dRW1 8i/vB3MZwLcyuxXsTzqRi4X3DLGIqU1WOqw061CsxM0SLtUH8uGyBQtevYld5nUcsm+M p8EPwf0LQh7G3N0zFXTakjp31T0ei600vNZWyj76jyHRaffWnpL53KxxHEcrNZ91CViB v18Qc9rhmd0vYoERzhwozdLSe10T0egY1TIjBerswpJnQc1+IdiNvlSX2aMHj/n6/sqO rrzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724077630; x=1724682430; 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=8U11yJMCCz9ocZBsA/XDi4Mb91m2fc2Zz9Q1yQzZ3MI=; b=Py1SK1/WG6WJ7XIP44WaNdqz1aFOi9e2X/kw4/zxjm2l7BVnqnFGWUp45GYYMXPQ0G y9ijPUqtyrUu8JxuE5bU0c7lUQzqyCpjpYWYyPlgU+/410iw/351HQy80z9e4GhLQE84 SNvmJSpKuk4VgG2e/VC9FN+i0yZyo8ataZ8V5MBio8aUOgDxlUJMYPCUvLvSCFLGppCR iBj5Nx9laLbbt+r/rElHtUWrUpVGKupH+jOCu1f/eYTniijdqr+Rmhq4gB//gIiSKdWm uuzimkz2JModfafdBYCZ/4upHhu7929x3YpNrXMGPf0dDkbbKp7MGDOwN/efBc9tcGqn j9Rg== X-Forwarded-Encrypted: i=1; AJvYcCVxR4xfvGdnjGxlneareigqOVVkiprKHD9CcDeOoBvj+L8dpKz+xl62MdzD73YGxz2UfaCIE9XZXQ==@vger.kernel.org X-Gm-Message-State: AOJu0YzEl64P6OmL1gbMkFeGjY32LGFApna8WCISEyg2eODUDJf7ePID EKTTYLgaSVfKJ9l2dz4JMAT37Pmv5B0tyBaFETyhIbG7XFrm2cp6 X-Google-Smtp-Source: AGHT+IFpW+QZpwk1NEeiIS3PoT9ZQgiV3SIsF7BZ+UvfOC1sQPfxGHgUnprVKVIhlNsK/npzGfYlzw== X-Received: by 2002:a05:6870:ecaa:b0:260:e5e1:2411 with SMTP id 586e51a60fabf-2701c50f7abmr5697919fac.6.1724077630115; Mon, 19 Aug 2024 07:27:10 -0700 (PDT) Received: from fabio-Precision-3551.. ([2804:14c:485:4b61:9187:7fc0:77bb:926e]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7c6b61c6124sm7610565a12.27.2024.08.19.07.27.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Aug 2024 07:27:09 -0700 (PDT) From: Fabio Estevam To: daniel.lezcano@linaro.org Cc: rafael@kernel.org, linux-pm@vger.kernel.org, Fabio Estevam Subject: [PATCH 1/2] thermal: qoriq: Remove __maybe_unused notations Date: Mon, 19 Aug 2024 11:26:59 -0300 Message-Id: <20240819142700.1206586-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 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 --- drivers/thermal/qoriq_thermal.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/thermal/qoriq_thermal.c b/drivers/thermal/qoriq_thermal.c index 404f01cca4da..4ace3b2a3d30 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); @@ -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 Mon Aug 19 14:27:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 13768439 Received: from mail-il1-f176.google.com (mail-il1-f176.google.com [209.85.166.176]) (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 8285616F0CE for ; Mon, 19 Aug 2024 14:27:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724077635; cv=none; b=XSOIRHfBpbDZKSnpDt1MdCQ0dEZO9ANjOlkHpkYVGZ8hSi4nzqd8es9b7NWgMmR58doM9P8uS1+n493CDZJj8hHP+IuduF4b6ZmZYirgMwPkAdNbCGnh1RE152IF1qonnNsMa1tKp7f2CZuMzyeyLO2ypaMEhU/B44pksm6q+Ck= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724077635; c=relaxed/simple; bh=M60816ytWMrETkM6QM1L+R00UOriHG1lsiQyGY/RYpw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=dRdk1SyY5tnSsEA9NQe5lYNe2kUB/tUqE/7sI8iRerg3juVjFux9EeXtt32GfCN4II7s82Wo7FLUpwy/7KlVWkelo3kBP6GErMNWMBYdRv+9q4C7/SF47P6N2mo1f80TbnFE8dqDwrcy6CaJQYRPpjC5oL+hNeWlEAX1LMC30KE= 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=X6rMFDw+; arc=none smtp.client-ip=209.85.166.176 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="X6rMFDw+" Received: by mail-il1-f176.google.com with SMTP id e9e14a558f8ab-39d32b27f57so879795ab.2 for ; Mon, 19 Aug 2024 07:27:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724077632; x=1724682432; 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=Gr8L2hcQ7Wkw+B5RpS61bkAXN4QsrXdH+Dd+Y4DXHwo=; b=X6rMFDw+zenvQKYBomsse0wMqvgLtQY5RvAC/lf7ZKswTx0wEJJim8aZ86K+gemUBy nWBnqcHaVb0mkAjzjnzPtr9hwZuV2QJ8cDFqsdPwikvAgJKcCI8JXRtyKP6V4wlD+Xq8 TQKg49LjztFbeSJcvpuYqkI6cskToF/q6OX7NHfXmrvrmvJvvx9y0rvThu/8tag+HMGx cDs5mNXj3hUuglikgHRPSM3qV0cpbzumMJRPXYPWJIuDtGOpwM3UswyrWbBDdV7/z+CI X9wYqDaXGAcG/hjiUpT7dNjpRtey9C+WM8A4YP4n+750qDsDQlJ8qpUzdgdjoHE7uSCq IQwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724077632; x=1724682432; 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=Gr8L2hcQ7Wkw+B5RpS61bkAXN4QsrXdH+Dd+Y4DXHwo=; b=uovWgfgQiuNxoCvBDcP+Q9jNDPwviSS2EbWCHDHJhRTpH8r2lh30nwWq5v5GUvJQF5 TZzGih02qLIRPFE9erErVgd8CLJrymZxdR9YjXJZCpR24UUWCBlSrjMJUFEWnaQy1FiM H57cbR2UTE28m7BoUTJ3EXx0OW5wwOY0KHJJMQLAAuX7z9KEww7jbnglJMTeton+HXG2 KCCNYzYA98Gw7ursUzE6T4PwlnttqK8dO+r+ieNenWgNIeBk2ufGz9iXZbXsHpCuOvtO ho7eqoir8KtemyuLPpi/iA5HmEqQT5LlSDZXX+MgvRsL3W3DLObJs5Y7Wr7+ja4fXGWW cWjA== X-Forwarded-Encrypted: i=1; AJvYcCXJjjztIV0WU0LG1u5TkfRImjRaUBa6oTxkl3k1CO6BozoAPsCDi1aiKYTZ8yySvRBj+FKTF+cH9gRtBADvJP1ZqJK8XL9E1w0= X-Gm-Message-State: AOJu0Yydao9vW9YmUKzY90v3qWiiKRPYXnCc9POdj6lfafE++KyI4+MM 3Oo2UxtBjkbisxCUu+dDU/BwvNuadZxhhhJIabigzVB3qX2A4LvGmyBv3g== X-Google-Smtp-Source: AGHT+IFUa2lk37nfyOHT3H42dXde6MkbsnYwyAmTET+4ZMf5EoWn7CIn0GOfZyJZ/ih42mzZPlR4Ww== X-Received: by 2002:a05:6e02:1d0e:b0:39a:f126:9d86 with SMTP id e9e14a558f8ab-39d27963062mr70556245ab.0.1724077632448; Mon, 19 Aug 2024 07:27:12 -0700 (PDT) Received: from fabio-Precision-3551.. ([2804:14c:485:4b61:9187:7fc0:77bb:926e]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7c6b61c6124sm7610565a12.27.2024.08.19.07.27.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Aug 2024 07:27:11 -0700 (PDT) From: Fabio Estevam To: daniel.lezcano@linaro.org Cc: rafael@kernel.org, linux-pm@vger.kernel.org, Fabio Estevam Subject: [PATCH 2/2] thermal: imx: Remove __maybe_unused notations Date: Mon, 19 Aug 2024 11:27:00 -0300 Message-Id: <20240819142700.1206586-2-festevam@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240819142700.1206586-1-festevam@gmail.com> References: <20240819142700.1206586-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 --- 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,