coresight: Do not default to CPU0 for missing CPU phandle
[linux-2.6-microblaze.git] / drivers / hwtracing / coresight / coresight-cpu-debug.c
index 07a1367..58bfd63 100644 (file)
@@ -579,6 +579,9 @@ static int debug_probe(struct amba_device *adev, const struct amba_id *id)
                return -ENOMEM;
 
        drvdata->cpu = coresight_get_cpu(dev);
+       if (drvdata->cpu < 0)
+               return drvdata->cpu;
+
        if (per_cpu(debug_drvdata, drvdata->cpu)) {
                dev_err(dev, "CPU%d drvdata has already been initialized\n",
                        drvdata->cpu);