summaryrefslogtreecommitdiff
path: root/drivers/spi
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-12-22 19:30:28 -0700
committerSimon Glass <sjg@chromium.org>2021-01-05 12:24:40 -0700
commit0fd3d91152df5bb6c5f7b9ee68f01a9a1c9a875d (patch)
tree1dbc5b936b98393e343cc99a40382b2734ac778e /drivers/spi
parent12559f5bab3e43b603dccfa6c354ffd7da03249c (diff)
downloadu-boot-0fd3d91152df5bb6c5f7b9ee68f01a9a1c9a875d.tar.gz
u-boot-0fd3d91152df5bb6c5f7b9ee68f01a9a1c9a875d.tar.bz2
u-boot-0fd3d91152df5bb6c5f7b9ee68f01a9a1c9a875d.zip
dm: Use access methods for dev/uclass private data
Most drivers use these access methods but a few do not. Update them. In some cases the access is not permitted, so mark those with a FIXME tag for the maintainer to check. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Pratyush Yadav <p.yadav@ti.com>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/cadence_qspi.c12
-rw-r--r--drivers/spi/cf_spi.c2
-rw-r--r--drivers/spi/davinci_spi.c4
-rw-r--r--drivers/spi/designware_spi.c4
-rw-r--r--drivers/spi/exynos_spi.c4
-rw-r--r--drivers/spi/fsl_dspi.c4
-rw-r--r--drivers/spi/fsl_espi.c2
-rw-r--r--drivers/spi/fsl_qspi.c2
-rw-r--r--drivers/spi/mxs_spi.c2
-rw-r--r--drivers/spi/pl022_spi.c2
-rw-r--r--drivers/spi/rk_spi.c6
-rw-r--r--drivers/spi/soft_spi.c4
-rw-r--r--drivers/spi/tegra114_spi.c4
-rw-r--r--drivers/spi/tegra20_sflash.c4
-rw-r--r--drivers/spi/tegra20_slink.c4
-rw-r--r--drivers/spi/tegra210_qspi.c4
-rw-r--r--drivers/spi/uniphier_spi.c8
-rw-r--r--drivers/spi/zynq_qspi.c4
-rw-r--r--drivers/spi/zynq_spi.c8
-rw-r--r--drivers/spi/zynqmp_gqspi.c6
20 files changed, 45 insertions, 45 deletions
diff --git a/drivers/spi/cadence_qspi.c b/drivers/spi/cadence_qspi.c
index b746501f5f..67980431ba 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 8adff63edc..298f350ef3 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 ea088ebd2c..53a791ea29 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 4fa4585fc3..5ede00d080 100644
--- a/drivers/spi/designware_spi.c
+++ b/drivers/spi/designware_spi.c
@@ -155,7 +155,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);
@@ -478,7 +478,7 @@ static int dw_spi_xfer(struct udevice *dev, unsigned int bitlen,
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 e4d2bade0f..30b1a77a73 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 ddf4a9e413..b8c0216b39 100644
--- a/drivers/spi/fsl_dspi.c
+++ b/drivers/spi/fsl_dspi.c
@@ -486,7 +486,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 +576,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 e9e7ffd6b5..abc28e37d2 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 fc3b844370..8bc7038a82 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/mxs_spi.c b/drivers/spi/mxs_spi.c
index 4fafe33af5..7f632d98bb 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;
diff --git a/drivers/spi/pl022_spi.c b/drivers/spi/pl022_spi.c
index 179582cad7..133363ea7d 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 44ac475c11..51abebb947 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;
diff --git a/drivers/spi/soft_spi.c b/drivers/spi/soft_spi.c
index afc98bfb66..3425d9950a 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/tegra114_spi.c b/drivers/spi/tegra114_spi.c
index e1fd82bdfa..f0256d8e66 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 d38606100d..4384a48ec8 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 b99ef38a14..3057fe1a22 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 a2a7f4614c..b464b9ccb0 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 48b8430d3d..e47ed5b221 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 2fc28b6bee..845f2d2f5f 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 a6efa4a1c8..2971e55f41 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 f09c50757d..c9e476eefa 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;