On 09/09/2024 09:19, Binbin Zhou wrote:
> Error handling in probe() can be a bit simpler with dev_err_probe().
>
> Signed-off-by: Binbin Zhou <zhoubinbin@xxxxxxxxxxx>
...
>
> - if (has_acpi_companion(dev))
> - ret = loongson_card_parse_acpi(ls_priv);
> - else
> - ret = loongson_card_parse_of(ls_priv);
> - if (ret < 0)
> - return ret;
> + ret = has_acpi_companion(dev) ? loongson_card_parse_acpi(ls_priv)
> + : loongson_card_parse_of(ls_priv);
> + if (ret)
> + dev_err_probe(dev, ret, "Error parsing acpi/of properties\n");
This does not make anything simpler - you don't use dev_err_probe()
features here. OTOH, you duplicate error messages.
Best regards,
Krzysztof
[Index of Archives]
[Pulseaudio]
[Linux Audio Users]
[ALSA Devel]
[Fedora Desktop]
[Fedora SELinux]
[Big List of Linux Books]
[Yosemite News]
[KDE Users]