Introduce devres-based helper for of_reserved_mem_device_init() to help fight dangling references and ever so slightly reduce the number of boilerplate deinitialization calls.
Showing the changes to include (1 of 2 files). Show all
Unified · Split
| @@ -40,6 +40,8 @@ int of_reserved_mem_device_init_by_name(struct device *dev, · 39 unmodified lines | |||
| 40 | const char *name); | 40 | const char *name); |
| 41 | void of_reserved_mem_device_release(struct device *dev); | 41 | void of_reserved_mem_device_release(struct device *dev); |
| 42 | 42 | ||
| 43 | int devm_of_reserved_mem_device_init(struct device *dev); | ||
| 44 | |||
| 43 | struct reserved_mem *of_reserved_mem_lookup(struct device_node *np); | 45 | struct reserved_mem *of_reserved_mem_lookup(struct device_node *np); |
| 44 | int of_reserved_mem_region_to_resource(const struct device_node *np, | 46 | int of_reserved_mem_region_to_resource(const struct device_node *np, |
| 45 | unsigned int idx, struct resource *res); | 47 | unsigned int idx, struct resource *res); |
| @@ -68,6 +70,11 @@ static inline int of_reserved_mem_device_init_by_name(struct device *dev, · 22 unmodified lines | |||
| 68 | 70 | ||
| 69 | static inline void of_reserved_mem_device_release(struct device *pdev) { } | 71 | static inline void of_reserved_mem_device_release(struct device *pdev) { } |
| 70 | 72 | ||
| 73 | static inline int devm_of_reserved_mem_device_init(struct device *dev) | ||
| 74 | { | ||
| 75 | return -EOPNOTSUPP; | ||
| 76 | } | ||
| 77 | |||
| 71 | static inline struct reserved_mem *of_reserved_mem_lookup(struct device_node *np) | 78 | static inline struct reserved_mem *of_reserved_mem_lookup(struct device_node *np) |
| 72 | { | 79 | { |
| 73 | return NULL; | 80 | return NULL; |