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

2008-02-17 Thread Zhang Wei
 

> -Original Message-
> From: Kumar Gala [mailto:[EMAIL PROTECTED] 
> 
> 
> On Feb 4, 2008, at 11:44 PM, Stephen Rothwell wrote:
> 
> >>
> >> +  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?
> 
> Should we add __must_check to of_get_property?
> 

You are right, I'll add the checking here.

Thanks!
Wei.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2008-02-17 Thread Zhang Wei
 

 -Original Message-
 From: Kumar Gala [mailto:[EMAIL PROTECTED] 
 
 
 On Feb 4, 2008, at 11:44 PM, Stephen Rothwell wrote:
 
 
  +  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?
 
 Should we add __must_check to of_get_property?
 

You are right, I'll add the checking here.

Thanks!
Wei.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2008-02-05 Thread Kumar Gala


On Feb 4, 2008, at 11:44 PM, Stephen Rothwell wrote:



+   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?


Should we add __must_check to of_get_property?

- k
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2008-02-05 Thread Kumar Gala


On Feb 4, 2008, at 11:44 PM, Stephen Rothwell wrote:



+   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?


Should we add __must_check to of_get_property?

- k
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2008-02-04 Thread Stephen Rothwell
On Wed, 30 Jan 2008 18:30:52 +0800 Zhang Wei <[EMAIL PROTECTED]> 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, "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[EMAIL PROTECTED]
http://www.canb.auug.org.au/~sfr/


pgp5nmctM9RR0.pgp
Description: PGP signature


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

2008-02-04 Thread Stephen Rothwell
On Wed, 30 Jan 2008 18:30:52 +0800 Zhang Wei [EMAIL PROTECTED] 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[EMAIL PROTECTED]
http://www.canb.auug.org.au/~sfr/


pgp5nmctM9RR0.pgp
Description: PGP signature