projects
/
platform
/
kernel
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge git://git.denx.de/u-boot-dm
[platform/kernel/u-boot.git]
/
drivers
/
pinctrl
/
pinctrl-uclass.c
diff --git
a/drivers/pinctrl/pinctrl-uclass.c
b/drivers/pinctrl/pinctrl-uclass.c
index
7397de2
..
114952a
100644
(file)
--- a/
drivers/pinctrl/pinctrl-uclass.c
+++ b/
drivers/pinctrl/pinctrl-uclass.c
@@
-8,10
+8,10
@@
#include <libfdt.h>
#include <linux/err.h>
#include <linux/list.h>
#include <libfdt.h>
#include <linux/err.h>
#include <linux/list.h>
-#include <dm
/device
.h>
+#include <dm.h>
#include <dm/lists.h>
#include <dm/pinctrl.h>
#include <dm/lists.h>
#include <dm/pinctrl.h>
-#include <dm/u
class
.h>
+#include <dm/u
til
.h>
DECLARE_GLOBAL_DATA_PTR;
DECLARE_GLOBAL_DATA_PTR;
@@
-64,7
+64,7
@@
static int pinctrl_config_one(struct udevice *config)
static int pinctrl_select_state_full(struct udevice *dev, const char *statename)
{
const void *fdt = gd->fdt_blob;
static int pinctrl_select_state_full(struct udevice *dev, const char *statename)
{
const void *fdt = gd->fdt_blob;
- int node = dev
->of_offset
;
+ int node = dev
_of_offset(dev)
;
char propname[32]; /* long enough */
const fdt32_t *list;
uint32_t phandle;
char propname[32]; /* long enough */
const fdt32_t *list;
uint32_t phandle;
@@
-72,7
+72,7
@@
static int pinctrl_select_state_full(struct udevice *dev, const char *statename)
struct udevice *config;
int state, size, i, ret;
struct udevice *config;
int state, size, i, ret;
- state = fdt_
find_string
(fdt, node, "pinctrl-names", statename);
+ state = fdt_
stringlist_search
(fdt, node, "pinctrl-names", statename);
if (state < 0) {
char *end;
/*
if (state < 0) {
char *end;
/*
@@
-121,34
+121,31
@@
static int pinctrl_select_state_full(struct udevice *dev, const char *statename)
*/
static int pinconfig_post_bind(struct udevice *dev)
{
*/
static int pinconfig_post_bind(struct udevice *dev)
{
- const void *fdt = gd->fdt_blob;
- int offset = dev->of_offset;
bool pre_reloc_only = !(gd->flags & GD_FLG_RELOC);
const char *name;
bool pre_reloc_only = !(gd->flags & GD_FLG_RELOC);
const char *name;
+ ofnode node;
int ret;
int ret;
- for (offset = fdt_first_subnode(fdt, offset);
- offset > 0;
- offset = fdt_next_subnode(fdt, offset)) {
+ dev_for_each_subnode(node, dev) {
if (pre_reloc_only &&
if (pre_reloc_only &&
- !
fdt_getprop(fdt, offset, "u-boot,dm-pre-reloc", NULL
))
+ !
ofnode_pre_reloc(node
))
continue;
/*
* If this node has "compatible" property, this is not
* a pin configuration node, but a normal device. skip.
*/
continue;
/*
* If this node has "compatible" property, this is not
* a pin configuration node, but a normal device. skip.
*/
-
fdt_get_property(fdt, offset
, "compatible", &ret);
+
ofnode_get_property(node
, "compatible", &ret);
if (ret >= 0)
continue;
if (ret != -FDT_ERR_NOTFOUND)
return ret;
if (ret >= 0)
continue;
if (ret != -FDT_ERR_NOTFOUND)
return ret;
- name =
fdt_get_name(fdt, offset, NULL
);
+ name =
ofnode_get_name(node
);
if (!name)
return -EINVAL;
ret = device_bind_driver_to_node(dev, "pinconfig", name,
if (!name)
return -EINVAL;
ret = device_bind_driver_to_node(dev, "pinconfig", name,
-
offset
, NULL);
+
node
, NULL);
if (ret)
return ret;
}
if (ret)
return ret;
}