[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220113085208.2636517-3-michael@walle.cc>
Date: Thu, 13 Jan 2022 09:52:07 +0100
From: Michael Walle <michael@...le.cc>
To: devicetree@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: Rob Herring <robh+dt@...nel.org>,
Frank Rowand <frowand.list@...il.com>,
Michael Walle <michael@...le.cc>
Subject: [PATCH 2/3] of: property: use unsigned index for of_link_property()
Now that of_parse_handle() and its variants take an unsigned int,
convert the index used in of_link_property() and its called functions
to unsigned too.
Signed-off-by: Michael Walle <michael@...le.cc>
---
drivers/of/property.c | 27 ++++++++++++++++++---------
1 file changed, 18 insertions(+), 9 deletions(-)
diff --git a/drivers/of/property.c b/drivers/of/property.c
index 8e90071de6ed..e77fb6cda0b7 100644
--- a/drivers/of/property.c
+++ b/drivers/of/property.c
@@ -1173,7 +1173,8 @@ static int of_link_to_phandle(struct device_node *con_np,
* - NULL if no phandle found at index
*/
static struct device_node *parse_prop_cells(struct device_node *np,
- const char *prop_name, int index,
+ const char *prop_name,
+ unsigned int index,
const char *list_name,
const char *cells_name)
{
@@ -1191,7 +1192,8 @@ static struct device_node *parse_prop_cells(struct device_node *np,
#define DEFINE_SIMPLE_PROP(fname, name, cells) \
static struct device_node *parse_##fname(struct device_node *np, \
- const char *prop_name, int index) \
+ const char *prop_name, \
+ unsigned int index) \
{ \
return parse_prop_cells(np, prop_name, index, name, cells); \
}
@@ -1227,7 +1229,8 @@ static int strcmp_suffix(const char *str, const char *suffix)
* - NULL if no phandle found at index
*/
static struct device_node *parse_suffix_prop_cells(struct device_node *np,
- const char *prop_name, int index,
+ const char *prop_name,
+ unsigned int index,
const char *suffix,
const char *cells_name)
{
@@ -1245,7 +1248,8 @@ static struct device_node *parse_suffix_prop_cells(struct device_node *np,
#define DEFINE_SUFFIX_PROP(fname, suffix, cells) \
static struct device_node *parse_##fname(struct device_node *np, \
- const char *prop_name, int index) \
+ const char *prop_name, \
+ unsigned int index) \
{ \
return parse_suffix_prop_cells(np, prop_name, index, suffix, cells); \
}
@@ -1272,7 +1276,8 @@ static struct device_node *parse_##fname(struct device_node *np, \
*/
struct supplier_bindings {
struct device_node *(*parse_prop)(struct device_node *np,
- const char *prop_name, int index);
+ const char *prop_name,
+ unsigned int index);
bool optional;
bool node_not_dev;
};
@@ -1308,7 +1313,8 @@ DEFINE_SUFFIX_PROP(regulators, "-supply", NULL)
DEFINE_SUFFIX_PROP(gpio, "-gpio", "#gpio-cells")
static struct device_node *parse_gpios(struct device_node *np,
- const char *prop_name, int index)
+ const char *prop_name,
+ unsigned int index)
{
if (!strcmp_suffix(prop_name, ",nr-gpios"))
return NULL;
@@ -1318,7 +1324,8 @@ static struct device_node *parse_gpios(struct device_node *np,
}
static struct device_node *parse_iommu_maps(struct device_node *np,
- const char *prop_name, int index)
+ const char *prop_name,
+ unsigned int index)
{
if (strcmp(prop_name, "iommu-map"))
return NULL;
@@ -1327,7 +1334,8 @@ static struct device_node *parse_iommu_maps(struct device_node *np,
}
static struct device_node *parse_gpio_compat(struct device_node *np,
- const char *prop_name, int index)
+ const char *prop_name,
+ unsigned int index)
{
struct of_phandle_args sup_args;
@@ -1349,7 +1357,8 @@ static struct device_node *parse_gpio_compat(struct device_node *np,
}
static struct device_node *parse_interrupts(struct device_node *np,
- const char *prop_name, int index)
+ const char *prop_name,
+ unsigned int index)
{
struct of_phandle_args sup_args;
--
2.30.2
Powered by blists - more mailing lists