From patchwork Fri Apr 7 15:22:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 97029 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp331584qgd; Fri, 7 Apr 2017 08:22:56 -0700 (PDT) X-Received: by 10.84.211.97 with SMTP id b88mr51358261pli.113.1491578576153; Fri, 07 Apr 2017 08:22:56 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p29si5414522pli.113.2017.04.07.08.22.55; Fri, 07 Apr 2017 08:22:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934169AbdDGPWv (ORCPT + 13 others); Fri, 7 Apr 2017 11:22:51 -0400 Received: from mail-pg0-f51.google.com ([74.125.83.51]:34841 "EHLO mail-pg0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933593AbdDGPWo (ORCPT ); Fri, 7 Apr 2017 11:22:44 -0400 Received: by mail-pg0-f51.google.com with SMTP id 81so69678598pgh.2 for ; Fri, 07 Apr 2017 08:22:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=P30P4b0J+r8FQ55cp9nJo4dLSdsuVGYP5YWzTbKXpeY=; b=OiUleCgsJGHWIsuvmnvqTAigp7rEiIbLldJ1j5tg964l7YnszSKi9X8KxIv828bGDu oNgtV801/9buvnZQ1X9hY3t8V1M8QqDAVnpq0NjrB13pgboDISOZxurvagBrjrhOFVBQ 0Xu2qt1KfVpzyd55MZYNh0/AZVUngrX/gc8cE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=P30P4b0J+r8FQ55cp9nJo4dLSdsuVGYP5YWzTbKXpeY=; b=ojAinZPgTWlTTQ2CEUIplgfXjOCfqBMp3Ublwmkm19KaejK/Sf+w18714Eo1w1siuS wNWUjYmFpH5x+/7nCbMe/7dyNA+3IThLR/gIKK/d+8CllpgMTveRfFpGBId7tD3m8Nzb bMh6FkmihwyUqXxEV+RQHk/Op6HvpFzNtnlfaDWKfx5P/L38C8/+Wd2eT1At3VBvxiRL gNHlSGklNx0DInKlNWAiBL6f4vg1kY3MwrDMJGZa6Cbn7TLbK0fP3gLHYoo8yNXUg+Te rRX5zB3qmOTwM5FtesfR6H7znrOGQ11ycLqt/LX9erkLdfr2tIYsla982GYkxGpHR4u1 KmNA== X-Gm-Message-State: AFeK/H04Bs/ZtGJwk46Ust/FYzlcnfTwm62OdL2xYhi6UPRlP30I3Stig9bzWzOYt2tny6T7 X-Received: by 10.99.94.195 with SMTP id s186mr42362616pgb.197.1491578558702; Fri, 07 Apr 2017 08:22:38 -0700 (PDT) Received: from localhost.localdomain (li1563-109.members.linode.com. [139.162.83.109]) by smtp.gmail.com with ESMTPSA id u129sm10322792pfu.48.2017.04.07.08.22.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 07 Apr 2017 08:22:36 -0700 (PDT) From: Leo Yan To: Mathieu Poirier , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Leo Yan Subject: [PATCH] coresight: tmc: minor fix for output log Date: Fri, 7 Apr 2017 23:22:00 +0800 Message-Id: <1491578520-5957-1-git-send-email-leo.yan@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In current code the output logs are not well symmetric for sink and link enabling and disabling. This patch is to fix that so can output paired logs. Cc: Mathieu Poirier Signed-off-by: Leo Yan --- drivers/hwtracing/coresight/coresight-tmc-etf.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) -- 2.7.4 diff --git a/drivers/hwtracing/coresight/coresight-tmc-etf.c b/drivers/hwtracing/coresight/coresight-tmc-etf.c index 1549436..3a1c181 100644 --- a/drivers/hwtracing/coresight/coresight-tmc-etf.c +++ b/drivers/hwtracing/coresight/coresight-tmc-etf.c @@ -166,9 +166,6 @@ static int tmc_enable_etf_sink_sysfs(struct coresight_device *csdev) if (!used) kfree(buf); - if (!ret) - dev_info(drvdata->dev, "TMC-ETB/ETF enabled\n"); - return ret; } @@ -204,15 +201,27 @@ static int tmc_enable_etf_sink_perf(struct coresight_device *csdev) static int tmc_enable_etf_sink(struct coresight_device *csdev, u32 mode) { + int ret; + struct tmc_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent); + switch (mode) { case CS_MODE_SYSFS: - return tmc_enable_etf_sink_sysfs(csdev); + ret = tmc_enable_etf_sink_sysfs(csdev); + break; case CS_MODE_PERF: - return tmc_enable_etf_sink_perf(csdev); + ret = tmc_enable_etf_sink_perf(csdev); + break; + /* We shouldn't be here */ + default: + ret = -EINVAL; + break; } - /* We shouldn't be here */ - return -EINVAL; + if (ret) + return ret; + + dev_info(drvdata->dev, "TMC-ETB/ETF enabled\n"); + return 0; } static void tmc_disable_etf_sink(struct coresight_device *csdev) @@ -273,7 +282,7 @@ static void tmc_disable_etf_link(struct coresight_device *csdev, drvdata->mode = CS_MODE_DISABLED; spin_unlock_irqrestore(&drvdata->spinlock, flags); - dev_info(drvdata->dev, "TMC disabled\n"); + dev_info(drvdata->dev, "TMC-ETF disabled\n"); } static void *tmc_alloc_etf_buffer(struct coresight_device *csdev, int cpu,