On Mon, Sep 09, 2024 at 03:19:07PM +0800, Binbin Zhou wrote: > ret = device_property_read_string(dev, "model", &card->name); > - if (ret) { > - dev_err(dev, "Error parsing card name: %d\n", ret); > - return ret; > - } > + if (ret) > + dev_err_probe(dev, ret, "Error parsing card name\n"); > + This means that we change from failing if there is an error to only logging about it (and then only during probe). Perhaps that makes sense but the changelog should explain what's going on. Most if not all of the updates do this, some of them seem like clear bugs. > - 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"); Please just write normal conditional statements, they're far clearer - there's applications for the ternery operator when embedded in other things but normally it just makes things harder to read.
Attachment:
signature.asc
Description: PGP signature
- References:
- [PATCH v1 0/8] ASoC: loongson: Simplify code formatting
- From: Binbin Zhou
- [PATCH v1 3/8] ASoC: loongson: Simplify with dev_err_probe()
- From: Binbin Zhou
- [PATCH v1 0/8] ASoC: loongson: Simplify code formatting
- Prev by Date: [PATCH] ASoC: Switch back to struct platform_driver::remove()
- Next by Date: Re: [PATCH v1 6/8] ASoC: loongson: Replace if with ternary operator
- Previous by thread: Re: [PATCH v1 3/8] ASoC: loongson: Simplify with dev_err_probe()
- Next by thread: [PATCH v1 6/8] ASoC: loongson: Replace if with ternary operator
- Index(es):