From patchwork Tue Jun 25 00:20:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 13710347 Received: from mail-pj1-f47.google.com (mail-pj1-f47.google.com [209.85.216.47]) (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 4FA39184 for ; Tue, 25 Jun 2024 00:20:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719274841; cv=none; b=BfMJgPCffqEuvsgMC8YpMzhLhhSSy4YQm3Hjy4jxAUyNnRrzqeFUhB+oYI248JLGc19zXYCcln1bgEp8NaTRE8DTh/3taW+hOxTG725Fv5F/pVudXiad3g0yuMAHfL9ltaR5vKCh4ub2RxXxUM0luo+KqGu2JxoUG1LUVqAcgKo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719274841; c=relaxed/simple; bh=LzvYgPoCULXty/7Vn6ISGlp4JZS7xPZl8pR/eWPeV2U=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=IkcFumw38/JPUQckvep1OekvS0UgCsfxRWHhlX4Y+yzs/Y/I4N6BOWizRjLcWIGPGF4FfRICMvpY1k6OUltRbK2dOO8YRNjTIOIcfgf8H/5gtMaVVvQr9B7aGkaOUCURg07I8ahYaXrUD24sVwnI+ummb+mWqj0WpvG1ln9wyZ8= 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=iCZYZzem; arc=none smtp.client-ip=209.85.216.47 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="iCZYZzem" Received: by mail-pj1-f47.google.com with SMTP id 98e67ed59e1d1-2c87a7df96eso281818a91.1 for ; Mon, 24 Jun 2024 17:20:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719274839; x=1719879639; 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=hpzkHsUO+Jg8sU9WgIECftJBeKNPYdw5mjZMnQuhjRE=; b=iCZYZzemlONVstPAPm6eYcmKKeV/bp22fWyHGY2h41Sil157Bvl8aG5J8J5YEaIxAQ GkN9mflpUXCxxjcByP4fwRQnEaUmPdZApCLVY1qGF50YmkVMcwtseRYVlMhjPQ9IJIjv JQryQWcETm7ZgtcWdtpG7a59vxsqeYAG3nBivvLA5VoSJBbHpYlGiXnSr/tP8+RuwP7L 4lLFKTEg1viqo3UiZtlBi7h57errBHrBtJ56olXyef/g+muK4HSRDO3zuDrVW26Kl1Y4 Ow3UAlq9M1rpWxyPWMgvuJoAjFiqAF4U4aIqyXcF5FTEwBZeZwq8CTzzZMh6QqH+7lzn sUgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719274839; x=1719879639; 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=hpzkHsUO+Jg8sU9WgIECftJBeKNPYdw5mjZMnQuhjRE=; b=XERcM9QpbULXuZ6+O24JhCCXhDFHChZv1G2qDzQRD3P+h5XHrD/fG6bbhaNTH0VKec 2EtFEkxQLtGRCE2XQYxXy+JJstKa3G4s6f5J0evTtFy4V2pTSHPXpcIgh+j0alTy47eC TNiuaOGxuCiaNUipFyog58jAzgg9syqWYMe1F7ZQVhusgWvPQV1DHiV32KJyMllykzEX WX83CD8g0FeFHoP2XDAbbMTUayzo2KuupE2KFybOVgsUruXJYE1XevQ67evnVwWtpfUu ktaIZV/0Mo75ZU49RHYhLf/v1TyCLre4prnM4Kh5ymPfo9dQKYU4CSLtfjeBFpJrtDNh p2wA== X-Gm-Message-State: AOJu0YyFeKG+ekRDd1JtW11xbQLRZDiAAfVeG7Uyiw5AzPLrsYZKFBgw F0ohUQn0QTmv8s1ADmXKfvW0QitUOIxj5raCHi4YKL9tEaboy3SboYotPQ== X-Google-Smtp-Source: AGHT+IHUZrx9W/iRHD5tVI/4EPttxLO3FjTubiBHYsWORfh1Ztn7TOnFwczhsXMHY7W5xVuxZPrBIQ== X-Received: by 2002:a17:902:d4d0:b0:1f9:a386:2b93 with SMTP id d9443c01a7336-1fa0d832b9emr85934685ad.6.1719274839349; Mon, 24 Jun 2024 17:20:39 -0700 (PDT) Received: from fabio-Precision-3551.. ([2804:14c:485:4b61:91f5:bdad:d063:87c5]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f9ebbbb5fcsm67913805ad.281.2024.06.24.17.20.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jun 2024 17:20:38 -0700 (PDT) From: Fabio Estevam To: broonie@kernel.org Cc: linux-spi@vger.kernel.org, Fabio Estevam Subject: [PATCH 1/2] spi: spi-imx: Switch to RUNTIME_PM_OPS/SYSTEM_SLEEP_PM_OPS() Date: Mon, 24 Jun 2024 21:20:22 -0300 Message-Id: <20240625002023.228235-1-festevam@gmail.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-spi@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 the __maybe_unused notation from the runtime suspend/resume() functions. Signed-off-by: Fabio Estevam --- drivers/spi/spi-imx.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c index 6f1cd3453c97..caf36fb785b3 100644 --- a/drivers/spi/spi-imx.c +++ b/drivers/spi/spi-imx.c @@ -1898,7 +1898,7 @@ static void spi_imx_remove(struct platform_device *pdev) spi_imx_sdma_exit(spi_imx); } -static int __maybe_unused spi_imx_runtime_resume(struct device *dev) +static int spi_imx_runtime_resume(struct device *dev) { struct spi_controller *controller = dev_get_drvdata(dev); struct spi_imx_data *spi_imx; @@ -1919,7 +1919,7 @@ static int __maybe_unused spi_imx_runtime_resume(struct device *dev) return 0; } -static int __maybe_unused spi_imx_runtime_suspend(struct device *dev) +static int spi_imx_runtime_suspend(struct device *dev) { struct spi_controller *controller = dev_get_drvdata(dev); struct spi_imx_data *spi_imx; @@ -1932,22 +1932,21 @@ static int __maybe_unused spi_imx_runtime_suspend(struct device *dev) return 0; } -static int __maybe_unused spi_imx_suspend(struct device *dev) +static int spi_imx_suspend(struct device *dev) { pinctrl_pm_select_sleep_state(dev); return 0; } -static int __maybe_unused spi_imx_resume(struct device *dev) +static int spi_imx_resume(struct device *dev) { pinctrl_pm_select_default_state(dev); return 0; } static const struct dev_pm_ops imx_spi_pm = { - SET_RUNTIME_PM_OPS(spi_imx_runtime_suspend, - spi_imx_runtime_resume, NULL) - SET_SYSTEM_SLEEP_PM_OPS(spi_imx_suspend, spi_imx_resume) + RUNTIME_PM_OPS(spi_imx_runtime_suspend, spi_imx_runtime_resume, NULL) + SYSTEM_SLEEP_PM_OPS(spi_imx_suspend, spi_imx_resume) }; static struct platform_driver spi_imx_driver = { From patchwork Tue Jun 25 00:20:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 13710348 Received: from mail-pg1-f179.google.com (mail-pg1-f179.google.com [209.85.215.179]) (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 810AF184 for ; Tue, 25 Jun 2024 00:20:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719274843; cv=none; b=k+iVTQUU2Luran0cx09L3DERxIIpkX6nwZnF9W2rOja672VmoOGjG+6LBdR30z7eidKnatES3mv93u6O97KDmWrsVaMT7ts9aDUls/QGiHSWqfbE9WX3hjxIeFsppWk3vBCihUKp2GxUhHyqmpPhS2KoOF/kd7n2DgEztFqbV2w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719274843; c=relaxed/simple; bh=p1suwUFD0rTGP6SY/KOO3rleeioiKQmFUzYU4dE2mzM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Wjsz4/53OfyyRAZcngQV6I4FAqFyskW7Rpnm3ckPNKuEXL5vvDQqDrbcFxQOoTamzYcJkf5lyNfFhNq9V7X3FYI1W/Aj1LB3yukWV0nkUMJ2qWuOrxfeVA1OUuBcXZHew4amNfUceyE7DYck2DeHlwIaE3QLLkV0ZQi+1j6UDzc= 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=E6JPhxKM; arc=none smtp.client-ip=209.85.215.179 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="E6JPhxKM" Received: by mail-pg1-f179.google.com with SMTP id 41be03b00d2f7-71d125f2d96so226810a12.2 for ; Mon, 24 Jun 2024 17:20:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719274842; x=1719879642; 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=LpOPOc0m7l2zOTjNdYHa+1JNk7lo/Ki5SFDkJ6R+5uU=; b=E6JPhxKMqxJKRjsO5zeOvTuw5ImC91JECw05pGYlmILJ477kggdPJK46y8BlYMJfpE KgZzgGq2vTKKoVwLE6AWgeOpY3vmKulIgC3yDC2rL5kdyCBbJEnkkAJYjdYujHymAYMx 8HQ2ynHN9wmuNS3Ra2wLhav8ZLE+UtlnA0lalFvbeMGq+jSBt95ZBM43UKVso9BFXT0x I6CeN20XChowtpEnMpG+zogM3dZ5vkDp7XofmAxZ/JlUoLzHxCkwgdBoVKgiKekvIbqS mXzFsvrAAfOU/yErNZ2p8/OKwtk/fuj38uZVpjT5xhTau3YjMpq4GIkXfoiZ22bn3wvr y5RA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719274842; x=1719879642; 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=LpOPOc0m7l2zOTjNdYHa+1JNk7lo/Ki5SFDkJ6R+5uU=; b=u/1VYmFANA7LFsAMkRAqGzGH7FIYZZBqwBuxlX0geNG35nar5GLtY+aqxdfI++Xp1C WESNeeseq9zRWGAeTJwY01/hAqDYRvPuR5Z8zG8HVtOGJXtVntA7RUTCm7bbWrzhxSP9 AIkTPF3KFjuPvgE354A62uPsTGkl4NIJ+eNQA8ApAfueGbSMWNxv9dHghshnEuygoqUs BJDt6nJHxDCqJa8KJylg/lZIMkMDku3OzBS5iG8vmxpFHWqgVlBRcdLmRbixybrUKq1y j6WL2hWpmAZOSgtn6Kp0U/SoFWlrYkpARtEcJ4u5/s5bcW2/k7BkAom+I3Izmf7uqZf0 Ynyw== X-Gm-Message-State: AOJu0YyBlOB82rnGAAqVbYJjsWfwcL9/qq7QkKkPgY3jw43rEZgtUJZz N/Jwf+AsfUJCLiNi/SShGzZE8CnBLBjgMjtPVadR8Z3vaaGFzQgqSu7vRA== X-Google-Smtp-Source: AGHT+IGo3EN1Rm3riVVX0FzrH3QX5DWASmWbN1jjk7oNGGFRelaiAC5DyBBBHhQIG45oF1m+7pGCiQ== X-Received: by 2002:a05:6a21:622:b0:1af:cd45:59a9 with SMTP id adf61e73a8af0-1bcea4a1cc9mr7190905637.2.1719274841634; Mon, 24 Jun 2024 17:20:41 -0700 (PDT) Received: from fabio-Precision-3551.. ([2804:14c:485:4b61:91f5:bdad:d063:87c5]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f9ebbbb5fcsm67913805ad.281.2024.06.24.17.20.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jun 2024 17:20:41 -0700 (PDT) From: Fabio Estevam To: broonie@kernel.org Cc: linux-spi@vger.kernel.org, Fabio Estevam Subject: [PATCH 2/2] spi: spi-fsl-lpspi: Switch to SYSTEM_SLEEP_PM_OPS() Date: Mon, 24 Jun 2024 21:20:23 -0300 Message-Id: <20240625002023.228235-2-festevam@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240625002023.228235-1-festevam@gmail.com> References: <20240625002023.228235-1-festevam@gmail.com> Precedence: bulk X-Mailing-List: linux-spi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Fabio Estevam Replace SET_SYSTEM_SLEEP_PM_OPS with its modern SYSTEM_SLEEP_PM_OPS() alternative. The combined usage of pm_ptr() and 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 the __maybe_unused notation from the runtime suspend/resume() functions. Signed-off-by: Fabio Estevam --- drivers/spi/spi-fsl-lpspi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-fsl-lpspi.c b/drivers/spi/spi-fsl-lpspi.c index aa5ed254be46..2908a5532482 100644 --- a/drivers/spi/spi-fsl-lpspi.c +++ b/drivers/spi/spi-fsl-lpspi.c @@ -960,13 +960,13 @@ static void fsl_lpspi_remove(struct platform_device *pdev) pm_runtime_disable(fsl_lpspi->dev); } -static int __maybe_unused fsl_lpspi_suspend(struct device *dev) +static int fsl_lpspi_suspend(struct device *dev) { pinctrl_pm_select_sleep_state(dev); return pm_runtime_force_suspend(dev); } -static int __maybe_unused fsl_lpspi_resume(struct device *dev) +static int fsl_lpspi_resume(struct device *dev) { int ret; @@ -984,7 +984,7 @@ static int __maybe_unused fsl_lpspi_resume(struct device *dev) static const struct dev_pm_ops fsl_lpspi_pm_ops = { SET_RUNTIME_PM_OPS(fsl_lpspi_runtime_suspend, fsl_lpspi_runtime_resume, NULL) - SET_SYSTEM_SLEEP_PM_OPS(fsl_lpspi_suspend, fsl_lpspi_resume) + SYSTEM_SLEEP_PM_OPS(fsl_lpspi_suspend, fsl_lpspi_resume) }; static struct platform_driver fsl_lpspi_driver = {