summaryrefslogtreecommitdiffstats
path: root/drivers/hwtracing/coresight/coresight-platform.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hwtracing/coresight/coresight-platform.c')
-rw-r--r--drivers/hwtracing/coresight/coresight-platform.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/hwtracing/coresight/coresight-platform.c b/drivers/hwtracing/coresight/coresight-platform.c
index 3c5ceda8db24..cf580ffbc27c 100644
--- a/drivers/hwtracing/coresight/coresight-platform.c
+++ b/drivers/hwtracing/coresight/coresight-platform.c
@@ -159,16 +159,16 @@ static int of_coresight_get_cpu(struct device *dev)
struct device_node *dn;
if (!dev->of_node)
- return 0;
+ return -ENODEV;
+
dn = of_parse_phandle(dev->of_node, "cpu", 0);
- /* Affinity defaults to CPU0 */
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;
+ return cpu;
}
/*
@@ -310,7 +310,7 @@ of_get_coresight_platform_data(struct device *dev,
static inline int of_coresight_get_cpu(struct device *dev)
{
- return 0;
+ return -ENODEV;
}
#endif
@@ -734,14 +734,14 @@ static int acpi_coresight_get_cpu(struct device *dev)
struct acpi_device *adev = ACPI_COMPANION(dev);
if (!adev)
- return 0;
+ return -ENODEV;
status = acpi_get_parent(adev->handle, &cpu_handle);
if (ACPI_FAILURE(status))
- return 0;
+ return -ENODEV;
cpu = acpi_handle_to_logical_cpuid(cpu_handle);
if (cpu >= nr_cpu_ids)
- return 0;
+ return -ENODEV;
return cpu;
}
@@ -769,7 +769,7 @@ acpi_get_coresight_platform_data(struct device *dev,
static inline int acpi_coresight_get_cpu(struct device *dev)
{
- return 0;
+ return -ENODEV;
}
#endif