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.
Unified · Split
| @@ -89,7 +89,7 @@ void pxa_ssp_free(struct ssp_device *ssp) · 88 unmodified lines | ||
| 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,7 +118,7 @@ static int pxa_ssp_probe(struct platform_device *pdev) · 22 unmodified lines | ||
| 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)) |
| @@ -1567,7 +1567,7 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev) · 1566 unmodified lines | ||
| 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"); |
| @@ -206,7 +206,7 @@ enum pxa_ssp_type { · 205 unmodified lines | ||
| 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; |
| @@ -177,7 +177,7 @@ static int mmp_sspa_set_dai_fmt(struct snd_soc_dai *cpu_dai, · 176 unmodified lines | ||
| 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 | } |
| @@ -52,11 +52,11 @@ struct ssp_priv { · 51 unmodified lines | ||
| 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,7 +223,7 @@ static int pxa_ssp_set_dai_sysclk(struct snd_soc_dai *cpu_dai, · 160 unmodified lines | ||
| 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,7 +316,7 @@ static int pxa_ssp_set_pll(struct ssp_priv *priv, unsigned int freq) · 86 unmodified lines | ||
| 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,7 +687,7 @@ static int pxa_ssp_hw_params(struct snd_pcm_substream *substream, · 364 unmodified lines | ||
| 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 | |