Skip to contentSkip to conversation

iio: gyro: bmg160: use __func__ in error message

PATCH In review Hungyu Lin 2 participants 2 messages Jun 7 – Jun 8 IIO

lore
Share & tools
lore

Hungyu Lin

author
#0 lore raw

PATCH 1/1 iio: gyro: bmg160: use __func__ in error message

Use __func__ instead of hardcoding the function name in the error message.

---
 drivers/iio/gyro/bmg160_core.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/iio/gyro/bmg160_core.c +1 -2
index 38394b5f3275..8cebac89ed81 100644
@@ -313,8 +313,7 @@ static int bmg160_set_power_state(struct bmg160_data *data, bool on)
 		ret = pm_runtime_put_autosuspend(dev);
 
 	if (ret < 0) {
-		dev_err(dev, "Failed: bmg160_set_power_state for %d\n", on);
-
+		dev_err(dev, "Failed: %s for %d\n", __func__, on);
 		if (on)
 			pm_runtime_put_noidle(dev);
 
Signature · 1 line
2.34.1
#1 lore raw
Quoted 2 lines · Hungyu Lin

Use __func__ instead of hardcoding the function name in the error message.

No, __func__ in non-debug messages means that the message itself is badly written and/or not unique enough. Rather than use __func__ try to rephrase message that it will be unique to this type of devices.

Signature · 2 lines
With Best Regards,
Andy Shevchenko