aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiklas Söderlund <[email protected]>2021-12-08 13:17:56 +0100
committerMauro Carvalho Chehab <[email protected]>2021-12-14 16:19:04 +0100
commitdf78b858e773967112b4444400fb7bb5bd7a9d8a (patch)
treea85bf1255f8ec9426d483a49f8fa0309e7874c39
parent232c297a4e86fba1e2497012b1fcde6018d46f50 (diff)
media: i2c: max9286: Use dev_err_probe() helper
Use the dev_err_probe() helper, instead of open-coding the same operation. While at it retrieve the error once and use it from 'ret' instead of retrieving it twice. Link: https://lore.kernel.org/linux-media/[email protected] Suggested-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Niklas S\xF6derlund <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Reviewed-by: Kieran Bingham <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
-rw-r--r--drivers/media/i2c/max9286.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/media/i2c/max9286.c b/drivers/media/i2c/max9286.c
index a662d3aa0641..eb2b8e42335b 100644
--- a/drivers/media/i2c/max9286.c
+++ b/drivers/media/i2c/max9286.c
@@ -1294,11 +1294,9 @@ static int max9286_probe(struct i2c_client *client)
priv->regulator = devm_regulator_get(&client->dev, "poc");
if (IS_ERR(priv->regulator)) {
- if (PTR_ERR(priv->regulator) != -EPROBE_DEFER)
- dev_err(&client->dev,
- "Unable to get PoC regulator (%ld)\n",
- PTR_ERR(priv->regulator));
ret = PTR_ERR(priv->regulator);
+ dev_err_probe(&client->dev, ret,
+ "Unable to get PoC regulator\n");
goto err_powerdown;
}