diff mbox

[U-Boot,2/7] rockchip: spi: dm: convert fdt_get to dev_read

Message ID 1496853982-33469-3-git-send-email-philipp.tomsich@theobroma-systems.com
State Accepted
Commit 6c65577ce6f3776638fd1d719bb5202acb2aa7ff
Delegated to: Philipp Tomsich
Headers show

Commit Message

Philipp Tomsich June 7, 2017, 4:45 p.m. UTC
With the new dev_read functions available, we can convert the rockchip
architecture-specific drivers and common drivers used by these devices
over to the dev_read family of calls.

This change covers the rk_spi.c (SPI driver) used in Rockchip devices.

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
---

 drivers/spi/rk_spi.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

Comments

Simon Glass June 9, 2017, 12:27 p.m. UTC | #1
On 7 June 2017 at 10:45, Philipp Tomsich
<philipp.tomsich@theobroma-systems.com> wrote:
> With the new dev_read functions available, we can convert the rockchip
> architecture-specific drivers and common drivers used by these devices
> over to the dev_read family of calls.
>
> This change covers the rk_spi.c (SPI driver) used in Rockchip devices.
>
> Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> ---
>
>  drivers/spi/rk_spi.c | 15 +++++++--------
>  1 file changed, 7 insertions(+), 8 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>
Philipp Tomsich June 25, 2017, 11:03 p.m. UTC | #2
> With the new dev_read functions available, we can convert the rockchip
> architecture-specific drivers and common drivers used by these devices
> over to the dev_read family of calls.
> 
> This change covers the rk_spi.c (SPI driver) used in Rockchip devices.
> 
> Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>
> ---
> 
>  drivers/spi/rk_spi.c | 15 +++++++--------
>  1 file changed, 7 insertions(+), 8 deletions(-)
> 

Applied to u-boot-rockchip/next, thanks!
Philipp Tomsich June 25, 2017, 11:09 p.m. UTC | #3
> With the new dev_read functions available, we can convert the rockchip
> architecture-specific drivers and common drivers used by these devices
> over to the dev_read family of calls.
> 
> This change covers the rk_spi.c (SPI driver) used in Rockchip devices.
> 
> Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>
> ---
> 
>  drivers/spi/rk_spi.c | 15 +++++++--------
>  1 file changed, 7 insertions(+), 8 deletions(-)
> 

Applied to u-boot-rockchip/next, thanks!
diff mbox

Patch

diff --git a/drivers/spi/rk_spi.c b/drivers/spi/rk_spi.c
index a8f0eb0..7921ea0 100644
--- a/drivers/spi/rk_spi.c
+++ b/drivers/spi/rk_spi.c
@@ -182,8 +182,6 @@  static int rockchip_spi_ofdata_to_platdata(struct udevice *bus)
 #if !CONFIG_IS_ENABLED(OF_PLATDATA)
 	struct rockchip_spi_platdata *plat = dev_get_platdata(bus);
 	struct rockchip_spi_priv *priv = dev_get_priv(bus);
-	const void *blob = gd->fdt_blob;
-	int node = dev_of_offset(bus);
 	int ret;
 
 	plat->base = devfdt_get_addr(bus);
@@ -195,12 +193,13 @@  static int rockchip_spi_ofdata_to_platdata(struct udevice *bus)
 		return ret;
 	}
 
-	plat->frequency = fdtdec_get_int(blob, node, "spi-max-frequency",
-					 50000000);
-	plat->deactivate_delay_us = fdtdec_get_int(blob, node,
-					"spi-deactivate-delay", 0);
-	plat->activate_delay_us = fdtdec_get_int(blob, node,
-						 "spi-activate-delay", 0);
+	plat->frequency =
+		dev_read_u32_default(bus, "spi-max-frequency", 50000000);
+	plat->deactivate_delay_us =
+		dev_read_u32_default(bus, "spi-deactivate-delay", 0);
+	plat->activate_delay_us =
+		dev_read_u32_default(bus, "spi-activate-delay", 0);
+
 	debug("%s: base=%x, max-frequency=%d, deactivate_delay=%d\n",
 	      __func__, (uint)plat->base, plat->frequency,
 	      plat->deactivate_delay_us);