]> git.baikalelectronics.ru Git - kernel.git/commit
of: Provide static inline function for of_translate_address if needed
authorGuenter Roeck <linux@roeck-us.net>
Sat, 7 Nov 2015 03:28:22 +0000 (19:28 -0800)
committerRob Herring <robh@kernel.org>
Tue, 10 Nov 2015 23:27:12 +0000 (17:27 -0600)
commit87c880e2570d9108ad6f465d56448d5acc7d43f6
tree5ff1f8763ebddbcb9bb7a3a5cbc8a7b7029ab9ad
parent6b19894f454fdcb93434f7e52d4d3f7db17f4da2
of: Provide static inline function for of_translate_address if needed

If OF_ADDRESS is not configured, builds can fail with errors such as

drivers/net/ethernet/hisilicon/hns_mdio.c:
In function 'hns_mdio_bus_name':
drivers/net/ethernet/hisilicon/hns_mdio.c:411:3:
error: implicit declaration of function 'of_translate_address'

as currently seen when building sparc:allmodconfig.

Introduce a static inline function if OF_ADDRESS is not configured to fix
the build failure. Return OF_BAD_ADDR in this case. For this to work, the
definition of OF_BAD_ADDR has to be moved outside CONFIG_OF conditional
code.

Fixes: e72eb427b184 ("net: hisilicon: add OF dependency")
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Frank Rowand <frank.rowand@sonymobile.com>
Signed-off-by: Rob Herring <robh@kernel.org>
include/linux/of.h
include/linux/of_address.h