This take the approach used by cell_edac.c to obtain the total memory from
the devicetree and applies it to mv64x60_edac.c, altera_edac.c and
cpc925_edac.c which were all manually parsing the reg property. In the case
of mv64x60 this actually fixes cases where #address/size-cells != 1. For
altera and cpc925 this is just a cleanup.
Chris Packham (3):
EDAC: mv64x60: calculate memory size correctly
EDAC: altera: simplify calculation of total memory
EDAC: cpc925: simplify calculation of total memory
The #address-cells and #size-cells properties need to be accounted for
when dealing with the "memory" device tree node. Use
of_address_to_resource() and resource_size() to retrieve the size of the
memory node which will automatically take the #cells into account.
Signed-off-by: Chris Packham <[hidden email]>
Changes in v2:
- Use of_address_to_resource() instead of manually parsing the reg property.
Re: [PATCH v2 2/3] EDAC: altera: simplify calculation of total memory
On Mon, Jun 12, 2017 at 01:34:05PM -0500, Thor Thayer wrote:
> On 06/06/2017 06:54 PM, Chris Packham wrote:
> > Use of_address_to_resource() and resource_size() instead of manually
> > parsing the "reg" property from the "memory" node(s).
> > Signed-off-by: Chris Packham <[hidden email]>
> > ---