[PATCH 4.4.y-cip 22/23] PM / OPP: Remove useless check

Chen-Yu Tsai (Moxa) <wens@...>

From: Viresh Kumar <viresh.kumar@...>

commit 21f8a99ce61b2d4b74bd425a5bf7e9efbe162788 upstream.

Regulators are optional for devices using OPPs and the OPP core
shouldn't be printing any errors for such missing regulators.

It was fine before the commit 0c717d0f9cb4, but that failed to update
this part of the code to remove an 'always true' check and an extra
unwanted print message.

Fix that now.

Fixes: 0c717d0f9cb4 (PM / OPP: Initialize regulator pointer to an error v=
Reported-by: Marc Gonzalez <marc_gonzalez@...>
Signed-off-by: Viresh Kumar <viresh.kumar@...>
Reviewed-by: Stephen Boyd <sboyd@...>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@...>
Signed-off-by: Chen-Yu Tsai (Moxa) <wens@...>
drivers/base/power/opp/core.c | 3 ---
1 file changed, 3 deletions(-)

diff --git a/drivers/base/power/opp/core.c b/drivers/base/power/opp/core.=
index 7fc3848df17f5..c91eacf8d2ed3 100644
--- a/drivers/base/power/opp/core.c
+++ b/drivers/base/power/opp/core.c
@@ -259,9 +259,6 @@ unsigned long dev_pm_opp_get_max_volt_latency(struct =
device *dev)
reg =3D opp_table->regulator;
if (IS_ERR(reg)) {
/* Regulator may not be required for device */
- if (reg)
- dev_err(dev, "%s: Invalid regulator (%ld)\n", __func__,
- PTR_ERR(reg));
return 0;

Join cip-dev@lists.cip-project.org to automatically receive all group messages.