of: base: add support to get machine model name
authorSudeep Holla <sudeep.holla@arm.com>
Thu, 17 Nov 2016 15:32:54 +0000 (15:32 +0000)
committerRob Herring <robh@kernel.org>
Fri, 18 Nov 2016 14:46:22 +0000 (08:46 -0600)
commite5269794d2e9046dd45be15bdb213a229df46b7e
tree01a74485ab7c185ed959b1caceb09b511e73c76a
parent4fb373dfabee1367b7553003b4d6491ee8bf4c2a
of: base: add support to get machine model name

Currently platforms/drivers needing to get the machine model name are
replicating the same snippet of code. In some case, the OF reference
counting is either missing or incorrect.

This patch adds support to read the machine model name either using
the "model" or the "compatible" property in the device tree root node
to the core OF/DT code.

This can be used to remove all the duplicate code snippets doing exactly
same thing later.

Cc: Rob Herring <robh+dt@kernel.org>
Cc: Frank Rowand <frowand.list@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Rob Herring <robh@kernel.org>
drivers/of/base.c
include/linux/of.h