iio: imu: inv_mpu6050_spi: Use vsprintf extension %pe for symbolic error name
authorNishant Malpani <nish.malpani25@gmail.com>
Sun, 22 Mar 2020 17:23:12 +0000 (22:53 +0530)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 19 Apr 2020 15:56:18 +0000 (16:56 +0100)
Utilize %pe format specifier from vsprintf while printing error logs
with dev_err(). Discards the use of unnecessary explicit casting and
prints symbolic error name which might prove to be convenient during
debugging.

Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c

index 673b198e6368fa6e5e0b59ae4d76e0c1b233367f..6f968ce687e111a38e7c40443faf6ea99e7f28d5 100644 (file)
@@ -53,8 +53,8 @@ static int inv_mpu_probe(struct spi_device *spi)
 
        regmap = devm_regmap_init_spi(spi, &inv_mpu_regmap_config);
        if (IS_ERR(regmap)) {
-               dev_err(&spi->dev, "Failed to register spi regmap %d\n",
-                       (int)PTR_ERR(regmap));
+               dev_err(&spi->dev, "Failed to register spi regmap: %pe\n",
+                       regmap);
                return PTR_ERR(regmap);
        }