dm: core: Drop ofnode_is_available()

This function is also available as ofnode_is_enabled(), so use that
instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass 2022-09-06 20:27:17 -06:00 committed by Tom Rini
parent 52ad21aa2c
commit 8909066199
22 changed files with 22 additions and 39 deletions

View 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;

View 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 */

View 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 */

View 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)
{

View 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");

View 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");

View 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);

View 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))

View 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);

View 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);
}

View 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;

View 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;
}

View 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;
}

View 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;
}

View 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) {

View 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);
}

View 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));

View 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));

View 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);

View 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
*

View 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;
}

View 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,