[PATCH] Power5,Power6 BSR driver

Benjamin Herrenschmidt benh at kernel.crashing.org
Mon Jul 7 14:59:35 EST 2008


> +		cur->bsr_addr   = reg[i * 2];
> +		cur->bsr_len    = reg[i * 2 + 1];

That's fishy... hand-reading of "reg" property without taking
into account the parent's #size-cells/#address-cells... can't you
use of_address_to_resource or something similar and carry a struct
resource around instead ?

In fact, same goes with the way you do num_bsr_devs = reg_len / 16.

You should rather use -another- property of well known lenght, or
get the #address/#size-cells of the parent and use those appropriately.

Cheers,
Ben.






More information about the Linuxppc-dev mailing list