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

Commit 5d5bf240 authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "coresight: Affinity to invalid if no cpu nodes are found"

parents 50007703 89708a1a
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -977,7 +977,11 @@ static int etm4_probe(struct amba_device *adev, const struct amba_id *id)

	spin_lock_init(&drvdata->spinlock);

	drvdata->cpu = pdata ? pdata->cpu : 0;
	drvdata->cpu = pdata ? pdata->cpu : -ENODEV;
	if (drvdata->cpu == -ENODEV) {
		dev_info(dev, "CPU not available\n");
		return -ENODEV;
	}

	cpus_read_lock();
	ret = smp_call_function_single(drvdata->cpu,
+6 −4
Original line number Diff line number Diff line
@@ -103,14 +103,16 @@ int of_coresight_get_cpu(const struct device_node *node)
	struct device_node *dn;

	dn = of_parse_phandle(node, "cpu", 0);
	/* Affinity defaults to CPU0 */

	/* Affinity defaults to invalid */
	if (!dn)
		return 0;
		return -ENODEV;

	cpu = of_cpu_node_to_id(dn);
	of_node_put(dn);

	/* Affinity to CPU0 if no cpu nodes are found */
	return (cpu < 0) ? 0 : cpu;
	/* Affinity to invalid if no cpu nodes are found */
	return (cpu < 0) ? -ENODEV : cpu;
}
EXPORT_SYMBOL_GPL(of_coresight_get_cpu);