summaryrefslogtreecommitdiff
path: root/drivers/spi/spi-pxa2xx.c
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2024-05-30 18:10:01 +0300
committerMark Brown <broonie@kernel.org>2024-06-03 15:59:58 +0100
commitc65174fdb2f7fe83ee515966c08de9a990e722f9 (patch)
treeeaf53a24890e2622dbfbde215a3d9946266fd558 /drivers/spi/spi-pxa2xx.c
parentc1b93986dfb2a31b0528fe929d574843801089f5 (diff)
downloadlwn-c65174fdb2f7fe83ee515966c08de9a990e722f9.tar.gz
lwn-c65174fdb2f7fe83ee515966c08de9a990e722f9.zip
spi: pxa2xx: Utilise temporary variable for struct device
We have a temporary variable to keep a pointer to struct device. Utilise it where it makes sense. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://msgid.link/r/20240530151117.1130792-6-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-pxa2xx.c')
-rw-r--r--drivers/spi/spi-pxa2xx.c21
1 files 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 @@ out_error_dma_irq_alloc:
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);