From 6a1649e26da7ec1c4cd98491fa9149bcf59e7230 Mon Sep 17 00:00:00 2001 From: Joseph Chen Date: Thu, 6 Aug 2020 20:06:37 +0800 Subject: [PATCH] core: node: remove unused API Signed-off-by: Joseph Chen Change-Id: I797cb2f594865ab9310651183bf98b8112fe429e --- drivers/core/of_access.c | 48 ---------------------------------------- drivers/core/ofnode.c | 18 --------------- drivers/core/read.c | 10 --------- include/dm/of_access.h | 18 --------------- include/dm/ofnode.h | 18 --------------- include/dm/read.h | 18 --------------- 6 files changed, 130 deletions(-) diff --git a/drivers/core/of_access.c b/drivers/core/of_access.c index c8c3ab8297..db2f64bd56 100644 --- a/drivers/core/of_access.c +++ b/drivers/core/of_access.c @@ -29,8 +29,6 @@ DECLARE_GLOBAL_DATA_PTR; -#define PROP_HIDE_MAGIC 1 - /* list of struct alias_prop aliases */ LIST_HEAD(aliases_lookup); @@ -173,40 +171,6 @@ const void *of_get_property(const struct device_node *np, const char *name, return pp ? pp->value : NULL; } -const char *of_hide_property(struct device_node *np, const char *name) -{ - struct property *pp; - - if (!np) - return NULL; - - for (pp = np->properties; pp; pp = pp->next) { - if (strcmp(pp->name, name) == 0) { - pp->name[0] += PROP_HIDE_MAGIC; - return (const char *)pp->name; - } - } - - return NULL; -} - -int of_present_property(struct device_node *np, const char *name) -{ - struct property *pp; - - if (!np) - return -FDT_ERR_NOTFOUND; - - for (pp = np->properties; pp; pp = pp->next) { - if (strcmp(pp->name, name) == 0) { - pp->name[0] -= PROP_HIDE_MAGIC; - break; - } - } - - return 0; -} - static const char *of_prop_next_string(struct property *prop, const char *cur) { const void *curv = cur; @@ -900,17 +864,5 @@ struct device_node *of_alias_dump(void) struct device_node *of_get_stdout(void) { - struct device_node *np; - - if (gd && gd->serial.using_pre_serial) { - np = of_alias_get_dev("serial", gd->serial.id); - if (!np) - printf("Can't find alias serial%d\n", gd->serial.id); - else - debug("Find alias serial: %s\n", np->full_name); - - of_stdout = np; - } - return of_stdout; } diff --git a/drivers/core/ofnode.c b/drivers/core/ofnode.c index 8d10e7a97f..992dd573a2 100644 --- a/drivers/core/ofnode.c +++ b/drivers/core/ofnode.c @@ -512,24 +512,6 @@ const void *ofnode_get_property(ofnode node, const char *propname, int *lenp) propname, lenp); } -const char *ofnode_hide_property(ofnode node, const char *propname) -{ - if (ofnode_is_np(node)) - return of_hide_property((struct device_node *)ofnode_to_np(node), - propname); - else - return NULL; -} - -int ofnode_present_property(ofnode node, const char *propname) -{ - if (ofnode_is_np(node)) - return of_present_property((struct device_node *)ofnode_to_np(node), - propname); - else - return -ENOSYS; -} - bool ofnode_is_available(ofnode node) { if (ofnode_is_np(node)) diff --git a/drivers/core/read.c b/drivers/core/read.c index 83da74c422..2692113853 100644 --- a/drivers/core/read.c +++ b/drivers/core/read.c @@ -154,16 +154,6 @@ const void *dev_read_prop(struct udevice *dev, const char *propname, int *lenp) return ofnode_get_property(dev_ofnode(dev), propname, lenp); } -const char *dev_hide_prop(struct udevice *dev, const char *propname) -{ - return ofnode_hide_property(dev_ofnode(dev), propname); -} - -int dev_present_prop(struct udevice *dev, const char *propname) -{ - return ofnode_present_property(dev_ofnode(dev), propname); -} - int dev_read_alias_seq(struct udevice *dev, int *devnump) { ofnode node = dev_ofnode(dev); diff --git a/include/dm/of_access.h b/include/dm/of_access.h index fd72340fd0..48baad5ef9 100644 --- a/include/dm/of_access.h +++ b/include/dm/of_access.h @@ -104,24 +104,6 @@ struct property *of_find_property(const struct device_node *np, const void *of_get_property(const struct device_node *np, const char *name, int *lenp); -/** - * of_hide_property() - hide a property - * - * @np: Pointer to device node holding property - * @name: Name of property to hide - * @return hidden name if ok, otherwise NULL - */ -const char *of_hide_property(struct device_node *np, const char *name); - -/** - * of_present_property() - present a property hidden before - * - * @np: Pointer to device node holding property - * @name: Hidden name of property - * @return 0 if ok, otherwise failed - */ -int of_present_property(struct device_node *np, const char *name); - /** * of_device_is_compatible() - Check if the node matches given constraints * @device: pointer to node diff --git a/include/dm/ofnode.h b/include/dm/ofnode.h index 27d177786b..8a4291a6ad 100644 --- a/include/dm/ofnode.h +++ b/include/dm/ofnode.h @@ -540,24 +540,6 @@ int ofnode_decode_display_timing(ofnode node, int index, */ const void *ofnode_get_property(ofnode node, const char *propname, int *lenp); -/** - * ofnode_hide_property() - hide a property - * - * @np: Pointer to device node holding property - * @name: Name of property to hide - * @return hidden name if ok, otherwise NULL - */ -const char *ofnode_hide_property(ofnode node, const char *propname); - -/** - * ofnode_present_property() - present a property hidden before - * - * @np: Pointer to device node holding property - * @name: Hidden name of property - * @return 0 if ok, otherwise failed - */ -int ofnode_present_property(ofnode node, const char *propname); - /** * ofnode_is_available() - check if a node is marked available * diff --git a/include/dm/read.h b/include/dm/read.h index 9a5820c9de..0a78d04815 100644 --- a/include/dm/read.h +++ b/include/dm/read.h @@ -319,24 +319,6 @@ int dev_read_phandle(struct udevice *dev); */ const void *dev_read_prop(struct udevice *dev, const char *propname, int *lenp); -/** - * dev_hide_prop() - hide a property - * - * @np: Pointer to device node holding property - * @name: Name of property to hide - * @return hidden name if ok, otherwise NULL - */ -const char *dev_hide_prop(struct udevice *dev, const char *propname); - -/** - * dev_present_prop() - present a property hidden before - * - * @np: Pointer to device node holding property - * @name: Hidden name of property - * @return 0 if ok, otherwise failed - */ -int dev_present_prop(struct udevice *dev, const char *propname); - /** * dev_read_alias_seq() - Get the alias sequence number of a node *