cpu online() check is done in coresight_validate_source_sysfs() already. Therefore, remove redundant check in etm_enable_sysfs().
Signed-off-by: Yeoreum Yun yeoreum.yun@arm.com --- .../coresight/coresight-etm3x-core.c | 31 ++++++++----------- 1 file changed, 13 insertions(+), 18 deletions(-)
diff --git a/drivers/hwtracing/coresight/coresight-etm3x-core.c b/drivers/hwtracing/coresight/coresight-etm3x-core.c index ed27e35b42ec..9dbfe6a1dc4d 100644 --- a/drivers/hwtracing/coresight/coresight-etm3x-core.c +++ b/drivers/hwtracing/coresight/coresight-etm3x-core.c @@ -520,25 +520,20 @@ static int etm_enable_sysfs(struct coresight_device *csdev, struct coresight_pat struct etm_enable_arg arg = { }; int ret;
- /* - * Configure the ETM only if the CPU is online. If it isn't online - * hw configuration will take place on the local CPU during bring up. - */ - if (cpu_online(drvdata->cpu)) { - arg.drvdata = drvdata; - arg.path = path; - - raw_spin_lock(&drvdata->spinlock); - arg.config = drvdata->config; - raw_spin_unlock(&drvdata->spinlock); - - ret = smp_call_function_single(drvdata->cpu, - etm_enable_sysfs_smp_call, &arg, 1); - if (!ret) - ret = arg.rc; - } else { + arg.drvdata = drvdata; + arg.path = path; + + raw_spin_lock(&drvdata->spinlock); + arg.config = drvdata->config; + raw_spin_unlock(&drvdata->spinlock); + + ret = smp_call_function_single(drvdata->cpu, + etm_enable_sysfs_smp_call, &arg, 1); + + if (!ret) + ret = arg.rc; + else ret = -ENODEV; - }
if (!ret) dev_dbg(&csdev->dev, "ETM tracing enabled\n");