public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] regulator: max77802: precedence error in max77802_set_suspend_mode()
@ 2014-10-24  8:16 Dan Carpenter
  2014-10-24  9:04 ` Javier Martinez Canillas
  0 siblings, 1 reply; 5+ messages in thread
From: Dan Carpenter @ 2014-10-24  8:16 UTC (permalink / raw)
  To: Liam Girdwood, Javier Martinez Canillas
  Cc: Mark Brown, linux-kernel, kernel-janitors

The "!" operation has higher precedence that the comparison.

Fixes: 2e0eaa1aa008 ('regulator: max77802: Add set suspend mode for BUCKs and simplify code')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/regulator/max77802.c b/drivers/regulator/max77802.c
index 5839c45..57e37fd 100644
--- a/drivers/regulator/max77802.c
+++ b/drivers/regulator/max77802.c
@@ -179,7 +179,7 @@ static int max77802_set_suspend_mode(struct regulator_dev *rdev,
 	 * If the regulator has been disabled for suspend
 	 * then is invalid to try setting a suspend mode.
 	 */
-	if (!max77802->opmode[id] == MAX77802_OFF_PWRREQ) {
+	if (max77802->opmode[id] != MAX77802_OFF_PWRREQ) {
 		dev_warn(&rdev->dev, "%s: is disabled, mode: 0x%x not set\n",
 			 rdev->desc->name, mode);
 		return 0;

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-10-27 18:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-24  8:16 [patch] regulator: max77802: precedence error in max77802_set_suspend_mode() Dan Carpenter
2014-10-24  9:04 ` Javier Martinez Canillas
2014-10-27 10:45   ` [patch v2] regulator: max77802: fix a test " Dan Carpenter
2014-10-27 13:21     ` Javier Martinez Canillas
2014-10-27 18:18     ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox