All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: U-Boot Mailing List <u-boot@lists.denx.de>
Cc: Tom Rini <trini@konsulko.com>, Simon Glass <sjg@chromium.org>,
	Jaehoon Chung <jh80.chung@samsung.com>,
	Macpaul Lin <macpaul@andestech.com>, Peng Fan <peng.fan@nxp.com>
Subject: [PATCH 05/12] mmc: nds32: ftsdc010: Convert to livetree
Date: Sat,  7 Aug 2021 07:24:05 -0600	[thread overview]
Message-ID: <20210807132413.3513724-6-sjg@chromium.org> (raw)
In-Reply-To: <20210807132413.3513724-1-sjg@chromium.org>

Use the livetree API for this driver.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 drivers/mmc/ftsdc010_mci.c | 22 +++++++---------------
 1 file changed, 7 insertions(+), 15 deletions(-)

diff --git a/drivers/mmc/ftsdc010_mci.c b/drivers/mmc/ftsdc010_mci.c
index 221fba313d3..b30da5b72a4 100644
--- a/drivers/mmc/ftsdc010_mci.c
+++ b/drivers/mmc/ftsdc010_mci.c
@@ -30,8 +30,6 @@
 #include <syscon.h>
 #include <linux/err.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #define CFG_CMD_TIMEOUT (CONFIG_SYS_HZ >> 4) /* 250 ms */
 #define CFG_RST_TIMEOUT CONFIG_SYS_HZ /* 1 sec reset timeout */
 
@@ -395,24 +393,18 @@ static int ftsdc010_mmc_of_to_plat(struct udevice *dev)
 #if CONFIG_IS_ENABLED(OF_REAL)
 	struct ftsdc_priv *priv = dev_get_priv(dev);
 	struct ftsdc010_chip *chip = &priv->chip;
+
 	chip->name = dev->name;
 	chip->ioaddr = dev_read_addr_ptr(dev);
-	chip->buswidth = fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev),
-					"bus-width", 4);
+	chip->buswidth = dev_read_u32_default(dev, "bus-width", 4);
 	chip->priv = dev;
-	priv->fifo_depth = fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev),
-				    "fifo-depth", 0);
-	priv->fifo_mode = fdtdec_get_bool(gd->fdt_blob, dev_of_offset(dev),
-					  "fifo-mode");
-	if (fdtdec_get_int_array(gd->fdt_blob, dev_of_offset(dev),
-			 "clock-freq-min-max", priv->minmax, 2)) {
-		int val = fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev),
-				  "max-frequency", -EINVAL);
-		if (val < 0)
-			return val;
+	priv->fifo_depth = dev_read_u32_default(dev, "fifo-depth", 0);
+	priv->fifo_mode = dev_read_bool(dev, "fifo-mode");
+	if (dev_read_u32_array(dev, "clock-freq-min-max", priv->minmax, 2)) {
+		if (dev_read_u32(dev, "max-frequency", &priv->minmax[1]))
+			return -EINVAL;
 
 		priv->minmax[0] = 400000;  /* 400 kHz */
-		priv->minmax[1] = val;
 	} else {
 		debug("%s: 'clock-freq-min-max' property was deprecated.\n",
 		__func__);
-- 
2.32.0.605.g8dce9f2422-goog


  parent reply	other threads:[~2021-08-07 13:25 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-07 13:24 [PATCH 00/12] dm: Expand of-platdata support to GPIOs and clean up Simon Glass
2021-08-07 13:24 ` [PATCH 01/12] treewide: fdt: Move fdt_get_config_... to ofnode_conf_read Simon Glass
2021-08-07 13:24 ` [PATCH 02/12] fdt: Create a new OF_REAL Kconfig Simon Glass
2021-08-07 13:24 ` [PATCH 03/12] treewide: Simply conditions with the new OF_REAL Simon Glass
2021-08-07 13:24 ` [PATCH 04/12] treewide: Use OF_REAL instead of !OF_PLATDATA Simon Glass
2021-08-07 13:24 ` Simon Glass [this message]
     [not found]   ` <HK0PR03MB299419BC349724622E422920C1F69@HK0PR03MB2994.apcprd03.prod.outlook.com>
2021-08-09  2:42     ` [PATCH 05/12] mmc: nds32: ftsdc010: Convert to livetree Rick Chen
2021-08-12 22:22   ` Jaehoon Chung
2021-09-26 18:40   ` Simon Glass
2021-08-07 13:24 ` [PATCH 06/12] treewide: Try to avoid the preprocessor with OF_REAL Simon Glass
2021-08-07 13:24 ` [PATCH 07/12] fdt: Update Makefile rules with the new OF_REAL Kconfig Simon Glass
2021-08-07 13:24 ` [PATCH 08/12] dm: Add comments to dt-structs contents Simon Glass
2021-08-07 13:24 ` [PATCH 09/12] clk: Rename clk_get_by_driver_info() Simon Glass
2021-08-09 16:41   ` Sean Anderson
2021-09-26 18:40   ` Simon Glass
2021-08-07 13:24 ` [PATCH 10/12] dm: doc: Add a note about of-platdata header files Simon Glass
2021-08-07 13:24 ` [PATCH 11/12] irq: Tidy up of-platdata irq support Simon Glass
2021-08-07 13:24 ` [PATCH 12/12] dm: gpio: Add of-platdata support Simon Glass
2021-09-26 18:40 ` Simon Glass
2021-09-26 18:40 ` [PATCH 11/12] irq: Tidy up of-platdata irq support Simon Glass
2021-09-26 18:40 ` [PATCH 10/12] dm: doc: Add a note about of-platdata header files Simon Glass
2021-09-26 18:40 ` [PATCH 08/12] dm: Add comments to dt-structs contents Simon Glass
2021-09-26 18:40 ` [PATCH 06/12] treewide: Try to avoid the preprocessor with OF_REAL Simon Glass
2021-09-26 18:40 ` [PATCH 07/12] fdt: Update Makefile rules with the new OF_REAL Kconfig Simon Glass
2021-09-26 18:40 ` [PATCH 04/12] treewide: Use OF_REAL instead of !OF_PLATDATA Simon Glass
2021-09-26 18:40 ` [PATCH 03/12] treewide: Simply conditions with the new OF_REAL Simon Glass
2021-09-26 18:40 ` [PATCH 01/12] treewide: fdt: Move fdt_get_config_... to ofnode_conf_read Simon Glass
2021-09-26 18:40 ` [PATCH 02/12] fdt: Create a new OF_REAL Kconfig Simon Glass

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=20210807132413.3513724-6-sjg@chromium.org \
    --to=sjg@chromium.org \
    --cc=jh80.chung@samsung.com \
    --cc=macpaul@andestech.com \
    --cc=peng.fan@nxp.com \
    --cc=trini@konsulko.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.