From patchwork Wed Apr 19 08:48:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dhruva Gole X-Patchwork-Id: 13216528 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 D6B36C77B73 for ; Wed, 19 Apr 2023 08:49:27 +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=X+Ige1XYC9BZXQufBMKFLSs2Yj6iSflbQUvwRqbMeHE=; b=eZF62ELz0EVTnV V4azaOE0Ma+9yZnBfakufDjnibWaYHzOPr0HZv251MLkXdfuaYS/LlPmjex7GfVufWHfCjUMkvu/h jXa30qKH5mKefbWgSfT3ehR6ZPSmcPqdF64MK+DzM4L1TkIUJuS7QlsUHXMpFFWp7nH151gxsVqGo nXd3Pgyf9Hztc5pLoHg8+HjuibDhDmIIqSMFFR1WOzXS6jO03YRpVYsPPE0WrDGzxvvR3W8MCmpH1 2bwTFLa36g9r6cz4b4Zi2nNzgo9ErT+oIQFkPGj0JX7rLqJakyw+G9LjFxaxWKvo8mKRhV8AJh2KL vTYFFKFDI69WXqmRbTNA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pp3UW-004doD-1C; Wed, 19 Apr 2023 08:48:40 +0000 Received: from lelv0143.ext.ti.com ([198.47.23.248]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pp3UT-004dm4-0O for linux-arm-kernel@lists.infradead.org; Wed, 19 Apr 2023 08:48:38 +0000 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 33J8mQJf027445; Wed, 19 Apr 2023 03:48:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1681894106; bh=XbEtFK+H4/7qsl0ppFWnJWa8nE2+A+lGhJsRSLRMsZI=; h=From:To:CC:Subject:Date; b=X05IcQo6rJxC5jzIkoyxF7Wn06nh6hBy4LmgeHEcSJirXvHEpHNT4lt5eYBYaYRT1 D8o2fH8ZeTO1s/P9C3EvcIK2Km4M2GQaJfNJ8Hlv9KNb2duHNQzeERYrktso6cJ/fX wYxUmTaW88w1YDhmDWpVcbDOfIjw7PqKZIH7oOWY= Received: from DLEE100.ent.ti.com (dlee100.ent.ti.com [157.170.170.30]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 33J8mQDl005205 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 19 Apr 2023 03:48:26 -0500 Received: from DLEE102.ent.ti.com (157.170.170.32) 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; Wed, 19 Apr 2023 03:48:25 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DLEE102.ent.ti.com (157.170.170.32) 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; Wed, 19 Apr 2023 03:48:25 -0500 Received: from localhost (ileaxei01-snat.itg.ti.com [10.180.69.5]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 33J8mOuo068330; Wed, 19 Apr 2023 03:48:25 -0500 From: Dhruva Gole To: Mark Brown CC: Dhruva Gole , Vaishnav Achath , Vignesh , Apurva Nandan , , , Subject: [PATCH V2] spi: cadence-quadspi: use macro DEFINE_SIMPLE_DEV_PM_OPS Date: Wed, 19 Apr 2023 14:18:17 +0530 Message-ID: <20230419084817.481136-1-d-gole@ti.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230419_014837_238274_3AB43C5F X-CRM114-Status: GOOD ( 12.33 ) 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 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 Signed-off-by: Dhruva Gole --- Address comments from previously posted patch: https://patchwork.kernel.org/project/spi-devel-general/patch/20230417091027.966146-2-d-gole@ti.com/ drivers/spi/spi-cadence-quadspi.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c index 79ab7e309644..922026bb9380 100644 --- a/drivers/spi/spi-cadence-quadspi.c +++ b/drivers/spi/spi-cadence-quadspi.c @@ -1829,12 +1829,7 @@ static int cqspi_resume(struct device *dev) return 0; } -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) +static DEFINE_SIMPLE_DEV_PM_OPS(cqspi_dev_pm_ops, cqspi_suspend, cqspi_resume); #else #define CQSPI_DEV_PM_OPS NULL #endif @@ -1912,7 +1907,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, }, };