9
0
Fork 0

of_add_memory: check the device_type is memory

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Jean-Christophe PLAGNIOL-VILLARD 2013-02-13 19:09:05 +01:00 committed by Sascha Hauer
parent 9acb6113f0
commit 210bb761d8
1 changed files with 7 additions and 4 deletions

View File

@ -693,12 +693,15 @@ int of_add_memory(struct device_node *node, bool dump)
{
int na, nc;
const __be32 *reg, *endp;
int len, r = 0;
int len, r = 0, ret;
static char str[6];
struct property *type;
const char *device_type;
type = of_find_property(node, "device_type");
if (!type)
ret = of_property_read_string(node, "device_type", &device_type);
if (ret)
return -ENXIO;
if (strcmp(device_type, "memory"))
return -ENXIO;
of_bus_count_cells(node, &na, &nc);