Skip to contentSkip to conversation

pinctrl: mediatek: remove log message in mtk_hw_pin_field_lookup

PATCH New [email protected] 1 participant 1 message Aug 21, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pinctrl: mediatek: remove log message in mtk_hw_pin_field_lookup

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.

---
 drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)
drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c +3 -9
index 2f3dfb5..161d4eb 100644
@@ -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;
 
Signature · 1 line
1.8.1.1.dirty