Merge remote-tracking branch 'spi/topic/pdata' into spi-next

This commit is contained in:
Mark Brown
2013-09-01 13:49:03 +01:00
30 changed files with 125 additions and 160 deletions
+1 -1
View File
@@ -200,7 +200,7 @@ static irqreturn_t altera_spi_irq(int irq, void *dev)
static int altera_spi_probe(struct platform_device *pdev) static int altera_spi_probe(struct platform_device *pdev)
{ {
struct altera_spi_platform_data *platp = pdev->dev.platform_data; struct altera_spi_platform_data *platp = dev_get_platdata(&pdev->dev);
struct altera_spi *hw; struct altera_spi *hw;
struct spi_master *master; struct spi_master *master;
struct resource *res; struct resource *res;
+1 -1
View File
@@ -221,7 +221,7 @@ static int ath79_spi_probe(struct platform_device *pdev)
sp = spi_master_get_devdata(master); sp = spi_master_get_devdata(master);
platform_set_drvdata(pdev, sp); platform_set_drvdata(pdev, sp);
pdata = pdev->dev.platform_data; pdata = dev_get_platdata(&pdev->dev);
master->bits_per_word_mask = SPI_BPW_RANGE_MASK(1, 32); master->bits_per_word_mask = SPI_BPW_RANGE_MASK(1, 32);
master->setup = ath79_spi_setup; master->setup = ath79_spi_setup;
+1 -1
View File
@@ -776,7 +776,7 @@ static int au1550_spi_probe(struct platform_device *pdev)
hw = spi_master_get_devdata(master); hw = spi_master_get_devdata(master);
hw->master = spi_master_get(master); hw->master = spi_master_get(master);
hw->pdata = pdev->dev.platform_data; hw->pdata = dev_get_platdata(&pdev->dev);
hw->dev = &pdev->dev; hw->dev = &pdev->dev;
if (hw->pdata == NULL) { if (hw->pdata == NULL) {
+3 -5
View File
@@ -353,7 +353,7 @@ static int bcm63xx_spi_probe(struct platform_device *pdev)
{ {
struct resource *r; struct resource *r;
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct bcm63xx_spi_pdata *pdata = pdev->dev.platform_data; struct bcm63xx_spi_pdata *pdata = dev_get_platdata(&pdev->dev);
int irq; int irq;
struct spi_master *master; struct spi_master *master;
struct clk *clk; struct clk *clk;
@@ -474,8 +474,7 @@ static int bcm63xx_spi_remove(struct platform_device *pdev)
#ifdef CONFIG_PM #ifdef CONFIG_PM
static int bcm63xx_spi_suspend(struct device *dev) static int bcm63xx_spi_suspend(struct device *dev)
{ {
struct spi_master *master = struct spi_master *master = dev_get_drvdata(dev);
platform_get_drvdata(to_platform_device(dev));
struct bcm63xx_spi *bs = spi_master_get_devdata(master); struct bcm63xx_spi *bs = spi_master_get_devdata(master);
spi_master_suspend(master); spi_master_suspend(master);
@@ -487,8 +486,7 @@ static int bcm63xx_spi_suspend(struct device *dev)
static int bcm63xx_spi_resume(struct device *dev) static int bcm63xx_spi_resume(struct device *dev)
{ {
struct spi_master *master = struct spi_master *master = dev_get_drvdata(dev);
platform_get_drvdata(to_platform_device(dev));
struct bcm63xx_spi *bs = spi_master_get_devdata(master); struct bcm63xx_spi *bs = spi_master_get_devdata(master);
clk_prepare_enable(bs->clk); clk_prepare_enable(bs->clk);
+1 -1
View File
@@ -756,7 +756,7 @@ static int bfin_sport_spi_probe(struct platform_device *pdev)
struct bfin_sport_spi_master_data *drv_data; struct bfin_sport_spi_master_data *drv_data;
int status; int status;
platform_info = dev->platform_data; platform_info = dev_get_platdata(dev);
/* Allocate master with space for drv_data */ /* Allocate master with space for drv_data */
master = spi_alloc_master(dev, sizeof(*master) + 16); master = spi_alloc_master(dev, sizeof(*master) + 16);
+1 -1
View File
@@ -773,7 +773,7 @@ static irqreturn_t bfin_spi_rx_dma_isr(int irq, void *dev_id)
static int bfin_spi_probe(struct platform_device *pdev) static int bfin_spi_probe(struct platform_device *pdev)
{ {
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct bfin_spi3_master *info = dev->platform_data; struct bfin_spi3_master *info = dev_get_platdata(dev);
struct spi_master *master; struct spi_master *master;
struct bfin_spi_master *drv_data; struct bfin_spi_master *drv_data;
struct resource *mem, *res; struct resource *mem, *res;
+1 -1
View File
@@ -1271,7 +1271,7 @@ static int bfin_spi_probe(struct platform_device *pdev)
struct resource *res; struct resource *res;
int status = 0; int status = 0;
platform_info = dev->platform_data; platform_info = dev_get_platdata(dev);
/* Allocate master with space for drv_data */ /* Allocate master with space for drv_data */
master = spi_alloc_master(dev, sizeof(*drv_data)); master = spi_alloc_master(dev, sizeof(*drv_data));
+3 -3
View File
@@ -400,7 +400,7 @@ static int mcfqspi_probe(struct platform_device *pdev)
struct mcfqspi_platform_data *pdata; struct mcfqspi_platform_data *pdata;
int status; int status;
pdata = pdev->dev.platform_data; pdata = dev_get_platdata(&pdev->dev);
if (!pdata) { if (!pdata) {
dev_dbg(&pdev->dev, "platform data is missing\n"); dev_dbg(&pdev->dev, "platform data is missing\n");
return -ENOENT; return -ENOENT;
@@ -558,7 +558,7 @@ static int mcfqspi_resume(struct device *dev)
#ifdef CONFIG_PM_RUNTIME #ifdef CONFIG_PM_RUNTIME
static int mcfqspi_runtime_suspend(struct device *dev) static int mcfqspi_runtime_suspend(struct device *dev)
{ {
struct mcfqspi *mcfqspi = platform_get_drvdata(to_platform_device(dev)); struct mcfqspi *mcfqspi = dev_get_drvdata(dev);
clk_disable(mcfqspi->clk); clk_disable(mcfqspi->clk);
@@ -567,7 +567,7 @@ static int mcfqspi_runtime_suspend(struct device *dev)
static int mcfqspi_runtime_resume(struct device *dev) static int mcfqspi_runtime_resume(struct device *dev)
{ {
struct mcfqspi *mcfqspi = platform_get_drvdata(to_platform_device(dev)); struct mcfqspi *mcfqspi = dev_get_drvdata(dev);
clk_enable(mcfqspi->clk); clk_enable(mcfqspi->clk);
+2 -2
View File
@@ -872,8 +872,8 @@ static int davinci_spi_probe(struct platform_device *pdev)
goto free_master; goto free_master;
} }
if (pdev->dev.platform_data) { if (dev_get_platdata(&pdev->dev)) {
pdata = pdev->dev.platform_data; pdata = dev_get_platdata(&pdev->dev);
dspi->pdata = *pdata; dspi->pdata = *pdata;
} else { } else {
/* update dspi pdata with that from the DT */ /* update dspi pdata with that from the DT */
+1 -1
View File
@@ -874,7 +874,7 @@ static int ep93xx_spi_probe(struct platform_device *pdev)
int irq; int irq;
int error; int error;
info = pdev->dev.platform_data; info = dev_get_platdata(&pdev->dev);
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0) {
+2 -2
View File
@@ -584,7 +584,7 @@ static void fsl_espi_remove(struct mpc8xxx_spi *mspi)
static struct spi_master * fsl_espi_probe(struct device *dev, static struct spi_master * fsl_espi_probe(struct device *dev,
struct resource *mem, unsigned int irq) struct resource *mem, unsigned int irq)
{ {
struct fsl_spi_platform_data *pdata = dev->platform_data; struct fsl_spi_platform_data *pdata = dev_get_platdata(dev);
struct spi_master *master; struct spi_master *master;
struct mpc8xxx_spi *mpc8xxx_spi; struct mpc8xxx_spi *mpc8xxx_spi;
struct fsl_espi_reg *reg_base; struct fsl_espi_reg *reg_base;
@@ -665,7 +665,7 @@ err:
static int of_fsl_espi_get_chipselects(struct device *dev) static int of_fsl_espi_get_chipselects(struct device *dev)
{ {
struct device_node *np = dev->of_node; struct device_node *np = dev->of_node;
struct fsl_spi_platform_data *pdata = dev->platform_data; struct fsl_spi_platform_data *pdata = dev_get_platdata(dev);
const u32 *prop; const u32 *prop;
int len; int len;
+1 -1
View File
@@ -122,7 +122,7 @@ const char *mpc8xxx_spi_strmode(unsigned int flags)
int mpc8xxx_spi_probe(struct device *dev, struct resource *mem, int mpc8xxx_spi_probe(struct device *dev, struct resource *mem,
unsigned int irq) unsigned int irq)
{ {
struct fsl_spi_platform_data *pdata = dev->platform_data; struct fsl_spi_platform_data *pdata = dev_get_platdata(dev);
struct spi_master *master; struct spi_master *master;
struct mpc8xxx_spi *mpc8xxx_spi; struct mpc8xxx_spi *mpc8xxx_spi;
int ret = 0; int ret = 0;
+7 -6
View File
@@ -574,7 +574,7 @@ static void fsl_spi_grlib_cs_control(struct spi_device *spi, bool on)
static void fsl_spi_grlib_probe(struct device *dev) static void fsl_spi_grlib_probe(struct device *dev)
{ {
struct fsl_spi_platform_data *pdata = dev->platform_data; struct fsl_spi_platform_data *pdata = dev_get_platdata(dev);
struct spi_master *master = dev_get_drvdata(dev); struct spi_master *master = dev_get_drvdata(dev);
struct mpc8xxx_spi *mpc8xxx_spi = spi_master_get_devdata(master); struct mpc8xxx_spi *mpc8xxx_spi = spi_master_get_devdata(master);
struct fsl_spi_reg *reg_base = mpc8xxx_spi->reg_base; struct fsl_spi_reg *reg_base = mpc8xxx_spi->reg_base;
@@ -600,7 +600,7 @@ static void fsl_spi_grlib_probe(struct device *dev)
static struct spi_master * fsl_spi_probe(struct device *dev, static struct spi_master * fsl_spi_probe(struct device *dev,
struct resource *mem, unsigned int irq) struct resource *mem, unsigned int irq)
{ {
struct fsl_spi_platform_data *pdata = dev->platform_data; struct fsl_spi_platform_data *pdata = dev_get_platdata(dev);
struct spi_master *master; struct spi_master *master;
struct mpc8xxx_spi *mpc8xxx_spi; struct mpc8xxx_spi *mpc8xxx_spi;
struct fsl_spi_reg *reg_base; struct fsl_spi_reg *reg_base;
@@ -700,7 +700,8 @@ err:
static void fsl_spi_cs_control(struct spi_device *spi, bool on) static void fsl_spi_cs_control(struct spi_device *spi, bool on)
{ {
struct device *dev = spi->dev.parent->parent; struct device *dev = spi->dev.parent->parent;
struct mpc8xxx_spi_probe_info *pinfo = to_of_pinfo(dev->platform_data); struct fsl_spi_platform_data *pdata = dev_get_platdata(dev);
struct mpc8xxx_spi_probe_info *pinfo = to_of_pinfo(pdata);
u16 cs = spi->chip_select; u16 cs = spi->chip_select;
int gpio = pinfo->gpios[cs]; int gpio = pinfo->gpios[cs];
bool alow = pinfo->alow_flags[cs]; bool alow = pinfo->alow_flags[cs];
@@ -711,7 +712,7 @@ static void fsl_spi_cs_control(struct spi_device *spi, bool on)
static int of_fsl_spi_get_chipselects(struct device *dev) static int of_fsl_spi_get_chipselects(struct device *dev)
{ {
struct device_node *np = dev->of_node; struct device_node *np = dev->of_node;
struct fsl_spi_platform_data *pdata = dev->platform_data; struct fsl_spi_platform_data *pdata = dev_get_platdata(dev);
struct mpc8xxx_spi_probe_info *pinfo = to_of_pinfo(pdata); struct mpc8xxx_spi_probe_info *pinfo = to_of_pinfo(pdata);
int ngpios; int ngpios;
int i = 0; int i = 0;
@@ -790,7 +791,7 @@ err_alloc_flags:
static int of_fsl_spi_free_chipselects(struct device *dev) static int of_fsl_spi_free_chipselects(struct device *dev)
{ {
struct fsl_spi_platform_data *pdata = dev->platform_data; struct fsl_spi_platform_data *pdata = dev_get_platdata(dev);
struct mpc8xxx_spi_probe_info *pinfo = to_of_pinfo(pdata); struct mpc8xxx_spi_probe_info *pinfo = to_of_pinfo(pdata);
int i; int i;
@@ -889,7 +890,7 @@ static int plat_mpc8xxx_spi_probe(struct platform_device *pdev)
int irq; int irq;
struct spi_master *master; struct spi_master *master;
if (!pdev->dev.platform_data) if (!dev_get_platdata(&pdev->dev))
return -EINVAL; return -EINVAL;
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+2 -2
View File
@@ -420,7 +420,7 @@ static int spi_gpio_probe(struct platform_device *pdev)
if (status > 0) if (status > 0)
use_of = 1; use_of = 1;
pdata = pdev->dev.platform_data; pdata = dev_get_platdata(&pdev->dev);
#ifdef GENERIC_BITBANG #ifdef GENERIC_BITBANG
if (!pdata || !pdata->num_chipselect) if (!pdata || !pdata->num_chipselect)
return -ENODEV; return -ENODEV;
@@ -506,7 +506,7 @@ static int spi_gpio_remove(struct platform_device *pdev)
int status; int status;
spi_gpio = platform_get_drvdata(pdev); spi_gpio = platform_get_drvdata(pdev);
pdata = pdev->dev.platform_data; pdata = dev_get_platdata(&pdev->dev);
/* stop() unregisters child devices too */ /* stop() unregisters child devices too */
status = spi_bitbang_stop(&spi_gpio->bitbang); status = spi_bitbang_stop(&spi_gpio->bitbang);
+1 -1
View File
@@ -469,7 +469,7 @@ static int mpc512x_psc_spi_do_probe(struct device *dev, u32 regaddr,
u32 size, unsigned int irq, u32 size, unsigned int irq,
s16 bus_num) s16 bus_num)
{ {
struct fsl_spi_platform_data *pdata = dev->platform_data; struct fsl_spi_platform_data *pdata = dev_get_platdata(dev);
struct mpc512x_psc_spi *mps; struct mpc512x_psc_spi *mps;
struct spi_master *master; struct spi_master *master;
int ret; int ret;
+1 -1
View File
@@ -366,7 +366,7 @@ static irqreturn_t mpc52xx_psc_spi_isr(int irq, void *dev_id)
static int mpc52xx_psc_spi_do_probe(struct device *dev, u32 regaddr, static int mpc52xx_psc_spi_do_probe(struct device *dev, u32 regaddr,
u32 size, unsigned int irq, s16 bus_num) u32 size, unsigned int irq, s16 bus_num)
{ {
struct fsl_spi_platform_data *pdata = dev->platform_data; struct fsl_spi_platform_data *pdata = dev_get_platdata(dev);
struct mpc52xx_psc_spi *mps; struct mpc52xx_psc_spi *mps;
struct spi_master *master; struct spi_master *master;
int ret; int ret;
+1 -1
View File
@@ -350,7 +350,7 @@ static int nuc900_spi_probe(struct platform_device *pdev)
hw = spi_master_get_devdata(master); hw = spi_master_get_devdata(master);
hw->master = spi_master_get(master); hw->master = spi_master_get(master);
hw->pdata = pdev->dev.platform_data; hw->pdata = dev_get_platdata(&pdev->dev);
hw->dev = &pdev->dev; hw->dev = &pdev->dev;
if (hw->pdata == NULL) { if (hw->pdata == NULL) {
+1 -1
View File
@@ -285,7 +285,7 @@ static int tiny_spi_of_probe(struct platform_device *pdev)
static int tiny_spi_probe(struct platform_device *pdev) static int tiny_spi_probe(struct platform_device *pdev)
{ {
struct tiny_spi_platform_data *platp = pdev->dev.platform_data; struct tiny_spi_platform_data *platp = dev_get_platdata(&pdev->dev);
struct tiny_spi *hw; struct tiny_spi *hw;
struct spi_master *master; struct spi_master *master;
struct resource *res; struct resource *res;
+1 -1
View File
@@ -441,7 +441,7 @@ static int omap1_spi100k_probe(struct platform_device *pdev)
* You should allocate this with ioremap() before initializing * You should allocate this with ioremap() before initializing
* the SPI. * the SPI.
*/ */
spi100k->base = (void __iomem *) pdev->dev.platform_data; spi100k->base = (void __iomem *)dev_get_platdata(&pdev->dev);
spi100k->ick = devm_clk_get(&pdev->dev, "ick"); spi100k->ick = devm_clk_get(&pdev->dev, "ick");
if (IS_ERR(spi100k->ick)) { if (IS_ERR(spi100k->ick)) {
+1 -1
View File
@@ -1340,7 +1340,7 @@ static int omap2_mcspi_probe(struct platform_device *pdev)
if (of_get_property(node, "ti,pindir-d0-out-d1-in", NULL)) if (of_get_property(node, "ti,pindir-d0-out-d1-in", NULL))
mcspi->pin_dir = MCSPI_PINDIR_D0_OUT_D1_IN; mcspi->pin_dir = MCSPI_PINDIR_D0_OUT_D1_IN;
} else { } else {
pdata = pdev->dev.platform_data; pdata = dev_get_platdata(&pdev->dev);
master->num_chipselect = pdata->num_cs; master->num_chipselect = pdata->num_cs;
if (pdev->id != -1) if (pdev->id != -1)
master->bus_num = pdev->id; master->bus_num = pdev->id;

Some files were not shown because too many files have changed in this diff Show More