Skip to content

Commit

Permalink
net: ipa: make use of dev_err_cast_probe()
Browse files Browse the repository at this point in the history
Using dev_err_cast_probe() to simplify the code.

Signed-off-by: Hongbo Li <lihongbo22@huawei.com>
Link: https://patch.msgid.link/20240828121551.3696520-1-lihongbo22@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Hongbo Li authored and Jakub Kicinski committed Aug 29, 2024
1 parent daca6af commit a41de3b
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions drivers/net/ipa/ipa_power.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,11 +242,8 @@ 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) {
Expand Down

0 comments on commit a41de3b

Please sign in to comment.