iio: gyro: bmg160: use __func__ in error message
PATCH 1/1 iio: gyro: bmg160: use __func__ in error message
Use __func__ instead of hardcoding the function name in the error message.
Signed-off-by Hungyu Lin <[email protected]>
--- drivers/iio/gyro/bmg160_core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/iio/gyro/bmg160_core.c +1 -2
@@ -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
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