]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
dm: core: Drop ofnode_is_available()
authorSimon Glass <sjg@chromium.org>
Wed, 7 Sep 2022 02:27:17 +0000 (20:27 -0600)
committerTom Rini <trini@konsulko.com>
Thu, 29 Sep 2022 20:11:31 +0000 (16:11 -0400)
This function is also available as ofnode_is_enabled(), so use that
instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
22 files changed:
arch/arm/mach-tegra/xusb-padctl-common.c
arch/riscv/lib/andes_plic.c
arch/riscv/lib/smp.c
drivers/core/ofnode.c
drivers/cpu/imx8_cpu.c
drivers/cpu/riscv_cpu.c
drivers/crypto/fsl/jr.c
drivers/firmware/scmi/scmi_agent-uclass.c
drivers/mtd/mtdpart.c
drivers/mtd/nand/raw/zynq_nand.c
drivers/net/fec_mxc.c
drivers/net/fsl_enetc.c
drivers/net/mscc_eswitch/felix_switch.c
drivers/net/sja1105.c
drivers/net/ti/am65-cpsw-nuss.c
drivers/pci/pci-uclass.c
drivers/pci/pci_mvebu.c
drivers/pci/pci_tegra.c
drivers/pci/pcie_mediatek.c
include/dm/ofnode.h
lib/fdtdec.c
net/dsa-uclass.c

index 8bdd44ad7acd41719591f69d0165378801ee7db1..388ec49968826bf18b3dd00e5e6c714bc0a4db2e 100644 (file)
@@ -282,7 +282,7 @@ int tegra_xusb_process_nodes(ofnode nodes[], unsigned int count,
        debug("%s: count=%d\n", __func__, count);
        for (i = 0; i < count; i++) {
                debug("%s: i=%d, node=%p\n", __func__, i, nodes[i].np);
-               if (!ofnode_is_available(nodes[i]))
+               if (!ofnode_is_enabled(nodes[i]))
                        continue;
 
                padctl.socdata = socdata;
index 5e113ee8c94ced7929f2877d03bac24ebd1cd11d..68514758a8622208ca298fa5c4e1aecebc25bda2 100644 (file)
@@ -71,7 +71,7 @@ int riscv_init_ipi(void)
                        continue;
 
                /* skip if hart is marked as not available */
-               if (!ofnode_is_available(node))
+               if (!ofnode_is_enabled(node))
                        continue;
 
                /* read hart ID of CPU */
index c0f65af1916261a6b895f653cf180ece67dbcea5..4f073a016ffd359ed914643def6733469c601bbf 100644 (file)
@@ -27,7 +27,7 @@ static int send_ipi_many(struct ipi_data *ipi, int wait)
 
        ofnode_for_each_subnode(node, cpus) {
                /* skip if hart is marked as not available in the device tree */
-               if (!ofnode_is_available(node))
+               if (!ofnode_is_enabled(node))
                        continue;
 
                /* read hart ID of CPU */
index 154c7b2667021f7605e0c9b18256111c697c6e63..4dd2aee11cef6244c7385410504df9a97a78f07a 100644 (file)
@@ -828,15 +828,6 @@ const void *ofprop_get_property(const struct ofprop *prop,
                                             propname, lenp);
 }
 
-bool ofnode_is_available(ofnode node)
-{
-       if (ofnode_is_np(node))
-               return of_device_is_available(ofnode_to_np(node));
-       else
-               return fdtdec_get_is_enabled(gd->fdt_blob,
-                                            ofnode_to_offset(node));
-}
-
 fdt_addr_t ofnode_get_addr_size(ofnode node, const char *property,
                                fdt_size_t *sizep)
 {
index abddbef57b891ee5db0531aa19aee1a065350849..b8eb2d280060def0e40970eb09fb95c28e0f1dbc 100644 (file)
@@ -144,7 +144,7 @@ static int cpu_imx_get_count(const struct udevice *dev)
        ofnode_for_each_subnode(node, dev_ofnode(dev->parent)) {
                const char *device_type;
 
-               if (!ofnode_is_available(node))
+               if (!ofnode_is_enabled(node))
                        continue;
 
                device_type = ofnode_read_string(node, "device_type");
index b30dceba37c5aa2678a4d05cb2e42bd012f97050..d6484d7f4b4079c68440354db96f4a2ef02075cc 100644 (file)
@@ -77,7 +77,7 @@ static int riscv_cpu_get_count(const struct udevice *dev)
                const char *device_type;
 
                /* skip if hart is marked as not available in the device tree */
-               if (!ofnode_is_available(node))
+               if (!ofnode_is_enabled(node))
                        continue;
 
                device_type = ofnode_read_string(node, "device_type");
index acd29924f7e70c7220834c74fe473aeff06a7556..8c0fb27b532226adadf5a908a70a48cf4c0aeb53 100644 (file)
@@ -853,7 +853,7 @@ static int caam_jr_probe(struct udevice *dev)
 
        /* Check for enabled job ring node */
        ofnode_for_each_subnode(node, dev_ofnode(dev)) {
-               if (!ofnode_is_available(node))
+               if (!ofnode_is_enabled(node))
                        continue;
 
                jr_node = ofnode_read_u32_default(node, "reg", -1);
index 2b6211c4e6a09fbfc5b06563c809bb21e6cf2f94..c3f3d1f44007c1e4396a1d4ebd8e91ef4abb08a6 100644 (file)
@@ -65,7 +65,7 @@ static int scmi_bind_protocols(struct udevice *dev)
                struct driver *drv = NULL;
                u32 protocol_id;
 
-               if (!ofnode_is_available(node))
+               if (!ofnode_is_enabled(node))
                        continue;
 
                if (ofnode_read_u32(node, "reg", &protocol_id))
index 56aa58b58bb7f62d9d166e6bf81342d8cc300839..4886392a1cfaa59f430e2ca51f32275b9021cb27 100644 (file)
@@ -895,7 +895,7 @@ int add_mtd_partitions_of(struct mtd_info *master)
        else
                parts = ofnode_find_subnode(master->flash_node, "partitions");
 
-       if (!ofnode_valid(parts) || !ofnode_is_available(parts) ||
+       if (!ofnode_valid(parts) || !ofnode_is_enabled(parts) ||
            !ofnode_device_is_compatible(parts, "fixed-partitions"))
                return 0;
 
@@ -905,7 +905,7 @@ int add_mtd_partitions_of(struct mtd_info *master)
                fdt_addr_t offset;
                fdt_size_t size;
 
-               if (!ofnode_is_available(child))
+               if (!ofnode_is_enabled(child))
                        continue;
 
                offset = ofnode_get_addr_size_index_notrans(child, 0, &size);
index 10e9cd18b077a0f807ca4ac052e11bb8766b7376..14cb2ba704360dec15d5a1b9fa0a593dd4a3a993 100644 (file)
@@ -1095,7 +1095,7 @@ static int zynq_nand_probe(struct udevice *dev)
                }
        }
 
-       if (!ofnode_is_available(of_nand)) {
+       if (!ofnode_is_enabled(of_nand)) {
                debug("Nand node in dt disabled\n");
                return dm_scan_fdt_dev(dev);
        }
index 8bc2b46d403ff081366496c9b315289ee129febd..bbc4434ddb9ee859382c7bc9802e6a271eb3f8fc 100644 (file)
@@ -1078,7 +1078,7 @@ static int device_get_phy_addr(struct fec_priv *priv, struct udevice *dev)
                return ret;
        }
 
-       if (!ofnode_is_available(phandle_args.node))
+       if (!ofnode_is_enabled(phandle_args.node))
                return -ENOENT;
 
        priv->phy_of_node = phandle_args.node;
index d43a85b4984d4a134dddfc455813bd93408fa7da..1fd5089cc4be37351756bf367b006180c55c19e2 100644 (file)
@@ -323,7 +323,7 @@ static int enetc_probe(struct udevice *dev)
        struct enetc_priv *priv = dev_get_priv(dev);
        int res;
 
-       if (ofnode_valid(dev_ofnode(dev)) && !ofnode_is_available(dev_ofnode(dev))) {
+       if (ofnode_valid(dev_ofnode(dev)) && !ofnode_is_enabled(dev_ofnode(dev))) {
                enetc_dbg(dev, "interface disabled\n");
                return -ENODEV;
        }
index 709c9e3ef5153c86697abd1c5aaa884ba173c538..2e5f45e5743fb0d485384fdb450ee628ae0825d1 100644 (file)
@@ -287,7 +287,7 @@ static int felix_probe(struct udevice *dev)
        int err;
 
        if (ofnode_valid(dev_ofnode(dev)) &&
-           !ofnode_is_available(dev_ofnode(dev))) {
+           !ofnode_is_enabled(dev_ofnode(dev))) {
                dev_dbg(dev, "switch disabled\n");
                return -ENODEV;
        }
index 4ca8709e347cb7a88b378d845f0f295b42cb692c..48f044c647210fb644763f76d0a356f126c474d7 100644 (file)
@@ -3316,7 +3316,7 @@ static int sja1105_probe(struct udevice *dev)
        int rc;
 
        if (ofnode_valid(dev_ofnode(dev)) &&
-           !ofnode_is_available(dev_ofnode(dev))) {
+           !ofnode_is_enabled(dev_ofnode(dev))) {
                dev_dbg(dev, "switch disabled\n");
                return -ENODEV;
        }
index 9580fa37eaffe6e5bfae5e5cd43fcf7dad12ac0b..b79e06290a2d8ad843a053abf01412c5afdfdd47 100644 (file)
@@ -719,7 +719,7 @@ static int am65_cpsw_probe_nuss(struct udevice *dev)
 
                node_name = ofnode_get_name(node);
 
-               disabled = !ofnode_is_available(node);
+               disabled = !ofnode_is_enabled(node);
 
                ret = ofnode_read_u32(node, "reg", &port_id);
                if (ret) {
index 16a6a699f922e9599f1b55ecb95929a458ea7660..058b2f6359de2afd1eda4dd7cdd62460375febc8 100644 (file)
@@ -766,7 +766,7 @@ static int pci_find_and_bind_driver(struct udevice *parent,
        if (ofnode_valid(dev_ofnode(parent)))
                pci_dev_find_ofnode(parent, bdf, &node);
 
-       if (ofnode_valid(node) && !ofnode_is_available(node)) {
+       if (ofnode_valid(node) && !ofnode_is_enabled(node)) {
                debug("%s: Ignoring disabled device\n", __func__);
                return log_msg_ret("dis", -EPERM);
        }
index 5bd340a421b83b794505f3522d6eae93049017aa..93a7508d8a2a149b4ca967168e773eadc50d0c0b 100644 (file)
@@ -740,7 +740,7 @@ static int mvebu_pcie_bind(struct udevice *parent)
 
        /* First phase: Fill mvebu_pcie struct for each port */
        ofnode_for_each_subnode(subnode, dev_ofnode(parent)) {
-               if (!ofnode_is_available(subnode))
+               if (!ofnode_is_enabled(subnode))
                        continue;
 
                pcie = calloc(1, sizeof(*pcie));
index bc489d5ec850379ba58f042b7ba7af9b5afc5cf2..29d54117e939c5fe618f4804cb2e3bffa1993c0a 100644 (file)
@@ -531,7 +531,7 @@ static int tegra_pcie_parse_dt(struct udevice *dev, enum tegra_pci_id id,
 
                lanes |= num_lanes << (index << 3);
 
-               if (!ofnode_is_available(subnode))
+               if (!ofnode_is_enabled(subnode))
                        continue;
 
                port = malloc(sizeof(*port));
index 051a3bc96935e9206ba7050ab6f38cf3d322f70d..c6e30e246227b18582f6e973d88c2431b8ffbc2d 100644 (file)
@@ -657,7 +657,7 @@ static int mtk_pcie_probe(struct udevice *dev)
                struct fdt_pci_addr addr;
                u32 slot = 0;
 
-               if (!ofnode_is_available(subnode))
+               if (!ofnode_is_enabled(subnode))
                        continue;
 
                err = ofnode_read_pci_addr(subnode, 0, "reg", &addr);
@@ -696,7 +696,7 @@ static int mtk_pcie_probe_v2(struct udevice *dev)
        pcie->priv = dev;
 
        dev_for_each_subnode(subnode, dev) {
-               if (!ofnode_is_available(subnode))
+               if (!ofnode_is_enabled(subnode))
                        continue;
 
                err = ofnode_read_pci_addr(subnode, 0, "reg", &addr);
index 7b0ef109b79a120b487012e508c4ef59a6a904e4..a674d7d8fd606e6567188f54a45f0ef900f3d931 100644 (file)
@@ -872,14 +872,6 @@ int ofnode_next_property(struct ofprop *prop);
 const void *ofprop_get_property(const struct ofprop *prop,
                                const char **propname, int *lenp);
 
-/**
- * ofnode_is_available() - check if a node is marked available
- *
- * @node: node to check
- * Return: true if node's 'status' property is "okay" (or is missing)
- */
-bool ofnode_is_available(ofnode node);
-
 /**
  * ofnode_get_addr_size() - get address and size from a property
  *
index 96b6b71a606fe117ab98882c2d6d86069b44135d..eca01081c5d4989d96ce236a9d3960f3d3d3f390 100644 (file)
@@ -1058,7 +1058,7 @@ ofnode get_next_memory_node(ofnode mem)
 {
        do {
                mem = ofnode_by_prop_value(mem, "device_type", "memory", 7);
-       } while (!ofnode_is_available(mem));
+       } while (!ofnode_is_enabled(mem));
 
        return mem;
 }
index 3bf4351c847d3db13688a1e73f4bba0713f58dd8..5b7046432ff3980aba1098fba9ca501745723728 100644 (file)
@@ -432,7 +432,7 @@ static int dsa_post_bind(struct udevice *dev)
                 * skip registration if port id not found or if the port
                 * is explicitly disabled in DT
                 */
-               if (!ofnode_valid(pnode) || !ofnode_is_available(pnode))
+               if (!ofnode_valid(pnode) || !ofnode_is_enabled(pnode))
                        continue;
 
                err = device_bind_driver_to_node(dev, DSA_PORT_CHILD_DRV_NAME,