]> git.baikalelectronics.ru Git - kernel.git/commitdiff
spi: pxa2xx: No need to keep pointer to platform device
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fri, 18 Oct 2019 10:54:25 +0000 (13:54 +0300)
committerMark Brown <broonie@kernel.org>
Fri, 18 Oct 2019 17:24:50 +0000 (18:24 +0100)
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>
arch/arm/plat-pxa/ssp.c
drivers/spi/spi-pxa2xx.c
include/linux/pxa2xx_ssp.h
sound/soc/pxa/mmp-sspa.c
sound/soc/pxa/pxa-ssp.c

index 9a6e4923bd69b75eb637f16293dbc24049d0f7a2..563440315acd31437c77ff19aca8af2e575e16d4 100644 (file)
@@ -89,7 +89,7 @@ void pxa_ssp_free(struct ssp_device *ssp)
                ssp->use_count--;
                ssp->label = NULL;
        } else
-               dev_err(&ssp->pdev->dev, "device already free\n");
+               dev_err(ssp->dev, "device already free\n");
        mutex_unlock(&ssp_lock);
 }
 EXPORT_SYMBOL(pxa_ssp_free);
@@ -118,7 +118,7 @@ static int pxa_ssp_probe(struct platform_device *pdev)
        if (ssp == NULL)
                return -ENOMEM;
 
-       ssp->pdev = pdev;
+       ssp->dev = dev;
 
        ssp->clk = devm_clk_get(dev, NULL);
        if (IS_ERR(ssp->clk))
index bb6a14d1ab0f929d6e4573573be92db15e631acc..59d1406a9c9658448a14f072ea21cd6171cf1b9c 100644 (file)
@@ -1567,7 +1567,7 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev)
        ssp->clk = devm_clk_get(&pdev->dev, NULL);
        ssp->irq = platform_get_irq(pdev, 0);
        ssp->type = type;
-       ssp->pdev = pdev;
+       ssp->dev = &pdev->dev;
        ssp->port_id = pxa2xx_spi_get_port_id(adev);
 
        pdata->is_slave = of_property_read_bool(pdev->dev.of_node, "spi-slave");
index a5d1837e4f35fb0b8965da499eb916f89a23ad34..6facf27865f98ecfc910bf522990ee8af453981a 100644 (file)
@@ -206,7 +206,7 @@ enum pxa_ssp_type {
 };
 
 struct ssp_device {
-       struct platform_device *pdev;
+       struct device   *dev;
        struct list_head        node;
 
        struct clk      *clk;
index e3e5425b5c62cd86b2470db944f68be131f0305f..e701637a9ae96b314a52f991af7df1f557c0f9b2 100644 (file)
@@ -177,7 +177,7 @@ static int mmp_sspa_set_dai_fmt(struct snd_soc_dai *cpu_dai,
        /* we can only change the settings if the port is not in use */
        if ((mmp_sspa_read_reg(sspa, SSPA_TXSP) & SSPA_SP_S_EN) ||
            (mmp_sspa_read_reg(sspa, SSPA_RXSP) & SSPA_SP_S_EN)) {
-               dev_err(&sspa->pdev->dev,
+               dev_err(sspa->dev,
                        "can't change hardware dai format: stream is in use\n");
                return -EINVAL;
        }
index 5fdd1a24c232de521b4d119a13fc57eb8a7f917f..6c5201431f6ec0af01328aaffc9ee1a1058b2104 100644 (file)
@@ -52,11 +52,11 @@ struct ssp_priv {
 
 static void dump_registers(struct ssp_device *ssp)
 {
-       dev_dbg(&ssp->pdev->dev, "SSCR0 0x%08x SSCR1 0x%08x SSTO 0x%08x\n",
+       dev_dbg(ssp->dev, "SSCR0 0x%08x SSCR1 0x%08x SSTO 0x%08x\n",
                 pxa_ssp_read_reg(ssp, SSCR0), pxa_ssp_read_reg(ssp, SSCR1),
                 pxa_ssp_read_reg(ssp, SSTO));
 
-       dev_dbg(&ssp->pdev->dev, "SSPSP 0x%08x SSSR 0x%08x SSACD 0x%08x\n",
+       dev_dbg(ssp->dev, "SSPSP 0x%08x SSSR 0x%08x SSACD 0x%08x\n",
                 pxa_ssp_read_reg(ssp, SSPSP), pxa_ssp_read_reg(ssp, SSSR),
                 pxa_ssp_read_reg(ssp, SSACD));
 }
@@ -223,7 +223,7 @@ static int pxa_ssp_set_dai_sysclk(struct snd_soc_dai *cpu_dai,
                clk_id = PXA_SSP_CLK_EXT;
        }
 
-       dev_dbg(&ssp->pdev->dev,
+       dev_dbg(ssp->dev,
                "pxa_ssp_set_dai_sysclk id: %d, clk_id %d, freq %u\n",
                cpu_dai->id, clk_id, freq);
 
@@ -316,7 +316,7 @@ static int pxa_ssp_set_pll(struct ssp_priv *priv, unsigned int freq)
 
                        ssacd |= (0x6 << 4);
 
-                       dev_dbg(&ssp->pdev->dev,
+                       dev_dbg(ssp->dev,
                                "Using SSACDD %x to supply %uHz\n",
                                val, freq);
                        break;
@@ -687,7 +687,7 @@ static int pxa_ssp_hw_params(struct snd_pcm_substream *substream,
         * - complain loudly and fail if they've not been set up yet.
         */
        if ((sscr0 & SSCR0_MOD) && !ttsa) {
-               dev_err(&ssp->pdev->dev, "No TDM timeslot configured\n");
+               dev_err(ssp->dev, "No TDM timeslot configured\n");
                return -EINVAL;
        }