From patchwork Wed Jun 4 19:53:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nishanth Menon X-Patchwork-Id: 4296741 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 415C39F326 for ; Wed, 4 Jun 2014 19:54:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 754DF201DE for ; Wed, 4 Jun 2014 19:54:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 86392201DD for ; Wed, 4 Jun 2014 19:54:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751460AbaFDTyD (ORCPT ); Wed, 4 Jun 2014 15:54:03 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:52940 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750973AbaFDTyB (ORCPT ); Wed, 4 Jun 2014 15:54:01 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id s54JrQbT021934; Wed, 4 Jun 2014 14:53:26 -0500 Received: from DLEE70.ent.ti.com (dlee70.ent.ti.com [157.170.170.113]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s54JrQOG009549; Wed, 4 Jun 2014 14:53:26 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.174.1; Wed, 4 Jun 2014 14:53:26 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id s54JrQ0p016043; Wed, 4 Jun 2014 14:53:26 -0500 From: Nishanth Menon To: Liam Girdwood , Mark Brown CC: Alban Bedel , , , , Nishanth Menon Subject: [PATCH] regulator: core: print error value when constraints are not applied Date: Wed, 4 Jun 2014 14:53:25 -0500 Message-ID: <1401911605-5157-1-git-send-email-nm@ti.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP With commit 064d5cd110f94ce41ca5681dcda8b77fa63d5b95 (regulator: core: Fix the init of DT defined fixed regulators) We ensure that regulator must be capable of providing it's current voltage when constraints are used, however adding the return value in the print is a little more informative to explain the nature of the failure involved. So, instead of providing message such as: smps9: failed to get the current voltage having error value added to the message such as: smps9: failed to get the current voltage(-22) is a little more informative for debugging the error. Signed-off-by: Nishanth Menon --- drivers/regulator/core.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 4c1f999..b4902ab 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -846,7 +846,9 @@ static int machine_constraints_voltage(struct regulator_dev *rdev, rdev->constraints->min_uV == rdev->constraints->max_uV) { int current_uV = _regulator_get_voltage(rdev); if (current_uV < 0) { - rdev_err(rdev, "failed to get the current voltage\n"); + rdev_err(rdev, + "failed to get the current voltage(%d)\n", + current_uV); return current_uV; } if (current_uV < rdev->constraints->min_uV || @@ -856,8 +858,8 @@ static int machine_constraints_voltage(struct regulator_dev *rdev, rdev->constraints->max_uV); if (ret < 0) { rdev_err(rdev, - "failed to apply %duV constraint\n", - rdev->constraints->min_uV); + "failed to apply %duV constraint(%d)\n", + rdev->constraints->min_uV, ret); return ret; } }