Driver calling of_reserved_mem_device_init() might be interested if the initialization has been successful or not, so add support for returning error code. This fixes a build warining caused by commit 7bfa5ab6fa1b ("drivers: dma-coherent: add initialization from device tree"), which has been merged without this change and without fixing function return value.
Showing the changes to include/linux (1 of 3 files). Show all
Unified · Split
| @@ -16,7 +16,7 @@ struct reserved_mem { · 15 unmodified lines | ||
| 16 | 16 | }; |
| 17 | 17 | |
| 18 | 18 | struct reserved_mem_ops { |
| 19 | − void (*device_init)(struct reserved_mem *rmem, | |
| 19 | + int (*device_init)(struct reserved_mem *rmem, | |
| 20 | 20 | struct device *dev); |
| 21 | 21 | void (*device_release)(struct reserved_mem *rmem, |
| 22 | 22 | struct device *dev); |
| @@ -28,14 +28,17 @@ typedef int (*reservedmem_of_init_fn)(struct reserved_mem *rmem); · 5 unmodified lines | ||
| 28 | 28 | _OF_DECLARE(reservedmem, name, compat, init, reservedmem_of_init_fn) |
| 29 | 29 | |
| 30 | 30 | #ifdef CONFIG_OF_RESERVED_MEM |
| 31 | −void of_reserved_mem_device_init(struct device *dev); | |
| 31 | +int of_reserved_mem_device_init(struct device *dev); | |
| 32 | 32 | void of_reserved_mem_device_release(struct device *dev); |
| 33 | 33 | |
| 34 | 34 | void fdt_init_reserved_mem(void); |
| 35 | 35 | void fdt_reserved_mem_save_node(unsigned long node, const char *uname, |
| 36 | 36 | phys_addr_t base, phys_addr_t size); |
| 37 | 37 | #else |
| 38 | −static inline void of_reserved_mem_device_init(struct device *dev) { } | |
| 38 | +static inline int of_reserved_mem_device_init(struct device *dev) | |
| 39 | +{ | |
| 40 | + return -ENOSYS; | |
| 41 | +} | |
| 39 | 42 | static inline void of_reserved_mem_device_release(struct device *pdev) { } |
| 40 | 43 | |
| 41 | 44 | static inline void fdt_init_reserved_mem(void) { } |