From: "Maíra Canal" <maira.canal@usp.br>
To: linux-pm@vger.kernel.org
Cc: gregkh@linuxfoundation.org, rafael@kernel.org,
khilman@kernel.org, ulf.hansson@linaro.org, pavel@ucw.cz
Subject: [PATCH] PM: domains: using dev_err_probe() to simplify error handling
Date: Tue, 12 Oct 2021 10:08:19 -0300 [thread overview]
Message-ID: <YWWIw1hAQAYjjrfK@fedora> (raw)
Replacing dev_err() for dev_err_probe() in order to reduce code size and
uniform error handling.
Signed-off-by: Maíra Canal <maira.canal@usp.br>
---
drivers/base/power/domain.c | 17 ++++++-----------
1 file changed, 6 insertions(+), 11 deletions(-)
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index 5db704f02e71..e7701b79494a 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -2249,10 +2249,8 @@ int of_genpd_add_provider_simple(struct device_node *np,
if (genpd->set_performance_state) {
ret = dev_pm_opp_of_add_table(&genpd->dev);
if (ret) {
- if (ret != -EPROBE_DEFER)
- dev_err(&genpd->dev, "Failed to add OPP table: %d\n",
+ return dev_err_probe(&genpd->dev, ret, "Failed to add OPP table: %d\n",
ret);
- return ret;
}
/*
@@ -2312,9 +2310,8 @@ int of_genpd_add_provider_onecell(struct device_node *np,
if (genpd->set_performance_state) {
ret = dev_pm_opp_of_add_table_indexed(&genpd->dev, i);
if (ret) {
- if (ret != -EPROBE_DEFER)
- dev_err(&genpd->dev, "Failed to add OPP table for index %d: %d\n",
- i, ret);
+ dev_err_probe(&genpd->dev, ret, "Failed to add OPP table for index %d: %d\n",
+ i, ret);
goto error;
}
@@ -2673,10 +2670,8 @@ static int __genpd_dev_pm_attach(struct device *dev, struct device *base_dev,
mutex_unlock(&gpd_list_lock);
if (ret < 0) {
- if (ret != -EPROBE_DEFER)
- dev_err(dev, "failed to add to PM domain %s: %d",
+ return dev_err_probe(dev, ret, "failed to add to PM domain %s: %d",
pd->name, ret);
- return ret;
}
dev->pm_domain->detach = genpd_dev_pm_detach;
@@ -2707,8 +2702,8 @@ static int __genpd_dev_pm_attach(struct device *dev, struct device *base_dev,
return 1;
err:
- dev_err(dev, "failed to set required performance state for power-domain %s: %d\n",
- pd->name, ret);
+ dev_err(dev, "failed to set required performance state for power-domain %s: %d\n",
+ pd->name, ret);
genpd_remove_device(pd, dev);
return ret;
}
--
2.31.1
next reply other threads:[~2021-10-12 13:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-12 13:08 Maíra Canal [this message]
2021-10-12 13:27 ` [PATCH] PM: domains: using dev_err_probe() to simplify error handling Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YWWIw1hAQAYjjrfK@fedora \
--to=maira.canal@usp.br \
--cc=gregkh@linuxfoundation.org \
--cc=khilman@kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=pavel@ucw.cz \
--cc=rafael@kernel.org \
--cc=ulf.hansson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.