History

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.

Andy Shevchenko committed 7 years ago

Commit 4f3d9571 parent e74dc5c5 files · +10 −10Browse files

Unified · Split

5 files
  1. arch/arm/plat-pxa/ssp.c +2 −2
  2. drivers/spi/spi-pxa2xx.c +1 −1
  3. include/linux/pxa2xx_ssp.h +1 −1
  4. sound/soc/pxa/mmp-sspa.c +1 −1
  5. sound/soc/pxa/pxa-ssp.c +5 −5
arch/arm/plat-pxa/ssp.c+2−2
@@ -89,7 +89,7 @@ void pxa_ssp_free(struct ssp_device *ssp) · 88 unmodified lines
8989 ssp->use_count--;
9090 ssp->label = NULL;
9191 } else
92− dev_err(&ssp->pdev->dev, "device already free\n");
92+ dev_err(ssp->dev, "device already free\n");
9393 mutex_unlock(&ssp_lock);
9494 }
9595 EXPORT_SYMBOL(pxa_ssp_free);
@@ -118,7 +118,7 @@ static int pxa_ssp_probe(struct platform_device *pdev) · 22 unmodified lines
118118 if (ssp == NULL)
119119 return -ENOMEM;
120120
121− ssp->pdev = pdev;
121+ ssp->dev = dev;
122122
123123 ssp->clk = devm_clk_get(dev, NULL);
124124 if (IS_ERR(ssp->clk))
drivers/spi/spi-pxa2xx.c+1−1
@@ -1567,7 +1567,7 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev) · 1566 unmodified lines
15671567 ssp->clk = devm_clk_get(&pdev->dev, NULL);
15681568 ssp->irq = platform_get_irq(pdev, 0);
15691569 ssp->type = type;
1570− ssp->pdev = pdev;
1570+ ssp->dev = &pdev->dev;
15711571 ssp->port_id = pxa2xx_spi_get_port_id(adev);
15721572
15731573 pdata->is_slave = of_property_read_bool(pdev->dev.of_node, "spi-slave");
include/linux/pxa2xx_ssp.h+1−1
@@ -206,7 +206,7 @@ enum pxa_ssp_type { · 205 unmodified lines
206206 };
207207
208208 struct ssp_device {
209− struct platform_device *pdev;
209+ struct device *dev;
210210 struct list_head node;
211211
212212 struct clk *clk;
sound/soc/pxa/mmp-sspa.c+1−1
@@ -177,7 +177,7 @@ static int mmp_sspa_set_dai_fmt(struct snd_soc_dai *cpu_dai, · 176 unmodified lines
177177 /* we can only change the settings if the port is not in use */
178178 if ((mmp_sspa_read_reg(sspa, SSPA_TXSP) & SSPA_SP_S_EN) ||
179179 (mmp_sspa_read_reg(sspa, SSPA_RXSP) & SSPA_SP_S_EN)) {
180− dev_err(&sspa->pdev->dev,
180+ dev_err(sspa->dev,
181181 "can't change hardware dai format: stream is in use\n");
182182 return -EINVAL;
183183 }
sound/soc/pxa/pxa-ssp.c+5−5
@@ -52,11 +52,11 @@ struct ssp_priv { · 51 unmodified lines
5252
5353 static void dump_registers(struct ssp_device *ssp)
5454 {
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",
5656 pxa_ssp_read_reg(ssp, SSCR0), pxa_ssp_read_reg(ssp, SSCR1),
5757 pxa_ssp_read_reg(ssp, SSTO));
5858
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",
6060 pxa_ssp_read_reg(ssp, SSPSP), pxa_ssp_read_reg(ssp, SSSR),
6161 pxa_ssp_read_reg(ssp, SSACD));
6262 }
@@ -223,7 +223,7 @@ static int pxa_ssp_set_dai_sysclk(struct snd_soc_dai *cpu_dai, · 160 unmodified lines
223223 clk_id = PXA_SSP_CLK_EXT;
224224 }
225225
226− dev_dbg(&ssp->pdev->dev,
226+ dev_dbg(ssp->dev,
227227 "pxa_ssp_set_dai_sysclk id: %d, clk_id %d, freq %u\n",
228228 cpu_dai->id, clk_id, freq);
229229
@@ -316,7 +316,7 @@ static int pxa_ssp_set_pll(struct ssp_priv *priv, unsigned int freq) · 86 unmodified lines
316316
317317 ssacd |= (0x6 << 4);
318318
319− dev_dbg(&ssp->pdev->dev,
319+ dev_dbg(ssp->dev,
320320 "Using SSACDD %x to supply %uHz\n",
321321 val, freq);
322322 break;
@@ -687,7 +687,7 @@ static int pxa_ssp_hw_params(struct snd_pcm_substream *substream, · 364 unmodified lines
687687 * - complain loudly and fail if they've not been set up yet.
688688 */
689689 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");
691691 return -EINVAL;
692692 }
693693

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t