[PATCH v3] 83xx USB platform code rework

Stephen Rothwell sfr at canb.auug.org.au
Fri May 11 22:13:04 EST 2007


On Fri, 11 May 2007 19:32:37 +0800 Li Yang <leoli at freescale.com> wrote:
>
> +	if ((np = of_find_compatible_node(NULL, "usb", "fsl-usb2-dr"))
> +				!= NULL) {

Normally we like to separate the assignment from the test.  There are a
couple of other places like this.

> +		} else if (prop && !strcmp(prop, "serial")) {
> +			if (!strcmp(of_get_property(np, "dr_mode", NULL), "otg")) {
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Is there any chance that np doesn't have a "dr_mode" property?

> +#ifdef CONFIG_USB_OTG
> +		/* Set OTG_PORT */
> +		if (!strcmp(of_get_property(np, "dr_mode", NULL), "otg"))
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Again.

--
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/20070511/eb351f6a/attachment.pgp>


More information about the Linuxppc-dev mailing list