Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp306643rwr; Wed, 19 Apr 2023 22:50:30 -0700 (PDT) X-Google-Smtp-Source: AKy350ZdRblld8ODh7dKc+8Nh3fyk+HGgUryQ96EprZvNsM0QPAtQmUBpGV4VcR+Gzoezx9nJbxh X-Received: by 2002:a17:902:ce88:b0:1a5:1586:7761 with SMTP id f8-20020a170902ce8800b001a515867761mr502803plg.36.1681969829998; Wed, 19 Apr 2023 22:50:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681969829; cv=none; d=google.com; s=arc-20160816; b=e7fTcGTAvK1qCIsnMgJZC1if3xhdg/bq79U6TyrSyyx6cStZLogC9v6XhFsZbUhRME 5DaruHQzMAv2SgxYo4c2U/RLANkEhF3XAQi1Sb6kkz6k0oNdYEGdF5O3UOTXmNa6VvY1 KpAAnPzNG8Quask4YO6qAzgUywTNM2AeVNFc0f+Ezn5OWygClj5YNoQCnTK0E2ZxEUf4 gDsQNVZqIXBHBrAQfiRAtKZh2fwHN9gzRLpAifB7dnLboIyLvsM7RNMi/YoIBtl2/XRp oRXDgiGcqwNWajk3tIYKSJW5RYeS2ggzoEjI/WnqVkBWu2UpPIqytmkRpBlEj7fdKPTa ekAw== 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=6ajKYqWHNECSE5BjMGUN6lrTrtrHPa2R5TCfI4K0qPU=; b=ljetjcuP3NQR21zuIgQtJAbB1GKYfvjlu7fTYINggkeJaI06eWLMQzq3g5TnrmDnO0 nQh94OpvWtw4/v7IdIbnmFJaNM+8vrRi5oMLddOmN+61KWrgPBnVzjQA9KJQ5sMZL31H 3p7ZpNvzAJb8ZayEdrOAyy6FRab7XSuzLh+DWwo++7M1Mj3kEHerSv72LzEJkp76h/7X C6Vuiq4MAqP4EAzASnEkt8kVKoIvpDHDUSSsp4jPfMf9BpGz+tU9ThQrAIYg0Z5DQTfk +Ja/diaEVWsLRdumm4Iv7/9coO2ezPjZZaSrz6NGprLcHkeaHAdY4cNuSvDLd6KYyvEf IqxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=oNRngS72; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l16-20020a170902f69000b001a1d78af685si1001972plg.466.2023.04.19.22.50.15; Wed, 19 Apr 2023 22:50:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=oNRngS72; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232546AbjDTFoV (ORCPT + 99 others); Thu, 20 Apr 2023 01:44:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230102AbjDTFoT (ORCPT ); Thu, 20 Apr 2023 01:44:19 -0400 Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 795053A87; Wed, 19 Apr 2023 22:44:15 -0700 (PDT) Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 33K5hYZf080236; Thu, 20 Apr 2023 00:43:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1681969414; bh=6ajKYqWHNECSE5BjMGUN6lrTrtrHPa2R5TCfI4K0qPU=; h=From:To:CC:Subject:Date; b=oNRngS72p8IQecGlyKWkX8xFXfp8vcSJ1TwqfBpTNkT2TNB5/ybLu4sx4uaAlFrQT PwrblHa32uTD/5M+aU1x0vfbqGUMeKlVm7GtQmSLbhY48L95SG2buSbSngYLj54ZbC htxtewAIBPGXcAQuX8nocZ5C3/b0gPZfRQeERhbo= Received: from DLEE109.ent.ti.com (dlee109.ent.ti.com [157.170.170.41]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 33K5hY9b011203 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 20 Apr 2023 00:43:34 -0500 Received: from DLEE100.ent.ti.com (157.170.170.30) by DLEE109.ent.ti.com (157.170.170.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16; Thu, 20 Apr 2023 00:43:34 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DLEE100.ent.ti.com (157.170.170.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16 via Frontend Transport; Thu, 20 Apr 2023 00:43:34 -0500 Received: from localhost (ileaxei01-snat.itg.ti.com [10.180.69.5]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 33K5hWhL013841; Thu, 20 Apr 2023 00:43:33 -0500 From: Dhruva Gole To: Mark Brown CC: Dhruva Gole , Vaishnav Achath , Vignesh , Apurva Nandan , , , , kernel test robot Subject: [PATCH V3] spi: cadence-quadspi: use macro DEFINE_SIMPLE_DEV_PM_OPS Date: Thu, 20 Apr 2023 11:12:57 +0530 Message-ID: <20230420054257.925092-1-d-gole@ti.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Using this macro makes the code more readable. It also inits the members of dev_pm_ops in the following manner without us explicitly needing to: .suspend = cqspi_suspend, \ .resume = cqspi_resume, \ .freeze = cqspi_suspend, \ .thaw = cqspi_resume, \ .poweroff = cqspi_suspend, \ .restore = cqspi_resume Also get rid of conditional compilation based on CONFIG_PM_SLEEP because it introduces build issues with certain configs when CQSPI_DEV_PM_OPS is just NULL. Reported-by: kernel test robot Link: https://lore.kernel.org/oe-kbuild-all/202304191900.2fARFQW9-lkp@intel.com/ Fixes: 140623410536 ("mtd: spi-nor: Add driver for Cadence Quad SPI Flash Controller") Signed-off-by: Dhruva Gole --- Previously sent here: https://lore.kernel.org/all/20230419084817.481136-1-d-gole@ti.com/ Base: next-20230419 Changelog: * Fix build errors reported by kernel test bot. drivers/spi/spi-cadence-quadspi.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c index 53829eb5eca0..6ddb2dfc0f00 100644 --- a/drivers/spi/spi-cadence-quadspi.c +++ b/drivers/spi/spi-cadence-quadspi.c @@ -1820,7 +1820,6 @@ static void cqspi_remove(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); } -#ifdef CONFIG_PM_SLEEP static int cqspi_suspend(struct device *dev) { struct cqspi_st *cqspi = dev_get_drvdata(dev); @@ -1850,15 +1849,7 @@ static int cqspi_resume(struct device *dev) return spi_master_resume(master); } -static const struct dev_pm_ops cqspi__dev_pm_ops = { - .suspend = cqspi_suspend, - .resume = cqspi_resume, -}; - -#define CQSPI_DEV_PM_OPS (&cqspi__dev_pm_ops) -#else -#define CQSPI_DEV_PM_OPS NULL -#endif +static DEFINE_SIMPLE_DEV_PM_OPS(cqspi_dev_pm_ops, cqspi_suspend, cqspi_resume); static const struct cqspi_driver_platdata cdns_qspi = { .quirks = CQSPI_DISABLE_DAC_MODE, @@ -1933,7 +1924,7 @@ static struct platform_driver cqspi_platform_driver = { .remove_new = cqspi_remove, .driver = { .name = CQSPI_NAME, - .pm = CQSPI_DEV_PM_OPS, + .pm = &cqspi_dev_pm_ops, .of_match_table = cqspi_dt_ids, }, }; -- 2.25.1