diff mbox series

[net-next,v2] net: ipa: make use of dev_err_cast_probe()

Message ID 20240829030739.1899011-1-liyuesong@vivo.com (mailing list archive)
State Rejected
Delegated to: Netdev Maintainers
Headers show
Series [net-next,v2] net: ipa: make use of dev_err_cast_probe() | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 16 this patch: 16
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 5 of 5 maintainers
netdev/build_clang success Errors and warnings before: 16 this patch: 16
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 16 this patch: 16
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 14 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Yuesong Li Aug. 29, 2024, 3:07 a.m. UTC
Using dev_err_cast_probe() to simplify the code.

Signed-off-by: Yuesong Li <liyuesong@vivo.com>
Signed-off-by: Hongbo Li <lihongbo22@huawei.com>
---
v2: https://lore.kernel.org/all/20240828160728.GR1368797@kernel.org/
  - fix patch name
  - drop the {} and fix the alignment
---
 drivers/net/ipa/ipa_power.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

Comments

Simon Horman Sept. 2, 2024, 8:56 a.m. UTC | #1
On Thu, Aug 29, 2024 at 11:07:39AM +0800, Yuesong Li wrote:
> Using dev_err_cast_probe() to simplify the code.
> 
> Signed-off-by: Yuesong Li <liyuesong@vivo.com>
> Signed-off-by: Hongbo Li <lihongbo22@huawei.com>
> ---
> v2: https://lore.kernel.org/all/20240828160728.GR1368797@kernel.org/
>   - fix patch name
>   - drop the {} and fix the alignment

Thanks for hte updates.

I note that this code is in a probe function,
so this patch is an appropriate use of dev_err_cast_probe() [1].

I also see that it addresses the feedback on code style from v1.

Reviewed-by: Simon Horman <horms@kernel.org>


[1] [PATCH] net: alacritech: Partially revert "net: alacritech: Switch to use dev_err_probe()"
    https://lore.kernel.org/netdev/20240830170014.15389-1-krzysztof.kozlowski@linaro.org/

...
Paolo Abeni Sept. 3, 2024, 8:41 a.m. UTC | #2
On 8/29/24 05:07, Yuesong Li wrote:
> Using dev_err_cast_probe() to simplify the code.
> 
> Signed-off-by: Yuesong Li <liyuesong@vivo.com>
> Signed-off-by: Hongbo Li <lihongbo22@huawei.com>
> ---
> v2: https://lore.kernel.org/all/20240828160728.GR1368797@kernel.org/
>    - fix patch name
>    - drop the {} and fix the alignment

Meanwhile Hongbo Li's version of this patch was applied by Jakub, this 
is not needed anymore.

Paolo
diff mbox series

Patch

diff --git a/drivers/net/ipa/ipa_power.c b/drivers/net/ipa/ipa_power.c
index 65fd14da0f86..3c239c3545e5 100644
--- a/drivers/net/ipa/ipa_power.c
+++ b/drivers/net/ipa/ipa_power.c
@@ -242,11 +242,9 @@  ipa_power_init(struct device *dev, const struct ipa_power_data *data)
 	int ret;
 
 	clk = clk_get(dev, "core");
-	if (IS_ERR(clk)) {
-		dev_err_probe(dev, PTR_ERR(clk), "error getting core clock\n");
-
-		return ERR_CAST(clk);
-	}
+	if (IS_ERR(clk))
+		return dev_err_cast_probe(dev, clk,
+					  "error getting core clock\n");
 
 	ret = clk_set_rate(clk, data->core_clock_rate);
 	if (ret) {