Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

spi: pxa2xx: No need to keep pointer to platform device

There is no need to keep a pointer to the platform device. Currently there are
no users of it directly, and if there will be in the future we may restore it
from pointer to the struct device.

Convert all users at the same time.

Cc: Russell King <linux@armlinux.org.uk>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20191018105429.82782-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Andy Shevchenko and committed by
Mark Brown
4f3d9577 e74dc5c7

+10 -10
+2 -2
arch/arm/plat-pxa/ssp.c
··· 89 89 ssp->use_count--; 90 90 ssp->label = NULL; 91 91 } else 92 - dev_err(&ssp->pdev->dev, "device already free\n"); 92 + dev_err(ssp->dev, "device already free\n"); 93 93 mutex_unlock(&ssp_lock); 94 94 } 95 95 EXPORT_SYMBOL(pxa_ssp_free); ··· 118 118 if (ssp == NULL) 119 119 return -ENOMEM; 120 120 121 - ssp->pdev = pdev; 121 + ssp->dev = dev; 122 122 123 123 ssp->clk = devm_clk_get(dev, NULL); 124 124 if (IS_ERR(ssp->clk))
+1 -1
drivers/spi/spi-pxa2xx.c
··· 1567 1567 ssp->clk = devm_clk_get(&pdev->dev, NULL); 1568 1568 ssp->irq = platform_get_irq(pdev, 0); 1569 1569 ssp->type = type; 1570 - ssp->pdev = pdev; 1570 + ssp->dev = &pdev->dev; 1571 1571 ssp->port_id = pxa2xx_spi_get_port_id(adev); 1572 1572 1573 1573 pdata->is_slave = of_property_read_bool(pdev->dev.of_node, "spi-slave");
+1 -1
include/linux/pxa2xx_ssp.h
··· 206 206 }; 207 207 208 208 struct ssp_device { 209 - struct platform_device *pdev; 209 + struct device *dev; 210 210 struct list_head node; 211 211 212 212 struct clk *clk;
+1 -1
sound/soc/pxa/mmp-sspa.c
··· 177 177 /* we can only change the settings if the port is not in use */ 178 178 if ((mmp_sspa_read_reg(sspa, SSPA_TXSP) & SSPA_SP_S_EN) || 179 179 (mmp_sspa_read_reg(sspa, SSPA_RXSP) & SSPA_SP_S_EN)) { 180 - dev_err(&sspa->pdev->dev, 180 + dev_err(sspa->dev, 181 181 "can't change hardware dai format: stream is in use\n"); 182 182 return -EINVAL; 183 183 }
+5 -5
sound/soc/pxa/pxa-ssp.c
··· 52 52 53 53 static void dump_registers(struct ssp_device *ssp) 54 54 { 55 - dev_dbg(&ssp->pdev->dev, "SSCR0 0x%08x SSCR1 0x%08x SSTO 0x%08x\n", 55 + dev_dbg(ssp->dev, "SSCR0 0x%08x SSCR1 0x%08x SSTO 0x%08x\n", 56 56 pxa_ssp_read_reg(ssp, SSCR0), pxa_ssp_read_reg(ssp, SSCR1), 57 57 pxa_ssp_read_reg(ssp, SSTO)); 58 58 59 - dev_dbg(&ssp->pdev->dev, "SSPSP 0x%08x SSSR 0x%08x SSACD 0x%08x\n", 59 + dev_dbg(ssp->dev, "SSPSP 0x%08x SSSR 0x%08x SSACD 0x%08x\n", 60 60 pxa_ssp_read_reg(ssp, SSPSP), pxa_ssp_read_reg(ssp, SSSR), 61 61 pxa_ssp_read_reg(ssp, SSACD)); 62 62 } ··· 223 223 clk_id = PXA_SSP_CLK_EXT; 224 224 } 225 225 226 - dev_dbg(&ssp->pdev->dev, 226 + dev_dbg(ssp->dev, 227 227 "pxa_ssp_set_dai_sysclk id: %d, clk_id %d, freq %u\n", 228 228 cpu_dai->id, clk_id, freq); 229 229 ··· 316 316 317 317 ssacd |= (0x6 << 4); 318 318 319 - dev_dbg(&ssp->pdev->dev, 319 + dev_dbg(ssp->dev, 320 320 "Using SSACDD %x to supply %uHz\n", 321 321 val, freq); 322 322 break; ··· 687 687 * - complain loudly and fail if they've not been set up yet. 688 688 */ 689 689 if ((sscr0 & SSCR0_MOD) && !ttsa) { 690 - dev_err(&ssp->pdev->dev, "No TDM timeslot configured\n"); 690 + dev_err(ssp->dev, "No TDM timeslot configured\n"); 691 691 return -EINVAL; 692 692 } 693 693