From: Alex Elder <elder@linaro.org>
To: davem@davemloft.net, kuba@kernel.org
Cc: evgreen@chromium.org, bjorn.andersson@linaro.org,
cpratapa@codeaurora.org, subashab@codeaurora.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH net-next 2/7] net: ipa: don't return an error from ipa_interconnect_disable()
Date: Fri, 15 Jan 2021 06:50:45 -0600 [thread overview]
Message-ID: <20210115125050.20555-3-elder@linaro.org> (raw)
In-Reply-To: <20210115125050.20555-1-elder@linaro.org>
If disabling interconnects fails there's not a lot we can do. The
only two callers of ipa_interconnect_disable() ignore the return
value, so just give the function a void return type.
Print an error message if disabling any of the interconnects is not
successful. Return (and print) only the first error seen.
Signed-off-by: Alex Elder <elder@linaro.org>
---
drivers/net/ipa/ipa_clock.c | 31 +++++++++++--------------------
1 file changed, 11 insertions(+), 20 deletions(-)
diff --git a/drivers/net/ipa/ipa_clock.c b/drivers/net/ipa/ipa_clock.c
index 459c357e09678..baedb481fe824 100644
--- a/drivers/net/ipa/ipa_clock.c
+++ b/drivers/net/ipa/ipa_clock.c
@@ -137,36 +137,27 @@ static int ipa_interconnect_enable(struct ipa *ipa)
}
/* To disable an interconnect, we just its bandwidth to 0 */
-static int ipa_interconnect_disable(struct ipa *ipa)
+static void ipa_interconnect_disable(struct ipa *ipa)
{
- const struct ipa_interconnect_data *data;
struct ipa_clock *clock = ipa->clock;
+ int result = 0;
int ret;
ret = icc_set_bw(clock->memory_path, 0, 0);
if (ret)
- return ret;
+ result = ret;
ret = icc_set_bw(clock->imem_path, 0, 0);
- if (ret)
- goto err_memory_path_reenable;
+ if (ret && !result)
+ result = ret;
ret = icc_set_bw(clock->config_path, 0, 0);
- if (ret)
- goto err_imem_path_reenable;
+ if (ret && !result)
+ result = ret;
- return 0;
-
-err_imem_path_reenable:
- data = &clock->interconnect_data[IPA_INTERCONNECT_IMEM];
- (void)icc_set_bw(clock->imem_path, data->average_bandwidth,
- data->peak_bandwidth);
-err_memory_path_reenable:
- data = &clock->interconnect_data[IPA_INTERCONNECT_MEMORY];
- (void)icc_set_bw(clock->memory_path, data->average_bandwidth,
- data->peak_bandwidth);
-
- return ret;
+ if (result)
+ dev_err(&ipa->pdev->dev,
+ "error %d disabling IPA interconnects\n", ret);
}
/* Turn on IPA clocks, including interconnects */
@@ -189,7 +180,7 @@ static int ipa_clock_enable(struct ipa *ipa)
static void ipa_clock_disable(struct ipa *ipa)
{
clk_disable_unprepare(ipa->clock->core);
- (void)ipa_interconnect_disable(ipa);
+ ipa_interconnect_disable(ipa);
}
/* Get an IPA clock reference, but only if the reference count is
--
2.20.1
next prev parent reply other threads:[~2021-01-15 12:51 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-15 12:50 [PATCH net-next 0/7] net: ipa: interconnect improvements Alex Elder
2021-01-15 12:50 ` [PATCH net-next 1/7] net: ipa: rename interconnect settings Alex Elder
2021-01-15 12:50 ` Alex Elder [this message]
2021-01-15 12:50 ` [PATCH net-next 3/7] net: ipa: introduce an IPA interconnect structure Alex Elder
2021-01-15 12:50 ` [PATCH net-next 4/7] net: ipa: store average and peak interconnect bandwidth Alex Elder
2021-01-15 12:50 ` [PATCH net-next 5/7] net: ipa: add interconnect name to configuration data Alex Elder
2021-01-15 12:50 ` [PATCH net-next 6/7] net: ipa: clean up interconnect initialization Alex Elder
2021-01-15 12:50 ` [PATCH net-next 7/7] net: ipa: allow arbitrary number of interconnects Alex Elder
2021-01-17 3:12 ` Jakub Kicinski
2021-01-17 16:03 ` Alex Elder
2021-01-18 19:58 ` Jakub Kicinski
2021-01-18 20:27 ` Alex Elder
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=20210115125050.20555-3-elder@linaro.org \
--to=elder@linaro.org \
--cc=bjorn.andersson@linaro.org \
--cc=cpratapa@codeaurora.org \
--cc=davem@davemloft.net \
--cc=evgreen@chromium.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=subashab@codeaurora.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).