From patchwork Sat Oct 22 19:23:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jon Hunter X-Patchwork-Id: 685440 X-Patchwork-Delegate: treding@nvidia.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3t1XXn2DXjz9t0w for ; Sun, 23 Oct 2016 06:24:09 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755499AbcJVTYI (ORCPT ); Sat, 22 Oct 2016 15:24:08 -0400 Received: from hqemgate15.nvidia.com ([216.228.121.64]:6680 "EHLO hqemgate15.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755185AbcJVTYI (ORCPT ); Sat, 22 Oct 2016 15:24:08 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate15.nvidia.com id ; Sat, 22 Oct 2016 12:23:47 -0700 Received: from HQMAIL101.nvidia.com ([172.20.13.39]) by hqpgpgate101.nvidia.com (PGP Universal service); Sat, 22 Oct 2016 12:24:06 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Sat, 22 Oct 2016 12:24:06 -0700 Received: from HQMAIL108.nvidia.com (172.18.146.13) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Sat, 22 Oct 2016 19:24:07 +0000 Received: from hqnvemgw01.nvidia.com (172.20.150.20) by HQMAIL108.nvidia.com (172.18.146.13) with Microsoft SMTP Server id 15.0.1210.3 via Frontend Transport; Sat, 22 Oct 2016 19:24:07 +0000 Received: from dhcp-10-21-132-102.nvidia.com (Not Verified[10.26.11.248]) by hqnvemgw01.nvidia.com with Trustwave SEG (v7, 5, 5, 8150) id ; Sat, 22 Oct 2016 12:24:06 -0700 From: Jon Hunter To: Stephen Warren , Thierry Reding , Alexandre Courbot CC: , Jon Hunter Subject: [PATCH 3/5] soc/tegra: Clean-up PMC rail IO error messages Date: Sat, 22 Oct 2016 20:23:54 +0100 Message-ID: <1477164236-29351-4-git-send-email-jonathanh@nvidia.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1477164236-29351-1-git-send-email-jonathanh@nvidia.com> References: <1477164236-29351-1-git-send-email-jonathanh@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org Clean-up the error messages in the PMC rail IO functions by: 1. Using pr_err instead of pr_info which is currently used. 2. Use the compiler __func__ marco for displaying the function name. 3. Add specific error messages to the function tegra_io_rail_prepare() instead of just reporting it failed. Signed-off-by: Jon Hunter --- drivers/soc/tegra/pmc.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c index 6a6df6e8bfd6..8c9797379949 100644 --- a/drivers/soc/tegra/pmc.c +++ b/drivers/soc/tegra/pmc.c @@ -919,8 +919,10 @@ static int tegra_io_rail_prepare(unsigned int id, unsigned long *request, * There are two sets of 30 bits to select IO rails, but bits 30 and * 31 are control bits rather than IO rail selection bits. */ - if (id > 63 || *bit & IO_DPD_REQ_CODE_MASK) + if (id > 63 || *bit & IO_DPD_REQ_CODE_MASK) { + pr_err("%s(): invalid rail ID %d\n", __func__, id); return -EINVAL; + } if (id < 32) { *status = IO_DPD_STATUS; @@ -931,8 +933,10 @@ static int tegra_io_rail_prepare(unsigned int id, unsigned long *request, } rate = clk_get_rate(pmc->clk); - if (!rate) + if (!rate) { + pr_err("%s(): failed to get clock rate\n", __func__); return -ENODEV; + } tegra_pmc_writel(DPD_SAMPLE_ENABLE, DPD_SAMPLE); @@ -983,7 +987,7 @@ int tegra_io_rail_power_on(unsigned int id) err = tegra_io_rail_poll(status, bit, 0, 250); if (err) { - pr_info("tegra_io_rail_poll() failed: %d\n", err); + pr_err("%s(): failed to power on rail %d\n", __func__, id); goto error; } @@ -1005,16 +1009,16 @@ int tegra_io_rail_power_off(unsigned int id) mutex_lock(&pmc->powergates_lock); err = tegra_io_rail_prepare(id, &request, &status, &bit); - if (err) { - pr_info("tegra_io_rail_prepare() failed: %d\n", err); + if (err) goto error; - } tegra_pmc_writel(IO_DPD_REQ_CODE_ON | bit, request); err = tegra_io_rail_poll(status, bit, bit, 250); - if (err) + if (err) { + pr_err("%s(): failed to power off rail %d\n", __func__, id); goto error; + } tegra_io_rail_unprepare();