|
21 | 21 | #include <linux/platform_device.h>
|
22 | 22 | #include <linux/clk.h>
|
23 | 23 | #include <linux/of.h>
|
24 |
| -#include <linux/of_address.h> |
25 | 24 | #include <linux/of_clk.h>
|
26 | 25 | #include <linux/of_platform.h>
|
| 26 | +#include <linux/of_reserved_mem.h> |
27 | 27 | #include <linux/parser.h>
|
28 | 28 | #include <linux/pm_domain.h>
|
29 | 29 | #include <linux/regulator/consumer.h>
|
@@ -134,7 +134,7 @@ struct simplefb_params {
|
134 | 134 | static int simplefb_parse_dt(struct platform_device *pdev,
|
135 | 135 | struct simplefb_params *params)
|
136 | 136 | {
|
137 |
| - struct device_node *np = pdev->dev.of_node, *mem; |
| 137 | + struct device_node *np = pdev->dev.of_node; |
138 | 138 | int ret;
|
139 | 139 | const char *format;
|
140 | 140 | int i;
|
@@ -174,19 +174,10 @@ static int simplefb_parse_dt(struct platform_device *pdev,
|
174 | 174 | return -EINVAL;
|
175 | 175 | }
|
176 | 176 |
|
177 |
| - mem = of_parse_phandle(np, "memory-region", 0); |
178 |
| - if (mem) { |
179 |
| - ret = of_address_to_resource(mem, 0, ¶ms->memory); |
180 |
| - if (ret < 0) { |
181 |
| - dev_err(&pdev->dev, "failed to parse memory-region\n"); |
182 |
| - of_node_put(mem); |
183 |
| - return ret; |
184 |
| - } |
185 |
| - |
| 177 | + ret = of_reserved_mem_region_to_resource(np, 0, ¶ms->memory); |
| 178 | + if (!ret) { |
186 | 179 | if (of_property_present(np, "reg"))
|
187 | 180 | dev_warn(&pdev->dev, "preferring \"memory-region\" over \"reg\" property\n");
|
188 |
| - |
189 |
| - of_node_put(mem); |
190 | 181 | } else {
|
191 | 182 | memset(¶ms->memory, 0, sizeof(params->memory));
|
192 | 183 | }
|
|
0 commit comments