[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220607164941.833728558@linuxfoundation.org>
Date: Tue, 7 Jun 2022 18:58:20 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org,
Geert Uytterhoeven <geert+renesas@...der.be>,
"Niklas S \ xF6derlund" <niklas.soderlund+renesas@...natech.se>,
Kieran Bingham <kieran.bingham+renesas@...asonboard.com>,
Laurent Pinchart <laurent.pinchart@...asonboard.com>,
Mauro Carvalho Chehab <mchehab+huawei@...nel.org>,
Sasha Levin <sashal@...nel.org>
Subject: [PATCH 5.15 235/667] media: i2c: max9286: Use dev_err_probe() helper
From: Niklas Söderlund <niklas.soderlund+renesas@...natech.se>
[ Upstream commit df78b858e773967112b4444400fb7bb5bd7a9d8a ]
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/20211208121756.3051565-1-niklas.soderlund+renesas@ragnatech.se
Suggested-by: Geert Uytterhoeven <geert+renesas@...der.be>
Signed-off-by: Niklas S\xF6derlund <niklas.soderlund+renesas@...natech.se>
Reviewed-by: Geert Uytterhoeven <geert+renesas@...der.be>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@...asonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@...asonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
drivers/media/i2c/max9286.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/media/i2c/max9286.c b/drivers/media/i2c/max9286.c
index 1aa2c58fd38c..1bbcc46fffd5 100644
--- a/drivers/media/i2c/max9286.c
+++ b/drivers/media/i2c/max9286.c
@@ -1296,11 +1296,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;
}
--
2.35.1
Powered by blists - more mailing lists