media: i2c: mt9v111: Use %pe format specifier

The %pe format specifier is designed to print error pointers. It prints
a symbolic error name (eg. -EINVAL) and it makes the code simpler by
omitting PTR_ERR().

This patch fixes this cocci report:
./i2c/mt9v111.c:1143:3-10: WARNING: Consider using %pe to print PTR_ERR()
./i2c/mt9v111.c:1151:3-10: WARNING: Consider using %pe to print PTR_ERR()
./i2c/mt9v111.c:1159:3-10: WARNING: Consider using %pe to print PTR_ERR()

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
This commit is contained in:
Ricardo Ribalda
2025-10-13 14:14:55 +00:00
committed by Hans Verkuil
parent e027f53e05
commit b97ef7b65a

View File

@@ -1139,24 +1139,24 @@ static int mt9v111_probe(struct i2c_client *client)
mt9v111->oe = devm_gpiod_get_optional(&client->dev, "enable",
GPIOD_OUT_LOW);
if (IS_ERR(mt9v111->oe)) {
dev_err(&client->dev, "Unable to get GPIO \"enable\": %ld\n",
PTR_ERR(mt9v111->oe));
dev_err(&client->dev, "Unable to get GPIO \"enable\": %pe\n",
mt9v111->oe);
return PTR_ERR(mt9v111->oe);
}
mt9v111->standby = devm_gpiod_get_optional(&client->dev, "standby",
GPIOD_OUT_HIGH);
if (IS_ERR(mt9v111->standby)) {
dev_err(&client->dev, "Unable to get GPIO \"standby\": %ld\n",
PTR_ERR(mt9v111->standby));
dev_err(&client->dev, "Unable to get GPIO \"standby\": %pe\n",
mt9v111->standby);
return PTR_ERR(mt9v111->standby);
}
mt9v111->reset = devm_gpiod_get_optional(&client->dev, "reset",
GPIOD_OUT_LOW);
if (IS_ERR(mt9v111->reset)) {
dev_err(&client->dev, "Unable to get GPIO \"reset\": %ld\n",
PTR_ERR(mt9v111->reset));
dev_err(&client->dev, "Unable to get GPIO \"reset\": %pe\n",
mt9v111->reset);
return PTR_ERR(mt9v111->reset);
}