diff mbox

[U-Boot,6/7] rockchip: ns16550: dm: convert fdt_get to dev_read

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

Commit Message

Philipp Tomsich June 7, 2017, 4:46 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 covers the serial driver (ns16550 and compatible) used for the
Rockchip devices.

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

 drivers/serial/ns16550.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

Comments

Simon Glass June 9, 2017, 12:28 p.m. UTC | #1
On 7 June 2017 at 10:46, 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 covers the serial driver (ns16550 and compatible) used for the
> Rockchip devices.
>
> Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> ---
>
>  drivers/serial/ns16550.c | 11 ++++-------
>  1 file changed, 4 insertions(+), 7 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 covers the serial driver (ns16550 and compatible) used for the
> Rockchip devices.
> 
> Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>
> ---
> 
>  drivers/serial/ns16550.c | 11 ++++-------
>  1 file changed, 4 insertions(+), 7 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 covers the serial driver (ns16550 and compatible) used for the
> Rockchip devices.
> 
> Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>
> ---
> 
>  drivers/serial/ns16550.c | 11 ++++-------
>  1 file changed, 4 insertions(+), 7 deletions(-)
> 

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

Patch

diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c
index 52c52c1..e0e7024 100644
--- a/drivers/serial/ns16550.c
+++ b/drivers/serial/ns16550.c
@@ -434,10 +434,8 @@  int ns16550_serial_ofdata_to_platdata(struct udevice *dev)
 	plat->base = (unsigned long)map_physmem(addr, 0, MAP_NOCACHE);
 #endif
 
-	plat->reg_offset = fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev),
-				     "reg-offset", 0);
-	plat->reg_shift = fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev),
-					 "reg-shift", 0);
+	plat->reg_offset = dev_read_u32_default(dev, "reg-offset", 0);
+	plat->reg_shift = dev_read_u32_default(dev, "reg-shift", 0);
 
 	err = clk_get_by_index(dev, 0, &clk);
 	if (!err) {
@@ -450,9 +448,8 @@  int ns16550_serial_ofdata_to_platdata(struct udevice *dev)
 	}
 
 	if (!plat->clock)
-		plat->clock = fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev),
-					     "clock-frequency",
-					     CONFIG_SYS_NS16550_CLK);
+		plat->clock = dev_read_u32_default(dev, "clock-frequency",
+						   CONFIG_SYS_NS16550_CLK);
 	if (!plat->clock) {
 		debug("ns16550 clock not defined\n");
 		return -EINVAL;