[PATCH 5/6] Add OF-tree support to RapidIO controller driver.

Stephen Rothwell sfr at canb.auug.org.au
Tue Feb 5 16:44:25 EST 2008


On Wed, 30 Jan 2008 18:30:52 +0800 Zhang Wei <wei.zhang at freescale.com> wrote:
>
> -void fsl_rio_setup(int law_start, int law_size)
> +int fsl_rio_setup(struct of_device *dev)
>  {

> +	if (!dev->node) {
> +		dev_err(&dev->dev, "Device OF-Node is NULL");
> +		return -EFAULT;

Probably -EINVAL would be better. Here and all the other -EFAULTs.

> +	aw = *(u32 *)of_get_property(dev->node, "#address-cells", NULL);
> +	sw = *(u32 *)of_get_property(dev->node, "#size-cells", NULL);

What happens if either of these properties is missing?

> +static struct of_device_id fsl_of_rio_rpn_ids[] = {

This should be "const" please.

-- 
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/20080205/83ac7592/attachment.pgp>


More information about the Linuxppc-dev mailing list