linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: hdegoede@redhat.com (Hans de Goede)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2] regulator_get_optional: don't print an error when no regulator is found
Date: Thu, 12 Dec 2013 14:31:16 +0100	[thread overview]
Message-ID: <1386855076-5242-1-git-send-email-hdegoede@redhat.com> (raw)

Since regulator_get_optional is the only one calling _regulator_get() with
both allow_dummy and exclusive set to false this patch adds the following
test for calling dev_err:

    if (!(!allow_dummy && !exclusive))

Simplified to the much easier on the eyes:

    if (allow_dummy || exclusive)

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/regulator/core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 3fe1313..a1d4ddc 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1346,7 +1346,8 @@ static struct regulator *_regulator_get(struct device *dev, const char *id,
 
 		rdev = dummy_regulator_rdev;
 		goto found;
-	} else {
+	/* Don't log an error when called from regulator_get_optional() */
+	} else if (allow_dummy || exclusive) {
 		dev_err(dev, "dummy supplies not allowed\n");
 	}
 
-- 
1.8.4.2

                 reply	other threads:[~2013-12-12 13:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1386855076-5242-1-git-send-email-hdegoede@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).