media: i2c: mt9m111: 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/mt9m111.c:1290: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:54 +00:00 committed by Hans Verkuil
parent e8fd8080e7
commit e027f53e05

View File

@ -1286,8 +1286,8 @@ static int mt9m111_probe(struct i2c_client *client)
mt9m111->regulator = devm_regulator_get(&client->dev, "vdd");
if (IS_ERR(mt9m111->regulator)) {
dev_err(&client->dev, "regulator not found: %ld\n",
PTR_ERR(mt9m111->regulator));
dev_err(&client->dev, "regulator not found: %pe\n",
mt9m111->regulator);
return PTR_ERR(mt9m111->regulator);
}