From b1d06b60e90cd5016798b9984f8e420e753f4846 Mon Sep 17 00:00:00 2001 From: Guenter Roeck Date: Fri, 6 Nov 2015 19:28:22 -0800 Subject: 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: 876133d3161d ("net: hisilicon: add OF dependency") Cc: Arnd Bergmann Signed-off-by: Guenter Roeck Reviewed-by: Arnd Bergmann Reviewed-by: Frank Rowand Signed-off-by: Rob Herring --- include/linux/of_address.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/linux/of_address.h') diff --git a/include/linux/of_address.h b/include/linux/of_address.h index d88e81b..507daad 100644 --- a/include/linux/of_address.h +++ b/include/linux/of_address.h @@ -57,6 +57,13 @@ extern int of_dma_get_range(struct device_node *np, u64 *dma_addr, u64 *paddr, u64 *size); extern bool of_dma_is_coherent(struct device_node *np); #else /* CONFIG_OF_ADDRESS */ + +static inline u64 of_translate_address(struct device_node *np, + const __be32 *addr) +{ + return OF_BAD_ADDR; +} + static inline struct device_node *of_find_matching_node_by_address( struct device_node *from, const struct of_device_id *matches, -- cgit v1.1