[<prev] [next>] [day] [month] [year] [list]
Message-ID: <1597988318-24944-1-git-send-email-light.hsieh@mediatek.com>
Date: Fri, 21 Aug 2020 13:38:38 +0800
From: <light.hsieh@...iatek.com>
To: <linus.walleij@...aro.org>
CC: <linux-mediatek@...ts.infradead.org>, <linux-gpio@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <sean.wang@...nel.org>,
<kuohong.wang@...iatek.com>, Light Hsieh <light.hsieh@...iatek.com>
Subject: [PATCH v1 1/1] pinctrl: mediatek: remove log message in mtk_hw_pin_field_lookup
From: Light Hsieh <light.hsieh@...iatek.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@...iatek.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
Powered by blists - more mailing lists