History

of: reserved_mem: Introduce devres-managed initialization function

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.

Konrad Dybcio committed 3 months ago

Commit b71ace11 parent f4234822 files · +51 −0Browse files

Showing the changes to include (1 of 2 files). Show all

Unified · Split

include/linux/of_reserved_mem.h+7−0
@@ -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);
41void of_reserved_mem_device_release(struct device *dev);41void of_reserved_mem_device_release(struct device *dev);
42 42
43int devm_of_reserved_mem_device_init(struct device *dev);
44
43struct reserved_mem *of_reserved_mem_lookup(struct device_node *np);45struct reserved_mem *of_reserved_mem_lookup(struct device_node *np);
44int of_reserved_mem_region_to_resource(const struct device_node *np,46int 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
69static inline void of_reserved_mem_device_release(struct device *pdev) { }71static inline void of_reserved_mem_device_release(struct device *pdev) { }
70 72
73static inline int devm_of_reserved_mem_device_init(struct device *dev)
74{
75 return -EOPNOTSUPP;
76}
77
71static inline struct reserved_mem *of_reserved_mem_lookup(struct device_node *np)78static inline struct reserved_mem *of_reserved_mem_lookup(struct device_node *np)
72{79{
73 return NULL;80 return NULL;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t