From: <light.hsieh@mediatek.com>
To: <linus.walleij@linaro.org>
Cc: <linux-mediatek@lists.infradead.org>,
<linux-gpio@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<sean.wang@kernel.org>, <kuohong.wang@mediatek.com>,
Light Hsieh <light.hsieh@mediatek.com>
Subject: [PATCH v1 1/1] pinctrl: mediatek: remove log message in mtk_hw_pin_field_lookup
Date: Fri, 21 Aug 2020 13:38:38 +0800 [thread overview]
Message-ID: <1597988318-24944-1-git-send-email-light.hsieh@mediatek.com> (raw)
From: Light Hsieh <light.hsieh@mediatek.com>
Originally, mtk_hw_pin_field_lookup() print log message in 2
conditions:
1. when soc does not support target property
2. when target pin does not support target property
Now, mtk_hw_pin_field_lookup() does not print log message according
to the following rationale:
1. Users of pinctrl have the duty to pass correct parameters and
check return vale. After checking return value, the users can
determine if log message shall be printed according to users'
scenario.
2. Prevent message flooding when a bad user continously pass bad
parameters to pinctrl.
Signed-off-by: Light Hsieh <light.hsieh@mediatek.com>
---
drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
index 2f3dfb5..161d4eb 100644
--- a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
+++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
@@ -74,13 +74,10 @@ static int mtk_hw_pin_field_lookup(struct mtk_pinctrl *hw,
bool found = false;
u32 bits;
- if (hw->soc->reg_cal && hw->soc->reg_cal[field].range) {
+ if (hw->soc->reg_cal && hw->soc->reg_cal[field].range)
rc = &hw->soc->reg_cal[field];
- } else {
- dev_dbg(hw->dev,
- "Not support field %d for this soc\n", field);
+ else
return -ENOTSUPP;
- }
end = rc->nranges - 1;
@@ -98,11 +95,8 @@ static int mtk_hw_pin_field_lookup(struct mtk_pinctrl *hw,
start = check + 1;
}
- if (!found) {
- dev_dbg(hw->dev, "Not support field %d for pin = %d (%s)\n",
- field, desc->number, desc->name);
+ if (!found)
return -ENOTSUPP;
- }
c = rc->range + check;
--
1.8.1.1.dirty
reply other threads:[~2020-08-21 5:38 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=1597988318-24944-1-git-send-email-light.hsieh@mediatek.com \
--to=light.hsieh@mediatek.com \
--cc=kuohong.wang@mediatek.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=sean.wang@kernel.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).