|
@@ -148,13 +148,20 @@ static int hi3xxx_hotplug_init(void)
|
|
|
struct device_node *node;
|
|
|
|
|
|
node = of_find_compatible_node(NULL, NULL, "hisilicon,sysctrl");
|
|
|
- if (node) {
|
|
|
- ctrl_base = of_iomap(node, 0);
|
|
|
- id = HI3620_CTRL;
|
|
|
- return 0;
|
|
|
+ if (!node) {
|
|
|
+ id = ERROR_CTRL;
|
|
|
+ return -ENOENT;
|
|
|
}
|
|
|
- id = ERROR_CTRL;
|
|
|
- return -ENOENT;
|
|
|
+
|
|
|
+ ctrl_base = of_iomap(node, 0);
|
|
|
+ of_node_put(node);
|
|
|
+ if (!ctrl_base) {
|
|
|
+ id = ERROR_CTRL;
|
|
|
+ return -ENOMEM;
|
|
|
+ }
|
|
|
+
|
|
|
+ id = HI3620_CTRL;
|
|
|
+ return 0;
|
|
|
}
|
|
|
|
|
|
void hi3xxx_set_cpu(int cpu, bool enable)
|