Re: [PATCH v3 08/14] ASoC: SOF: Add DSP HW abstraction operations

Mark Brown
2019-01-09T20:51:29Z

[-- Attachment #1.1: Type: text/plain, Size: 778 bytes --]

On Tue, Dec 11, 2018 at 03:23:12PM -0600, Pierre-Louis Bossart wrote:

> +int snd_sof_pci_update_bits_unlocked(struct snd_sof_dev *sdev, u32 offset,
> + u32 mask, u32 value)
> +{
> + bool change;
> + unsigned int old, new;
> + u32 ret = ~0; /* explicit init to remove uninitialized use warnings */

This looks a lot like you want to write regmap_pci_config...

> +/* control */
> +static inline int snd_sof_dsp_run(struct snd_sof_dev *sdev)
> +{
> + if (sdev->ops->run)
> + return sdev->ops->run(sdev);
> +
> + return 0;
> +}

Do we really want to return 0 for all these ops if they're not
implemented? For some that seems sensible but there's others where it
seems like the caller might want to know they got ignored and an error
code like -ENOTSUPP might be better.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]