From patchwork Thu May 30 15:10:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13680533 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 CA6CAC27C4F for ; Thu, 30 May 2024 15:12:00 +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:References:In-Reply-To: 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: List-Owner; bh=vv8IoMMz9Yo5BWUl538K1msmMNTpdyhhrzq+sV2J3BU=; b=gYgdrAMuIOqR+A w9VCm8Su/rrUfBgMGXr6/XRMFdsEKuZjd9QbwtnYDtn/CipXZLw6adWMAlOnEVUTngLv0Om1h7iF1 EvmJacS0E98Fn2tBpFVFunMf7zNNUxGEca28LsseimpKoIAuqVYdXk8KTFhOrNH8/zPuYAPMJNCFn SCne8XGhvyMRMtodvOZAgvouzizI9PwW1TUOQPUzTtyeZHwT62PtAfj0n0F8fxVec6Ctc3KSOUteJ G++Fmfc28UyI6B6M38LenLNH6g2xOGnj7ODye8T54zU0T3HlNqzHx3nZVXSgPUAxnuKMW7ZxbLHgZ GI0mN5rOzHSIZJYQQRvQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sChRV-00000007eyu-0Dza; Thu, 30 May 2024 15:11:49 +0000 Received: from mgamail.intel.com ([192.198.163.8]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sChR9-00000007emi-3Eku for linux-arm-kernel@lists.infradead.org; Thu, 30 May 2024 15:11:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717081888; x=1748617888; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=M+NbhDPEqKAfXCCJumrA9VHagNYen39iF9Q6cbbh/Yc=; b=IHsvJzosSSdsgETKErhEg2/0OyKrl0Wm8lY1USxlbFV0AGP9KSNhUqVF FWb7PZvc1+47FGEalfeqrPAYze+zzucqdwki6h0SxjeAG1oHEHnz54wNB qUZrStMuknp1i37tjKtzdywoNZb/ujYsWd4S9NFSrqN34EUGnltQCzbNZ 7whWD6gp9V15tdlyPu4lisx5YcYn7XyWidC+9M9xKY4RtgwjCFmC6ao4C KiS/bHoBLBfqRucn+QIfwczgFPD8svrCsNztTiMav+k81saAETGlLzPpT FwRcVzjCjuuyQoUoHyKe5Pu7YyVBRhx294QUfA5k9ahdME5tmoZeJ4n9x Q==; X-CSE-ConnectionGUID: fN+zYcHuRySyFx6sE9Yp5Q== X-CSE-MsgGUID: NHBNxFj4RsSAhnFTpUe2Nw== X-IronPort-AV: E=McAfee;i="6600,9927,11088"; a="31093052" X-IronPort-AV: E=Sophos;i="6.08,201,1712646000"; d="scan'208";a="31093052" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 May 2024 08:11:25 -0700 X-CSE-ConnectionGUID: qt//DRy9Sc+BayjLWr0qfw== X-CSE-MsgGUID: 55oDytf2S8+9oqMNTbMdmQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,201,1712646000"; d="scan'208";a="40288502" Received: from black.fi.intel.com ([10.237.72.28]) by fmviesa005.fm.intel.com with ESMTP; 30 May 2024 08:11:23 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 57AEF6AB; Thu, 30 May 2024 18:11:19 +0300 (EEST) From: Andy Shevchenko To: Mark Brown , Andy Shevchenko , Linus Walleij , linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Daniel Mack , Haojian Zhuang , Robert Jarzmik Subject: [PATCH v2 05/11] spi: pxa2xx: Utilise temporary variable for struct device Date: Thu, 30 May 2024 18:10:01 +0300 Message-ID: <20240530151117.1130792-6-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20240530151117.1130792-1-andriy.shevchenko@linux.intel.com> References: <20240530151117.1130792-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240530_081128_306053_BEF214E9 X-CRM114-Status: GOOD ( 13.45 ) 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 We have a temporary variable to keep a pointer to struct device. Utilise it where it makes sense. Signed-off-by: Andy Shevchenko --- drivers/spi/spi-pxa2xx.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index 53815aab41aa..19ee7739f4bd 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c @@ -1606,13 +1606,13 @@ static int pxa2xx_spi_probe(struct platform_device *pdev) } } - pm_runtime_set_autosuspend_delay(&pdev->dev, 50); - pm_runtime_use_autosuspend(&pdev->dev); - pm_runtime_set_active(&pdev->dev); - pm_runtime_enable(&pdev->dev); + pm_runtime_set_autosuspend_delay(dev, 50); + pm_runtime_use_autosuspend(dev); + pm_runtime_set_active(dev); + pm_runtime_enable(dev); /* Register with the SPI framework */ - platform_set_drvdata(pdev, drv_data); + dev_set_drvdata(dev, drv_data); status = spi_register_controller(controller); if (status) { dev_err_probe(dev, status, "problem registering SPI controller\n"); @@ -1622,7 +1622,7 @@ static int pxa2xx_spi_probe(struct platform_device *pdev) return status; out_error_pm_runtime_enabled: - pm_runtime_disable(&pdev->dev); + pm_runtime_disable(dev); out_error_clock_enabled: clk_disable_unprepare(ssp->clk); @@ -1636,10 +1636,11 @@ static int pxa2xx_spi_probe(struct platform_device *pdev) static void pxa2xx_spi_remove(struct platform_device *pdev) { - struct driver_data *drv_data = platform_get_drvdata(pdev); + struct device *dev = &pdev->dev; + struct driver_data *drv_data = dev_get_drvdata(dev); struct ssp_device *ssp = drv_data->ssp; - pm_runtime_get_sync(&pdev->dev); + pm_runtime_get_sync(dev); spi_unregister_controller(drv_data->controller); @@ -1651,8 +1652,8 @@ static void pxa2xx_spi_remove(struct platform_device *pdev) if (drv_data->controller_info->enable_dma) pxa2xx_spi_dma_release(drv_data); - pm_runtime_put_noidle(&pdev->dev); - pm_runtime_disable(&pdev->dev); + pm_runtime_put_noidle(dev); + pm_runtime_disable(dev); /* Release IRQ */ free_irq(ssp->irq, drv_data);