aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-fsl-spi.c
diff options
context:
space:
mode:
authorJingoo Han <jg1.han@samsung.com>2013-07-30 03:58:59 -0400
committerMark Brown <broonie@linaro.org>2013-08-29 08:56:23 -0400
commit8074cf063e410a2c0cf1704c3b31002e21f5df7c (patch)
tree95916834ce2302ed113ecba7622dc09091eb6709 /drivers/spi/spi-fsl-spi.c
parenta4f2ca3e62e6c06f105d7953feeca2a403bdbee3 (diff)
spi: use dev_get_platdata()
Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/spi/spi-fsl-spi.c')
-rw-r--r--drivers/spi/spi-fsl-spi.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/spi/spi-fsl-spi.c b/drivers/spi/spi-fsl-spi.c
index 41e89c3e3edc..bbc94294891c 100644
--- a/drivers/spi/spi-fsl-spi.c
+++ b/drivers/spi/spi-fsl-spi.c
@@ -574,7 +574,7 @@ static void fsl_spi_grlib_cs_control(struct spi_device *spi, bool on)
574 574
575static void fsl_spi_grlib_probe(struct device *dev) 575static void fsl_spi_grlib_probe(struct device *dev)
576{ 576{
577 struct fsl_spi_platform_data *pdata = dev->platform_data; 577 struct fsl_spi_platform_data *pdata = dev_get_platdata(dev);
578 struct spi_master *master = dev_get_drvdata(dev); 578 struct spi_master *master = dev_get_drvdata(dev);
579 struct mpc8xxx_spi *mpc8xxx_spi = spi_master_get_devdata(master); 579 struct mpc8xxx_spi *mpc8xxx_spi = spi_master_get_devdata(master);
580 struct fsl_spi_reg *reg_base = mpc8xxx_spi->reg_base; 580 struct fsl_spi_reg *reg_base = mpc8xxx_spi->reg_base;
@@ -600,7 +600,7 @@ static void fsl_spi_grlib_probe(struct device *dev)
600static struct spi_master * fsl_spi_probe(struct device *dev, 600static struct spi_master * fsl_spi_probe(struct device *dev,
601 struct resource *mem, unsigned int irq) 601 struct resource *mem, unsigned int irq)
602{ 602{
603 struct fsl_spi_platform_data *pdata = dev->platform_data; 603 struct fsl_spi_platform_data *pdata = dev_get_platdata(dev);
604 struct spi_master *master; 604 struct spi_master *master;
605 struct mpc8xxx_spi *mpc8xxx_spi; 605 struct mpc8xxx_spi *mpc8xxx_spi;
606 struct fsl_spi_reg *reg_base; 606 struct fsl_spi_reg *reg_base;
@@ -700,7 +700,8 @@ err:
700static void fsl_spi_cs_control(struct spi_device *spi, bool on) 700static void fsl_spi_cs_control(struct spi_device *spi, bool on)
701{ 701{
702 struct device *dev = spi->dev.parent->parent; 702 struct device *dev = spi->dev.parent->parent;
703 struct mpc8xxx_spi_probe_info *pinfo = to_of_pinfo(dev->platform_data); 703 struct fsl_spi_platform_data *pdata = dev_get_platdata(dev);
704 struct mpc8xxx_spi_probe_info *pinfo = to_of_pinfo(pdata);
704 u16 cs = spi->chip_select; 705 u16 cs = spi->chip_select;
705 int gpio = pinfo->gpios[cs]; 706 int gpio = pinfo->gpios[cs];
706 bool alow = pinfo->alow_flags[cs]; 707 bool alow = pinfo->alow_flags[cs];
@@ -711,7 +712,7 @@ static void fsl_spi_cs_control(struct spi_device *spi, bool on)
711static int of_fsl_spi_get_chipselects(struct device *dev) 712static int of_fsl_spi_get_chipselects(struct device *dev)
712{ 713{
713 struct device_node *np = dev->of_node; 714 struct device_node *np = dev->of_node;
714 struct fsl_spi_platform_data *pdata = dev->platform_data; 715 struct fsl_spi_platform_data *pdata = dev_get_platdata(dev);
715 struct mpc8xxx_spi_probe_info *pinfo = to_of_pinfo(pdata); 716 struct mpc8xxx_spi_probe_info *pinfo = to_of_pinfo(pdata);
716 int ngpios; 717 int ngpios;
717 int i = 0; 718 int i = 0;
@@ -790,7 +791,7 @@ err_alloc_flags:
790 791
791static int of_fsl_spi_free_chipselects(struct device *dev) 792static int of_fsl_spi_free_chipselects(struct device *dev)
792{ 793{
793 struct fsl_spi_platform_data *pdata = dev->platform_data; 794 struct fsl_spi_platform_data *pdata = dev_get_platdata(dev);
794 struct mpc8xxx_spi_probe_info *pinfo = to_of_pinfo(pdata); 795 struct mpc8xxx_spi_probe_info *pinfo = to_of_pinfo(pdata);
795 int i; 796 int i;
796 797
@@ -889,7 +890,7 @@ static int plat_mpc8xxx_spi_probe(struct platform_device *pdev)
889 int irq; 890 int irq;
890 struct spi_master *master; 891 struct spi_master *master;
891 892
892 if (!pdev->dev.platform_data) 893 if (!dev_get_platdata(&pdev->dev))
893 return -EINVAL; 894 return -EINVAL;
894 895
895 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); 896 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);