[PATCH 3/3] USB device tree cleanups

Stephen Rothwell sfr at canb.auug.org.au
Tue Jan 8 10:10:28 EST 2008


On Mon,  7 Jan 2008 20:03:20 +0800 Li Yang <leoli at freescale.com> wrote:
>
> +++ b/arch/powerpc/sysdev/fsl_soc.c
> @@ -533,9 +533,7 @@ static int __init fsl_usb_of_init(void)
>  		*usb_dev_dr_client = NULL;
>  	int ret;
>  
> -	for (np = NULL, i = 0;
> -	     (np = of_find_compatible_node(np, "usb", "fsl-usb2-mph")) != NULL;
> -	     i++) {
> +	for_each_compatible_node(np, NULL, "fsl-usb2-mph") {

'i' is no longer being updated (or indeed set to anything) but is still
used in the loop - at least in Paulus' current tree).

>  		struct resource r[2];
>  		struct fsl_usb2_platform_data usb_data;
>  		const unsigned char *prop = NULL;
> @@ -580,9 +578,7 @@ static int __init fsl_usb_of_init(void)
>  			goto unreg_mph;
>  	}
>  
> -	for (np = NULL;
> -	     (np = of_find_compatible_node(np, "usb", "fsl-usb2-dr")) != NULL;
> -	     i++) {
> +	for_each_compatible_node(np, NULL, "fsl-usb2-dr") {

Same here.

-- 
Cheers,
Stephen Rothwell                    sfr at canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20080108/751f7917/attachment.pgp>


More information about the Linuxppc-dev mailing list