From patchwork Mon Jul 18 07:10:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 12920911 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E390AC433EF for ; Mon, 18 Jul 2022 07:09:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=iNI/4KOxDWXpAiAsvNfybe2iSXHZD65gBAPYL2PIqvg=; b=vpntUmvYSbDw4B ElYuDw/s+wcVJwAJX0raTH6Rkpx7uq+DamAnybx9121Ijl8Tz0en+qd1WRjis/7Lop+zpv8Ep46gD +DAuN58FFCaeti+u6T636rrWr+UkNEBzT4yx6VZGP2SDLGZBRQylOZIOtuIsz8uRdg4VNwWA1KWss XIwBqjIHCVCaqgXxm2sWeLX6iRur4/Y5KCH+ZDLz6ASoqFPX3/MqCnZhvUKsh4XDHAiOZFwqi7iV9 7+wy2yFh1UdC2UEcDQh250l3sR/n0SKs0yQn4nE/zQ3FI6KcVgxVX7uONXe4HDdlKrZpPgF0GjhEd AfYjy5Y1C9er0Wz+TBdw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oDKs1-00BO0W-L6; Mon, 18 Jul 2022 07:08:45 +0000 Received: from esa.microchip.iphmx.com ([68.232.154.123]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oDKrw-00BNxQ-Cp for linux-arm-kernel@lists.infradead.org; Mon, 18 Jul 2022 07:08:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1658128120; x=1689664120; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=/36lrqu98ICjFsab92jQzawKglUSnBRJ4IRFIwtlFVM=; b=RzdwPoI0cDTBKfjF9vwNGivkZKxJH96tw1utlRzzZzez8zKHwuitA4Jw zOpbBmXI51eQlw/f5D+itP9zzIFG+NXulJ13wfU6ezPgCJMzqJB7Y3FJK itwskHCUgqRv9LYk6Rs2f/lnw1LKcvsvvuSQc1RqReEO76srd0lEi1U+w VDBrhfFcoJ8qPKhTr3erfT1cAXcd2iCBM7aSDAItru6B45qv3jphP8hpb BmFddXhyzQrAR5NBlQczsNxj1e2ugxyaH2d9tDaFtFOI+GGBVknSFLAoM WKSVIVTNEMuD3TlAXDqWybNhASRcic1OoUvsdOgrEbooSUdV64R78b6Br Q==; X-IronPort-AV: E=Sophos;i="5.92,280,1650956400"; d="scan'208";a="165161049" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 18 Jul 2022 00:08:30 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Mon, 18 Jul 2022 00:08:30 -0700 Received: from localhost.localdomain (10.10.115.15) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2375.17 via Frontend Transport; Mon, 18 Jul 2022 00:08:27 -0700 From: Claudiu Beznea To: , , , CC: , , , Claudiu Beznea Subject: [PATCH] spi: atmel: remove #ifdef CONFIG_{PM, SLEEP} Date: Mon, 18 Jul 2022 10:10:52 +0300 Message-ID: <20220718071052.1707858-1-claudiu.beznea@microchip.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220718_000840_558860_CFE0D838 X-CRM114-Status: GOOD ( 11.69 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Remove #ifdef CONFIG_PM, #ifdef CONFIG_PM_SLEEP and use SYSTEM_SLEEP_PM_OPS() and RUNTIME_PM_OPS() macros instead which allows getting also rid of __maybe_unused in the code. Signed-off-by: Claudiu Beznea --- drivers/spi/spi-atmel.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c index 9e300a932699..c4f22d50dba5 100644 --- a/drivers/spi/spi-atmel.c +++ b/drivers/spi/spi-atmel.c @@ -1631,7 +1631,6 @@ static int atmel_spi_remove(struct platform_device *pdev) return 0; } -#ifdef CONFIG_PM static int atmel_spi_runtime_suspend(struct device *dev) { struct spi_master *master = dev_get_drvdata(dev); @@ -1653,7 +1652,6 @@ static int atmel_spi_runtime_resume(struct device *dev) return clk_prepare_enable(as->clk); } -#ifdef CONFIG_PM_SLEEP static int atmel_spi_suspend(struct device *dev) { struct spi_master *master = dev_get_drvdata(dev); @@ -1693,17 +1691,12 @@ static int atmel_spi_resume(struct device *dev) /* Start the queue running */ return spi_master_resume(master); } -#endif static const struct dev_pm_ops atmel_spi_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(atmel_spi_suspend, atmel_spi_resume) - SET_RUNTIME_PM_OPS(atmel_spi_runtime_suspend, - atmel_spi_runtime_resume, NULL) + SYSTEM_SLEEP_PM_OPS(atmel_spi_suspend, atmel_spi_resume) + RUNTIME_PM_OPS(atmel_spi_runtime_suspend, + atmel_spi_runtime_resume, NULL) }; -#define ATMEL_SPI_PM_OPS (&atmel_spi_pm_ops) -#else -#define ATMEL_SPI_PM_OPS NULL -#endif static const struct of_device_id atmel_spi_dt_ids[] = { { .compatible = "atmel,at91rm9200-spi" }, @@ -1715,7 +1708,7 @@ MODULE_DEVICE_TABLE(of, atmel_spi_dt_ids); static struct platform_driver atmel_spi_driver = { .driver = { .name = "atmel_spi", - .pm = ATMEL_SPI_PM_OPS, + .pm = pm_ptr(&atmel_spi_pm_ops), .of_match_table = atmel_spi_dt_ids, }, .probe = atmel_spi_probe,