diff options
| author | Albert ARIBAUD <albert.u.boot@aribaud.net> | 2013-05-30 14:45:06 +0200 | 
|---|---|---|
| committer | Albert ARIBAUD <albert.u.boot@aribaud.net> | 2013-05-30 14:45:06 +0200 | 
| commit | a19b0dd62d7b8efc658fa1aa685ff5665878f3ee (patch) | |
| tree | 1fadf0fb3da83203ba28f209ec99e1b33e03f4d5 /arch/powerpc/cpu/mpc85xx/portals.c | |
| parent | 60985bba58e7695dac1fddae8cdbb62d8cfd1254 (diff) | |
| parent | a71d45d706a5b51c348160163b6c159632273fed (diff) | |
| download | olio-uboot-2014.01-a19b0dd62d7b8efc658fa1aa685ff5665878f3ee.tar.xz olio-uboot-2014.01-a19b0dd62d7b8efc658fa1aa685ff5665878f3ee.zip | |
Merge branch 'u-boot/master' into 'u-boot-arm/master'
Conflicts:
	common/cmd_fpga.c
	drivers/usb/host/ohci-at91.c
Diffstat (limited to 'arch/powerpc/cpu/mpc85xx/portals.c')
| -rw-r--r-- | arch/powerpc/cpu/mpc85xx/portals.c | 36 | 
1 files changed, 22 insertions, 14 deletions
| diff --git a/arch/powerpc/cpu/mpc85xx/portals.c b/arch/powerpc/cpu/mpc85xx/portals.c index d529095ee..672edde45 100644 --- a/arch/powerpc/cpu/mpc85xx/portals.c +++ b/arch/powerpc/cpu/mpc85xx/portals.c @@ -128,24 +128,32 @@ static int fdt_qportal(void *blob, int off, int id, char *name,  	childoff = fdt_subnode_offset(blob, off, name);  	if (create) { -		if (childoff <= 0) -			childoff = fdt_add_subnode(blob, off, name); +		char handle[64], *p; -		if (childoff > 0) { -			char handle[64], *p; +		strncpy(handle, name, sizeof(handle)); +		p = strchr(handle, '@'); +		if (!strncmp(name, "fman", 4)) { +			*p = *(p + 1); +			p++; +		} +		*p = '\0'; -			strncpy(handle, name, sizeof(handle)); -			p = strchr(handle, '@'); -			if (!strncmp(name, "fman", 4)) { -				*p = *(p + 1); -				p++; -			} -			*p = '\0'; +		dev_off = fdt_path_offset(blob, handle); +		/* skip this node if alias is not found */ +		if (dev_off == -FDT_ERR_BADPATH) +			return 0; +		if (dev_off < 0) +			return dev_off; -			dev_off = fdt_path_offset(blob, handle); -			if (dev_off < 0) -				return dev_off; +		if (childoff <= 0) +			childoff = fdt_add_subnode(blob, off, name); +		/* need to update the dev_off after adding a subnode */ +		dev_off = fdt_path_offset(blob, handle); +		if (dev_off < 0) +			return dev_off; + +		if (childoff > 0) {  			dev_handle = fdt_get_phandle(blob, dev_off);  			if (dev_handle <= 0) {  				dev_handle = fdt_alloc_phandle(blob); |