Skip to contentSkip to conversation

extcon: Move extcon_get_edev_by_phandle() errors to dbg level

PATCH In review Stephen Boyd 2 participants 2 messages Jul 5, 2016 – Jul 6, 2016 External connector subsystem (extcon)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 extcon: Move extcon_get_edev_by_phandle() errors to dbg level

Sometimes drivers may call this API and expect it to fail because the extcon they're looking for is optional. Let's move these prints to debug level so it doesn't look like there's a problem when there isn't one.

---
 drivers/extcon/extcon.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/extcon/extcon.c +2 -2
index 161acb826334..984f50d5297c 100644
@@ -1096,13 +1096,13 @@ struct extcon_dev *extcon_get_edev_by_phandle(struct device *dev, int index)
 		return ERR_PTR(-EINVAL);
 
 	if (!dev->of_node) {
-		dev_err(dev, "device does not have a device node entry\n");
+		dev_dbg(dev, "device does not have a device node entry\n");
 		return ERR_PTR(-EINVAL);
 	}
 
 	node = of_parse_phandle(dev->of_node, "extcon", index);
 	if (!node) {
-		dev_err(dev, "failed to get phandle in %s node\n",
+		dev_dbg(dev, "failed to get phandle in %s node\n",
 			dev->of_node->full_name);
 		return ERR_PTR(-ENODEV);
 	}
Signature · 1 line
2.9.0.rc2.8.ga28705d
maintainer
#1 lore raw

Hi Stephen,

Quoted 21 lines · Stephen Boyd

Sometimes drivers may call this API and expect it to fail because the extcon they're looking for is optional. Let's move these prints to debug level so it doesn't look like there's a problem when there isn't one.

---
 drivers/extcon/extcon.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/extcon/extcon.c +1 -1
index 161acb826334..984f50d5297c 100644
@@ -1096,13 +1096,13 @@ struct extcon_dev *extcon_get_edev_by_phandle(struct device *dev, int index)
 		return ERR_PTR(-EINVAL);
 
 	if (!dev->of_node) {
-		dev_err(dev, "device does not have a device node entry\n");
+		dev_dbg(dev, "device does not have a device node entry\n");

drivers/extcon/extcon.c struct extcon_dev *extcon_get_edev_by_phandle(struct device *dev, int index) · line 1108

Quoted 10 lines
drivers/extcon/extcon.c +1 -1
 		return ERR_PTR(-EINVAL);
 	}
 
 	node = of_parse_phandle(dev->of_node, "extcon", index);
 	if (!node) {
-		dev_err(dev, "failed to get phandle in %s node\n",
+		dev_dbg(dev, "failed to get phandle in %s node\n",
 			dev->of_node->full_name);
 		return ERR_PTR(-ENODEV);
 	}

Applied it.

Thanks,
Chanwoo Choi