diff options
Diffstat (limited to 'drivers/spi')
-rw-r--r-- | drivers/spi/cadence_qspi.c | 12 | ||||
-rw-r--r-- | drivers/spi/cf_spi.c | 2 | ||||
-rw-r--r-- | drivers/spi/davinci_spi.c | 4 | ||||
-rw-r--r-- | drivers/spi/designware_spi.c | 4 | ||||
-rw-r--r-- | drivers/spi/exynos_spi.c | 4 | ||||
-rw-r--r-- | drivers/spi/fsl_dspi.c | 10 | ||||
-rw-r--r-- | drivers/spi/fsl_espi.c | 2 | ||||
-rw-r--r-- | drivers/spi/fsl_qspi.c | 2 | ||||
-rw-r--r-- | drivers/spi/ich.c | 11 | ||||
-rw-r--r-- | drivers/spi/ich.h | 11 | ||||
-rw-r--r-- | drivers/spi/mxs_spi.c | 4 | ||||
-rw-r--r-- | drivers/spi/pl022_spi.c | 2 | ||||
-rw-r--r-- | drivers/spi/rk_spi.c | 8 | ||||
-rw-r--r-- | drivers/spi/soft_spi.c | 4 | ||||
-rw-r--r-- | drivers/spi/spi-uclass.c | 2 | ||||
-rw-r--r-- | drivers/spi/tegra114_spi.c | 4 | ||||
-rw-r--r-- | drivers/spi/tegra20_sflash.c | 4 | ||||
-rw-r--r-- | drivers/spi/tegra20_slink.c | 4 | ||||
-rw-r--r-- | drivers/spi/tegra210_qspi.c | 4 | ||||
-rw-r--r-- | drivers/spi/uniphier_spi.c | 8 | ||||
-rw-r--r-- | drivers/spi/zynq_qspi.c | 4 | ||||
-rw-r--r-- | drivers/spi/zynq_spi.c | 8 | ||||
-rw-r--r-- | drivers/spi/zynqmp_gqspi.c | 6 |
23 files changed, 63 insertions, 61 deletions
diff --git a/drivers/spi/cadence_qspi.c b/drivers/spi/cadence_qspi.c index b746501f5ff..67980431ba0 100644 --- a/drivers/spi/cadence_qspi.c +++ b/drivers/spi/cadence_qspi.c @@ -27,7 +27,7 @@ static int cadence_spi_write_speed(struct udevice *bus, uint hz) { - struct cadence_spi_plat *plat = bus->plat; + struct cadence_spi_plat *plat = dev_get_plat(bus); struct cadence_spi_priv *priv = dev_get_priv(bus); cadence_qspi_apb_config_baudrate_div(priv->regbase, @@ -130,7 +130,7 @@ static int spi_calibration(struct udevice *bus, uint hz) static int cadence_spi_set_speed(struct udevice *bus, uint hz) { - struct cadence_spi_plat *plat = bus->plat; + struct cadence_spi_plat *plat = dev_get_plat(bus); struct cadence_spi_priv *priv = dev_get_priv(bus); int err; @@ -165,7 +165,7 @@ static int cadence_spi_set_speed(struct udevice *bus, uint hz) static int cadence_spi_probe(struct udevice *bus) { - struct cadence_spi_plat *plat = bus->plat; + struct cadence_spi_plat *plat = dev_get_plat(bus); struct cadence_spi_priv *priv = dev_get_priv(bus); struct clk clk; int ret; @@ -212,7 +212,7 @@ static int cadence_spi_remove(struct udevice *dev) static int cadence_spi_set_mode(struct udevice *bus, uint mode) { - struct cadence_spi_plat *plat = bus->plat; + struct cadence_spi_plat *plat = dev_get_plat(bus); struct cadence_spi_priv *priv = dev_get_priv(bus); /* Disable QSPI */ @@ -235,7 +235,7 @@ static int cadence_spi_mem_exec_op(struct spi_slave *spi, const struct spi_mem_op *op) { struct udevice *bus = spi->dev->parent; - struct cadence_spi_plat *plat = bus->plat; + struct cadence_spi_plat *plat = dev_get_plat(bus); struct cadence_spi_priv *priv = dev_get_priv(bus); void *base = priv->regbase; int err = 0; @@ -284,7 +284,7 @@ static int cadence_spi_mem_exec_op(struct spi_slave *spi, static int cadence_spi_of_to_plat(struct udevice *bus) { - struct cadence_spi_plat *plat = bus->plat; + struct cadence_spi_plat *plat = dev_get_plat(bus); ofnode subnode; plat->regbase = (void *)devfdt_get_addr_index(bus, 0); diff --git a/drivers/spi/cf_spi.c b/drivers/spi/cf_spi.c index 8adff63edc6..298f350ef39 100644 --- a/drivers/spi/cf_spi.c +++ b/drivers/spi/cf_spi.c @@ -387,7 +387,7 @@ static int coldfire_spi_probe(struct udevice *bus) static int coldfire_dspi_of_to_plat(struct udevice *bus) { fdt_addr_t addr; - struct coldfire_spi_plat *plat = bus->plat; + struct coldfire_spi_plat *plat = dev_get_plat(bus); const void *blob = gd->fdt_blob; int node = dev_of_offset(bus); int *ctar, len; diff --git a/drivers/spi/davinci_spi.c b/drivers/spi/davinci_spi.c index ea088ebd2cb..53a791ea292 100644 --- a/drivers/spi/davinci_spi.c +++ b/drivers/spi/davinci_spi.c @@ -383,7 +383,7 @@ static const struct dm_spi_ops davinci_spi_ops = { static int davinci_spi_probe(struct udevice *bus) { struct davinci_spi_slave *ds = dev_get_priv(bus); - struct davinci_spi_plat *plat = bus->plat; + struct davinci_spi_plat *plat = dev_get_plat(bus); ds->regs = plat->regs; ds->num_cs = plat->num_cs; @@ -393,7 +393,7 @@ static int davinci_spi_probe(struct udevice *bus) #if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA) static int davinci_ofdata_to_platadata(struct udevice *bus) { - struct davinci_spi_plat *plat = bus->plat; + struct davinci_spi_plat *plat = dev_get_plat(bus); fdt_addr_t addr; addr = dev_read_addr(bus); diff --git a/drivers/spi/designware_spi.c b/drivers/spi/designware_spi.c index 88e638c950c..742121140de 100644 --- a/drivers/spi/designware_spi.c +++ b/drivers/spi/designware_spi.c @@ -230,7 +230,7 @@ static int request_gpio_cs(struct udevice *bus) static int dw_spi_of_to_plat(struct udevice *bus) { - struct dw_spi_plat *plat = bus->plat; + struct dw_spi_plat *plat = dev_get_plat(bus); plat->regs = dev_read_addr_ptr(bus); if (!plat->regs) @@ -665,7 +665,7 @@ static const struct spi_controller_mem_ops dw_spi_mem_ops = { static int dw_spi_set_speed(struct udevice *bus, uint speed) { - struct dw_spi_plat *plat = bus->plat; + struct dw_spi_plat *plat = dev_get_plat(bus); struct dw_spi_priv *priv = dev_get_priv(bus); u16 clk_div; diff --git a/drivers/spi/exynos_spi.c b/drivers/spi/exynos_spi.c index e4d2bade0f0..30b1a77a732 100644 --- a/drivers/spi/exynos_spi.c +++ b/drivers/spi/exynos_spi.c @@ -253,7 +253,7 @@ static void spi_cs_deactivate(struct udevice *dev) static int exynos_spi_of_to_plat(struct udevice *bus) { - struct exynos_spi_plat *plat = bus->plat; + struct exynos_spi_plat *plat = dev_get_plat(bus); const void *blob = gd->fdt_blob; int node = dev_of_offset(bus); @@ -368,7 +368,7 @@ static int exynos_spi_xfer(struct udevice *dev, unsigned int bitlen, static int exynos_spi_set_speed(struct udevice *bus, uint speed) { - struct exynos_spi_plat *plat = bus->plat; + struct exynos_spi_plat *plat = dev_get_plat(bus); struct exynos_spi_priv *priv = dev_get_priv(bus); int ret; diff --git a/drivers/spi/fsl_dspi.c b/drivers/spi/fsl_dspi.c index ddf4a9e413f..c17a5522bcc 100644 --- a/drivers/spi/fsl_dspi.c +++ b/drivers/spi/fsl_dspi.c @@ -460,8 +460,10 @@ static int fsl_dspi_child_pre_probe(struct udevice *dev) return -EINVAL; } - ofnode_read_u32(dev->node, "fsl,spi-cs-sck-delay", &cs_sck_delay); - ofnode_read_u32(dev->node, "fsl,spi-sck-cs-delay", &sck_cs_delay); + ofnode_read_u32(dev_ofnode(dev), "fsl,spi-cs-sck-delay", + &cs_sck_delay); + ofnode_read_u32(dev_ofnode(dev), "fsl,spi-sck-cs-delay", + &sck_cs_delay); /* Set PCS to SCK delay scale values */ ns_delay_scale(&pcssck, &cssck, cs_sck_delay, priv->bus_clk); @@ -486,7 +488,7 @@ static int fsl_dspi_probe(struct udevice *bus) struct dm_spi_bus *dm_spi_bus; uint mcr_cfg_val; - dm_spi_bus = bus->uclass_priv; + dm_spi_bus = dev_get_uclass_priv(bus); /* cpu speical pin muxing configure */ cpu_dspi_port_conf(); @@ -576,7 +578,7 @@ static int fsl_dspi_bind(struct udevice *bus) static int fsl_dspi_of_to_plat(struct udevice *bus) { fdt_addr_t addr; - struct fsl_dspi_plat *plat = bus->plat; + struct fsl_dspi_plat *plat = dev_get_plat(bus); const void *blob = gd->fdt_blob; int node = dev_of_offset(bus); diff --git a/drivers/spi/fsl_espi.c b/drivers/spi/fsl_espi.c index e9e7ffd6b53..abc28e37d2a 100644 --- a/drivers/spi/fsl_espi.c +++ b/drivers/spi/fsl_espi.c @@ -544,7 +544,7 @@ static const struct dm_spi_ops fsl_espi_ops = { static int fsl_espi_of_to_plat(struct udevice *bus) { fdt_addr_t addr; - struct fsl_espi_plat *plat = bus->plat; + struct fsl_espi_plat *plat = dev_get_plat(bus); const void *blob = gd->fdt_blob; int node = dev_of_offset(bus); diff --git a/drivers/spi/fsl_qspi.c b/drivers/spi/fsl_qspi.c index fc3b844370c..8bc7038a82a 100644 --- a/drivers/spi/fsl_qspi.c +++ b/drivers/spi/fsl_qspi.c @@ -795,7 +795,7 @@ static const struct spi_controller_mem_ops fsl_qspi_mem_ops = { static int fsl_qspi_probe(struct udevice *bus) { - struct dm_spi_bus *dm_bus = bus->uclass_priv; + struct dm_spi_bus *dm_bus = dev_get_uclass_priv(bus); struct fsl_qspi *q = dev_get_priv(bus); const void *blob = gd->fdt_blob; int node = dev_of_offset(bus); diff --git a/drivers/spi/ich.c b/drivers/spi/ich.c index e02850e9f22..1cd410493b0 100644 --- a/drivers/spi/ich.c +++ b/drivers/spi/ich.c @@ -38,17 +38,6 @@ #define debug_trace(x, args...) #endif -struct ich_spi_plat { -#if CONFIG_IS_ENABLED(OF_PLATDATA) - struct dtd_intel_fast_spi dtplat; -#endif - enum ich_version ich_version; /* Controller version, 7 or 9 */ - bool lockdown; /* lock down controller settings? */ - ulong mmio_base; /* Base of MMIO registers */ - pci_dev_t bdf; /* PCI address used by of-platdata */ - bool hwseq; /* Use hardware sequencing (not s/w) */ -}; - static u8 ich_readb(struct ich_spi_priv *priv, int reg) { u8 value = readb(priv->base + reg); diff --git a/drivers/spi/ich.h b/drivers/spi/ich.h index 23c7827740b..8fd150d44a4 100644 --- a/drivers/spi/ich.h +++ b/drivers/spi/ich.h @@ -230,4 +230,15 @@ struct ich_spi_priv { struct udevice *pch; /* PCH, used to control SPI access */ }; +struct ich_spi_plat { +#if CONFIG_IS_ENABLED(OF_PLATDATA) + struct dtd_intel_fast_spi dtplat; +#endif + enum ich_version ich_version; /* Controller version, 7 or 9 */ + bool lockdown; /* lock down controller settings? */ + ulong mmio_base; /* Base of MMIO registers */ + pci_dev_t bdf; /* PCI address used by of-platdata */ + bool hwseq; /* Use hardware sequencing (not s/w) */ +}; + #endif /* _ICH_H_ */ diff --git a/drivers/spi/mxs_spi.c b/drivers/spi/mxs_spi.c index 4fafe33af57..d41352a0bb8 100644 --- a/drivers/spi/mxs_spi.c +++ b/drivers/spi/mxs_spi.c @@ -443,7 +443,7 @@ static const struct dm_spi_ops mxs_spi_ops = { #if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA) static int mxs_of_to_plat(struct udevice *bus) { - struct mxs_spi_plat *plat = bus->plat; + struct mxs_spi_plat *plat = dev_get_plat(bus); u32 prop[2]; int ret; @@ -493,4 +493,4 @@ U_BOOT_DRIVER(fsl_imx23_spi) = { .probe = mxs_spi_probe, }; -U_BOOT_DRIVER_ALIAS(fsl_imx23_spi, fsl_imx28_spi) +DM_DRIVER_ALIAS(fsl_imx23_spi, fsl_imx28_spi) diff --git a/drivers/spi/pl022_spi.c b/drivers/spi/pl022_spi.c index 179582cad7d..133363ea7d9 100644 --- a/drivers/spi/pl022_spi.c +++ b/drivers/spi/pl022_spi.c @@ -288,7 +288,7 @@ static const struct dm_spi_ops pl022_spi_ops = { #if !CONFIG_IS_ENABLED(OF_PLATDATA) static int pl022_spi_of_to_plat(struct udevice *bus) { - struct pl022_spi_pdata *plat = bus->plat; + struct pl022_spi_pdata *plat = dev_get_plat(bus); const void *fdt = gd->fdt_blob; int node = dev_of_offset(bus); struct clk clkdev; diff --git a/drivers/spi/rk_spi.c b/drivers/spi/rk_spi.c index 44ac475c11d..40bd8851b7c 100644 --- a/drivers/spi/rk_spi.c +++ b/drivers/spi/rk_spi.c @@ -135,7 +135,7 @@ static int rkspi_wait_till_not_busy(struct rockchip_spi *regs) static void spi_cs_activate(struct udevice *dev, uint cs) { struct udevice *bus = dev->parent; - struct rockchip_spi_plat *plat = bus->plat; + struct rockchip_spi_plat *plat = dev_get_plat(bus); struct rockchip_spi_priv *priv = dev_get_priv(bus); struct rockchip_spi *regs = priv->regs; @@ -161,7 +161,7 @@ static void spi_cs_activate(struct udevice *dev, uint cs) static void spi_cs_deactivate(struct udevice *dev, uint cs) { struct udevice *bus = dev->parent; - struct rockchip_spi_plat *plat = bus->plat; + struct rockchip_spi_plat *plat = dev_get_plat(bus); struct rockchip_spi_priv *priv = dev_get_priv(bus); struct rockchip_spi *regs = priv->regs; @@ -176,7 +176,7 @@ static void spi_cs_deactivate(struct udevice *dev, uint cs) #if CONFIG_IS_ENABLED(OF_PLATDATA) static int conv_of_plat(struct udevice *dev) { - struct rockchip_spi_plat *plat = dev->plat; + struct rockchip_spi_plat *plat = dev_get_plat(dev); struct dtd_rockchip_rk3288_spi *dtplat = &plat->of_plat; struct rockchip_spi_priv *priv = dev_get_priv(dev); int ret; @@ -565,4 +565,4 @@ U_BOOT_DRIVER(rockchip_rk3288_spi) = { .probe = rockchip_spi_probe, }; -U_BOOT_DRIVER_ALIAS(rockchip_rk3288_spi, rockchip_rk3368_spi) +DM_DRIVER_ALIAS(rockchip_rk3288_spi, rockchip_rk3368_spi) diff --git a/drivers/spi/soft_spi.c b/drivers/spi/soft_spi.c index afc98bfb663..3425d9950a8 100644 --- a/drivers/spi/soft_spi.c +++ b/drivers/spi/soft_spi.c @@ -228,7 +228,7 @@ static const struct dm_spi_ops soft_spi_ops = { static int soft_spi_of_to_plat(struct udevice *dev) { - struct soft_spi_plat *plat = dev->plat; + struct soft_spi_plat *plat = dev_get_plat(dev); const void *blob = gd->fdt_blob; int node = dev_of_offset(dev); @@ -240,7 +240,7 @@ static int soft_spi_of_to_plat(struct udevice *dev) static int soft_spi_probe(struct udevice *dev) { struct spi_slave *slave = dev_get_parent_priv(dev); - struct soft_spi_plat *plat = dev->plat; + struct soft_spi_plat *plat = dev_get_plat(dev); int cs_flags, clk_flags; int ret; diff --git a/drivers/spi/spi-uclass.c b/drivers/spi/spi-uclass.c index 5d801fa54ba..3fe351f8a70 100644 --- a/drivers/spi/spi-uclass.c +++ b/drivers/spi/spi-uclass.c @@ -165,7 +165,7 @@ static int spi_child_post_bind(struct udevice *dev) { struct dm_spi_slave_plat *plat = dev_get_parent_plat(dev); - if (!dev_of_valid(dev)) + if (!dev_has_ofnode(dev)) return 0; return spi_slave_of_to_plat(dev, plat); diff --git a/drivers/spi/tegra114_spi.c b/drivers/spi/tegra114_spi.c index e1fd82bdfa3..f0256d8e664 100644 --- a/drivers/spi/tegra114_spi.c +++ b/drivers/spi/tegra114_spi.c @@ -99,7 +99,7 @@ struct tegra114_spi_priv { static int tegra114_spi_of_to_plat(struct udevice *bus) { - struct tegra_spi_plat *plat = bus->plat; + struct tegra_spi_plat *plat = dev_get_plat(bus); plat->base = dev_read_addr(bus); plat->periph_id = clock_decode_periph_id(bus); @@ -352,7 +352,7 @@ static int tegra114_spi_xfer(struct udevice *dev, unsigned int bitlen, static int tegra114_spi_set_speed(struct udevice *bus, uint speed) { - struct tegra_spi_plat *plat = bus->plat; + struct tegra_spi_plat *plat = dev_get_plat(bus); struct tegra114_spi_priv *priv = dev_get_priv(bus); if (speed > plat->frequency) diff --git a/drivers/spi/tegra20_sflash.c b/drivers/spi/tegra20_sflash.c index d38606100d0..4384a48ec84 100644 --- a/drivers/spi/tegra20_sflash.c +++ b/drivers/spi/tegra20_sflash.c @@ -89,7 +89,7 @@ int tegra20_sflash_cs_info(struct udevice *bus, unsigned int cs, static int tegra20_sflash_of_to_plat(struct udevice *bus) { - struct tegra_spi_plat *plat = bus->plat; + struct tegra_spi_plat *plat = dev_get_plat(bus); const void *blob = gd->fdt_blob; int node = dev_of_offset(bus); @@ -314,7 +314,7 @@ static int tegra20_sflash_xfer(struct udevice *dev, unsigned int bitlen, static int tegra20_sflash_set_speed(struct udevice *bus, uint speed) { - struct tegra_spi_plat *plat = bus->plat; + struct tegra_spi_plat *plat = dev_get_plat(bus); struct tegra20_sflash_priv *priv = dev_get_priv(bus); if (speed > plat->frequency) diff --git a/drivers/spi/tegra20_slink.c b/drivers/spi/tegra20_slink.c index b99ef38a143..3057fe1a222 100644 --- a/drivers/spi/tegra20_slink.c +++ b/drivers/spi/tegra20_slink.c @@ -95,7 +95,7 @@ struct tegra_spi_slave { static int tegra30_spi_of_to_plat(struct udevice *bus) { - struct tegra_spi_plat *plat = bus->plat; + struct tegra_spi_plat *plat = dev_get_plat(bus); const void *blob = gd->fdt_blob; int node = dev_of_offset(bus); @@ -314,7 +314,7 @@ static int tegra30_spi_xfer(struct udevice *dev, unsigned int bitlen, static int tegra30_spi_set_speed(struct udevice *bus, uint speed) { - struct tegra_spi_plat *plat = bus->plat; + struct tegra_spi_plat *plat = dev_get_plat(bus); struct tegra30_spi_priv *priv = dev_get_priv(bus); if (speed > plat->frequency) diff --git a/drivers/spi/tegra210_qspi.c b/drivers/spi/tegra210_qspi.c index a2a7f4614cb..b464b9ccb0e 100644 --- a/drivers/spi/tegra210_qspi.c +++ b/drivers/spi/tegra210_qspi.c @@ -99,7 +99,7 @@ struct tegra210_qspi_priv { static int tegra210_qspi_of_to_plat(struct udevice *bus) { - struct tegra_spi_plat *plat = bus->plat; + struct tegra_spi_plat *plat = dev_get_plat(bus); plat->base = dev_read_addr(bus); plat->periph_id = clock_decode_periph_id(bus); @@ -380,7 +380,7 @@ static int tegra210_qspi_xfer(struct udevice *dev, unsigned int bitlen, static int tegra210_qspi_set_speed(struct udevice *bus, uint speed) { - struct tegra_spi_plat *plat = bus->plat; + struct tegra_spi_plat *plat = dev_get_plat(bus); struct tegra210_qspi_priv *priv = dev_get_priv(bus); if (speed > plat->frequency) diff --git a/drivers/spi/uniphier_spi.c b/drivers/spi/uniphier_spi.c index 48b8430d3d8..e47ed5b221b 100644 --- a/drivers/spi/uniphier_spi.c +++ b/drivers/spi/uniphier_spi.c @@ -113,7 +113,7 @@ static void uniphier_spi_regdump(struct uniphier_spi_priv *priv) static void spi_cs_activate(struct udevice *dev) { struct udevice *bus = dev->parent; - struct uniphier_spi_plat *plat = bus->plat; + struct uniphier_spi_plat *plat = dev_get_plat(bus); struct uniphier_spi_priv *priv = dev_get_priv(bus); ulong delay_us; /* The delay completed so far */ u32 val; @@ -139,7 +139,7 @@ static void spi_cs_activate(struct udevice *dev) static void spi_cs_deactivate(struct udevice *dev) { struct udevice *bus = dev->parent; - struct uniphier_spi_plat *plat = bus->plat; + struct uniphier_spi_plat *plat = dev_get_plat(bus); struct uniphier_spi_priv *priv = dev_get_priv(bus); u32 val; @@ -279,7 +279,7 @@ static int uniphier_spi_xfer(struct udevice *dev, unsigned int bitlen, static int uniphier_spi_set_speed(struct udevice *bus, uint speed) { - struct uniphier_spi_plat *plat = bus->plat; + struct uniphier_spi_plat *plat = dev_get_plat(bus); struct uniphier_spi_priv *priv = dev_get_priv(bus); u32 val, ckdiv; @@ -364,7 +364,7 @@ static int uniphier_spi_set_mode(struct udevice *bus, uint mode) static int uniphier_spi_of_to_plat(struct udevice *bus) { - struct uniphier_spi_plat *plat = bus->plat; + struct uniphier_spi_plat *plat = dev_get_plat(bus); const void *blob = gd->fdt_blob; int node = dev_of_offset(bus); diff --git a/drivers/spi/zynq_qspi.c b/drivers/spi/zynq_qspi.c index 2fc28b6bee2..845f2d2f5f4 100644 --- a/drivers/spi/zynq_qspi.c +++ b/drivers/spi/zynq_qspi.c @@ -100,7 +100,7 @@ struct zynq_qspi_priv { static int zynq_qspi_of_to_plat(struct udevice *bus) { - struct zynq_qspi_plat *plat = bus->plat; + struct zynq_qspi_plat *plat = dev_get_plat(bus); const void *blob = gd->fdt_blob; int node = dev_of_offset(bus); @@ -592,7 +592,7 @@ static int zynq_qspi_xfer(struct udevice *dev, unsigned int bitlen, static int zynq_qspi_set_speed(struct udevice *bus, uint speed) { - struct zynq_qspi_plat *plat = bus->plat; + struct zynq_qspi_plat *plat = dev_get_plat(bus); struct zynq_qspi_priv *priv = dev_get_priv(bus); struct zynq_qspi_regs *regs = priv->regs; uint32_t confr; diff --git a/drivers/spi/zynq_spi.c b/drivers/spi/zynq_spi.c index a6efa4a1c83..2971e55f41b 100644 --- a/drivers/spi/zynq_spi.c +++ b/drivers/spi/zynq_spi.c @@ -75,7 +75,7 @@ struct zynq_spi_priv { static int zynq_spi_of_to_plat(struct udevice *bus) { - struct zynq_spi_plat *plat = bus->plat; + struct zynq_spi_plat *plat = dev_get_plat(bus); const void *blob = gd->fdt_blob; int node = dev_of_offset(bus); @@ -162,7 +162,7 @@ static int zynq_spi_probe(struct udevice *bus) static void spi_cs_activate(struct udevice *dev) { struct udevice *bus = dev->parent; - struct zynq_spi_plat *plat = bus->plat; + struct zynq_spi_plat *plat = dev_get_plat(bus); struct zynq_spi_priv *priv = dev_get_priv(bus); struct zynq_spi_regs *regs = priv->regs; u32 cr; @@ -193,7 +193,7 @@ static void spi_cs_activate(struct udevice *dev) static void spi_cs_deactivate(struct udevice *dev) { struct udevice *bus = dev->parent; - struct zynq_spi_plat *plat = bus->plat; + struct zynq_spi_plat *plat = dev_get_plat(bus); struct zynq_spi_priv *priv = dev_get_priv(bus); struct zynq_spi_regs *regs = priv->regs; @@ -296,7 +296,7 @@ static int zynq_spi_xfer(struct udevice *dev, unsigned int bitlen, static int zynq_spi_set_speed(struct udevice *bus, uint speed) { - struct zynq_spi_plat *plat = bus->plat; + struct zynq_spi_plat *plat = dev_get_plat(bus); struct zynq_spi_priv *priv = dev_get_priv(bus); struct zynq_spi_regs *regs = priv->regs; uint32_t confr; diff --git a/drivers/spi/zynqmp_gqspi.c b/drivers/spi/zynqmp_gqspi.c index f09c50757d4..c9e476eefac 100644 --- a/drivers/spi/zynqmp_gqspi.c +++ b/drivers/spi/zynqmp_gqspi.c @@ -177,7 +177,7 @@ struct zynqmp_qspi_priv { static int zynqmp_qspi_of_to_plat(struct udevice *bus) { - struct zynqmp_qspi_plat *plat = bus->plat; + struct zynqmp_qspi_plat *plat = dev_get_plat(bus); debug("%s\n", __func__); @@ -255,7 +255,7 @@ static void zynqmp_qspi_chipselect(struct zynqmp_qspi_priv *priv, int is_on) void zynqmp_qspi_set_tapdelay(struct udevice *bus, u32 baudrateval) { - struct zynqmp_qspi_plat *plat = bus->plat; + struct zynqmp_qspi_plat *plat = dev_get_plat(bus); struct zynqmp_qspi_priv *priv = dev_get_priv(bus); struct zynqmp_qspi_regs *regs = priv->regs; u32 tapdlybypass = 0, lpbkdlyadj = 0, datadlyadj = 0, clk_rate; @@ -295,7 +295,7 @@ void zynqmp_qspi_set_tapdelay(struct udevice *bus, u32 baudrateval) static int zynqmp_qspi_set_speed(struct udevice *bus, uint speed) { - struct zynqmp_qspi_plat *plat = bus->plat; + struct zynqmp_qspi_plat *plat = dev_get_plat(bus); struct zynqmp_qspi_priv *priv = dev_get_priv(bus); struct zynqmp_qspi_regs *regs = priv->regs; u32 confr; |