[PATCH] of: Return success from of_dma_set_restricted_buffer() when !OF_ADDRESS

From: Will Deacon
Date: Fri Jul 02 2021 - 09:13:28 EST


When CONFIG_OF_ADDRESS=n, of_dma_set_restricted_buffer() returns -ENODEV
and breaks the boot for sparc[64] machines. Return 0 instead, since the
function is essentially a glorified NOP in this configuration.

Cc: Claire Chang <tientzu@xxxxxxxxxxxx>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Reported-by: Guenter Roeck <linux@xxxxxxxxxxxx>
Suggested-by: Robin Murphy <robin.murphy@xxxxxxx>
Link: https://lore.kernel.org/r/20210702030807.GA2685166@xxxxxxxxxxxx
Signed-off-by: Will Deacon <will@xxxxxxxxxx>
---
drivers/of/of_private.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/of/of_private.h b/drivers/of/of_private.h
index 8fde97565d11..34dd548c5eac 100644
--- a/drivers/of/of_private.h
+++ b/drivers/of/of_private.h
@@ -173,7 +173,8 @@ static inline int of_dma_get_range(struct device_node *np,
static inline int of_dma_set_restricted_buffer(struct device *dev,
struct device_node *np)
{
- return -ENODEV;
+ /* Do nothing, successfully. */
+ return 0;
}
#endif

--
2.32.0.93.g670b81a890-goog