From: Light Hsieh <[email protected]>
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 <[email protected]>
---
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