Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1225514 > unrolled thread

[PATCH] regualtor: core: Make error messages more informative

Started byStephen Boyd <sboyd@codeaurora.org>
First post2015-09-15 21:10 +0200
Last post2015-09-16 12:20 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] regualtor: core: Make error messages more informative Stephen Boyd <sboyd@codeaurora.org> - 2015-09-15 21:10 +0200
    Re: [PATCH] regualtor: core: Make error messages more informative Mark Brown <broonie@kernel.org> - 2015-09-16 12:20 +0200

#1225514 — [PATCH] regualtor: core: Make error messages more informative

FromStephen Boyd <sboyd@codeaurora.org>
Date2015-09-15 21:10 +0200
Subject[PATCH] regualtor: core: Make error messages more informative
Message-ID<q93M6-5yj-23@gated-at.bofh.it>
The same error print exists 4 times in the regulator core

	<rdev>: operation not allowed

Unfortunately, seeing this in the dmesg is not very informative.
Add what type of operation is not allowed to the message so that
these errors are unique, hopefully pointing developers in the
right direction

	<rdev>: operation (drms) not allowed
	<rdev>: operation (voltage) not allowed
	<rdev>: operation (current) not allowed
	<rdev>: operation (mode) not allowed

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
---
 drivers/regulator/core.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 9283d9f7919b..580c34bca65d 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -180,7 +180,7 @@ static int regulator_check_voltage(struct regulator_dev *rdev,
 		return -ENODEV;
 	}
 	if (!(rdev->constraints->valid_ops_mask & REGULATOR_CHANGE_VOLTAGE)) {
-		rdev_err(rdev, "operation not allowed\n");
+		rdev_err(rdev, "operation (voltage) not allowed\n");
 		return -EPERM;
 	}
 
@@ -240,7 +240,7 @@ static int regulator_check_current_limit(struct regulator_dev *rdev,
 		return -ENODEV;
 	}
 	if (!(rdev->constraints->valid_ops_mask & REGULATOR_CHANGE_CURRENT)) {
-		rdev_err(rdev, "operation not allowed\n");
+		rdev_err(rdev, "operation (current) not allowed\n");
 		return -EPERM;
 	}
 
@@ -277,7 +277,7 @@ static int regulator_mode_constrain(struct regulator_dev *rdev, int *mode)
 		return -ENODEV;
 	}
 	if (!(rdev->constraints->valid_ops_mask & REGULATOR_CHANGE_MODE)) {
-		rdev_err(rdev, "operation not allowed\n");
+		rdev_err(rdev, "operation (mode) not allowed\n");
 		return -EPERM;
 	}
 
@@ -301,7 +301,7 @@ static int regulator_check_drms(struct regulator_dev *rdev)
 		return -ENODEV;
 	}
 	if (!(rdev->constraints->valid_ops_mask & REGULATOR_CHANGE_DRMS)) {
-		rdev_dbg(rdev, "operation not allowed\n");
+		rdev_dbg(rdev, "operation (drms) not allowed\n");
 		return -EPERM;
 	}
 	return 0;
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1225957

FromMark Brown <broonie@kernel.org>
Date2015-09-16 12:20 +0200
Message-ID<q9hYM-1tT-73@gated-at.bofh.it>
In reply to#1225514

[Multipart message — attachments visible in raw view] — view raw

On Tue, Sep 15, 2015 at 12:09:16PM -0700, Stephen Boyd wrote:

> Unfortunately, seeing this in the dmesg is not very informative.
> Add what type of operation is not allowed to the message so that
> these errors are unique, hopefully pointing developers in the
> right direction

> 	<rdev>: operation (drms) not allowed
> 	<rdev>: operation (voltage) not allowed
> 	<rdev>: operation (current) not allowed
> 	<rdev>: operation (mode) not allowed

Structure (normal) for text readable (human) message please.  :)

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web