Skip to content

Commit b042baa

Browse files
Yan Zhenlinusw
authored andcommitted
pinctrl: madera: Simplify with dev_err_probe()
Switch to use dev_err_probe() to simplify the error path and unify a message template. Using this helper is totally fine even if err is known to never be -EPROBE_DEFER. The benefit compared to a normal dev_err() is the standardized format of the error code, it being emitted symbolically and the fact that the error code is returned which allows more compact error paths. Signed-off-by: Yan Zhen <[email protected]> Reviewed-by: Charles Keepax <[email protected]> Link: https://lore.kernel.org/[email protected] Signed-off-by: Linus Walleij <[email protected]>
1 parent 91bb8d0 commit b042baa

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

drivers/pinctrl/cirrus/pinctrl-madera-core.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,12 +1063,9 @@ static int madera_pin_probe(struct platform_device *pdev)
10631063
if (pdata->gpio_configs) {
10641064
ret = pinctrl_register_mappings(pdata->gpio_configs,
10651065
pdata->n_gpio_configs);
1066-
if (ret) {
1067-
dev_err(priv->dev,
1068-
"Failed to register pdata mappings (%d)\n",
1069-
ret);
1070-
return ret;
1071-
}
1066+
if (ret)
1067+
return dev_err_probe(priv->dev, ret,
1068+
"Failed to register pdata mappings\n");
10721069
}
10731070

10741071
ret = pinctrl_enable(priv->pctl);

0 commit comments

Comments
 (0)