[PATCH v3 11/13] ASoC: arizona-jack: Cleanup logging
Andy Shevchenko
andy.shevchenko at gmail.com
Fri Jan 22 21:56:18 CET 2021
On Fri, Jan 22, 2021 at 6:41 PM Hans de Goede <hdegoede at redhat.com> wrote:
>
> Cleanup the use of dev_foo functions used for logging:
>
> 1. Many of these are unnecessarily split over multiple lines
> 2. Use dev_err_probe() in cases where we might get a -EPROBE_DEFERRED
s/RED$//
> return value
...
> + if (ret != 0)
Since you are touching it if (ret) would work already. Ditto for the
similar cases below.
...
> if (IS_ERR(info->micvdd)) {
> ret = PTR_ERR(info->micvdd);
> - dev_err(arizona->dev, "Failed to get MICVDD: %d\n", ret);
> + dev_err_probe(arizona->dev, ret, "getting MICVDD\n");
> return ret;
> }
Seems like your first dev_err_probe use :-)
Can be even more optimized, i.e.
if (IS_ERR(info->micvdd))
return dev_err_probe(arizona->dev, PTR_ERR(info->micvdd), "getting
MICVDD\n");
...
> if (IS_ERR(info->micd_pol_gpio)) {
> ret = PTR_ERR(info->micd_pol_gpio);
> - dev_err(arizona->dev,
> - "Failed to get microphone polarity GPIO: %d\n",
> - ret);
> + dev_err_probe(arizona->dev, ret, "getting microphone polarity GPIO\n");
> return ret;
> }
Ditto.
--
With Best Regards,
Andy Shevchenko
More information about the Alsa-devel
mailing list