Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 484a033b authored by Olof Johansson's avatar Olof Johansson
Browse files

Merge tag 'hisi-armv7-soc-for-4.19' of git://github.com/hisilicon/linux-hisi into next/soc

ARM: mach-hisi: Hisilicon SoC updates for 4.19

- check of_iomap and add missing of_node_put since of_find_compatible_node
  is invoked on hisilicon SoCs like hip01, hix5hd2 and hi3xxx.

* tag 'hisi-armv7-soc-for-4.19' of git://github.com/hisilicon/linux-hisi

:
  ARM: hisi: handle of_iomap and fix missing of_node_put
  ARM: hisi: check of_iomap and fix missing of_node_put
  ARM: hisi: fix error handling and missing of_node_put

Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
parents 07167d8a d396cb18
Loading
Loading
Loading
Loading
+26 −15
Original line number Diff line number Diff line
@@ -148,14 +148,21 @@ static int hi3xxx_hotplug_init(void)
	struct device_node *node;

	node = of_find_compatible_node(NULL, NULL, "hisilicon,sysctrl");
	if (node) {
	if (!node) {
		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;
}
	id = ERROR_CTRL;
	return -ENOENT;
}

void hi3xxx_set_cpu(int cpu, bool enable)
{
@@ -173,11 +180,15 @@ static bool hix5hd2_hotplug_init(void)
	struct device_node *np;

	np = of_find_compatible_node(NULL, NULL, "hisilicon,cpuctrl");
	if (np) {
	if (!np)
		return false;

	ctrl_base = of_iomap(np, 0);
		return true;
	}
	of_node_put(np);
	if (!ctrl_base)
		return false;

	return true;
}

void hix5hd2_set_cpu(int cpu, bool enable)
@@ -219,10 +230,10 @@ void hip01_set_cpu(int cpu, bool enable)

	if (!ctrl_base) {
		np = of_find_compatible_node(NULL, NULL, "hisilicon,hip01-sysctrl");
		if (np)
		BUG_ON(!np);
		ctrl_base = of_iomap(np, 0);
		else
			BUG();
		of_node_put(np);
		BUG_ON(!ctrl_base);
	}

	if (enable) {