From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/2] spi: imx: remove doubled pointer from mxc_spi_probe
Date: Mon, 13 May 2019 13:53:38 +0200 [thread overview]
Message-ID: <20190513115339.984305-2-hs@denx.de> (raw)
In-Reply-To: <20190513115339.984305-1-hs@denx.de>
in mxc_spi_probe() plat and mxcs pointer are created:
struct mxc_spi_slave *plat = bus->platdata;
struct mxc_spi_slave *mxcs = dev_get_platdata(bus);
which have the same value. Remove plat pointer.
Signed-off-by: Heiko Schocher <hs@denx.de>
---
drivers/spi/mxc_spi.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/spi/mxc_spi.c b/drivers/spi/mxc_spi.c
index 6846762719..fba76bf740 100644
--- a/drivers/spi/mxc_spi.c
+++ b/drivers/spi/mxc_spi.c
@@ -488,7 +488,6 @@ void spi_release_bus(struct spi_slave *slave)
static int mxc_spi_probe(struct udevice *bus)
{
- struct mxc_spi_slave *plat = bus->platdata;
struct mxc_spi_slave *mxcs = dev_get_platdata(bus);
int node = dev_of_offset(bus);
const void *blob = gd->fdt_blob;
@@ -500,11 +499,11 @@ static int mxc_spi_probe(struct udevice *bus)
return -EINVAL;
}
- plat->base = devfdt_get_addr(bus);
- if (plat->base == FDT_ADDR_T_NONE)
+ mxcs->base = devfdt_get_addr(bus);
+ if (mxcs->base == FDT_ADDR_T_NONE)
return -ENODEV;
- ret = dm_gpio_set_value(&plat->ss, 0);
+ ret = dm_gpio_set_value(&mxcs->ss, 0);
if (ret) {
dev_err(bus, "Setting cs error\n");
return ret;
--
2.17.2
next prev parent reply other threads:[~2019-05-13 11:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-13 11:53 [U-Boot] [PATCH 0/2] mxc_spi: DM improvements Heiko Schocher
2019-05-13 11:53 ` Heiko Schocher [this message]
2019-05-13 11:53 ` [U-Boot] [PATCH 2/2] spi: imx: work with cs greater 0 Heiko Schocher
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190513115339.984305-2-hs@denx.de \
--to=hs@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox