mbox series

[0/5] ASoC: mt8188-mt6359: Cleanups

Message ID 20230608084727.74403-1-angelogioacchino.delregno@collabora.com
Headers show
Series ASoC: mt8188-mt6359: Cleanups | expand

Message

AngeloGioacchino Del Regno June 8, 2023, 8:47 a.m. UTC
This series performs some cleanups to the mt8188-mt6359 driver,
including usage of bitfield macros, adding definitions of register
fields and some others for readability and consistency.

AngeloGioacchino Del Regno (4):
  ASoC: mediatek: mt8188-mt6359: Compress of_device_id entries
  ASoC: mediatek: mt8188-mt6359: Cleanup return 0 disguised as return
    ret
  ASoC: mediatek: mt8188-mt6359: Clean up log levels
  ASoC: mediatek: mt8188-mt6359: Use bitfield macros for registers

Dan Carpenter (1):
  ASoC: mediatek: mt8188-mt6359: clean up a return in codec_init

 sound/soc/mediatek/mt8188/mt8188-mt6359.c | 87 ++++++++++++-----------
 1 file changed, 45 insertions(+), 42 deletions(-)

Comments

Alexandre Mergnat June 8, 2023, 9:31 a.m. UTC | #1
On 08/06/2023 10:47, AngeloGioacchino Del Regno wrote:
> Those entries fit in one line: compress them to reduce line count.
> While at it, also add the sentinel comment to the last entry.

Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
Alexandre Mergnat June 8, 2023, 9:32 a.m. UTC | #2
On 08/06/2023 10:47, AngeloGioacchino Del Regno wrote:
> This code triggers a Smatch static checker warning and does sort of
> look like an error path.
> 
> sound/soc/mediatek/mt8188/mt8188-mt6359.c:597 mt8188_max98390_codec_init() warn: missing error code? 'ret'
> 
> However, returning 0 is intentional.  Make that explicit.

Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
Alexandre Mergnat June 8, 2023, 9:33 a.m. UTC | #3
On 08/06/2023 10:47, AngeloGioacchino Del Regno wrote:
> Change all instances of `return ret` to `return 0` at the end of
> functions where ret is always zero and also change functions
> mt8188_{hdmi,dptx}_codec_init to be consistent with how other
> functions are returning errors

Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
Mark Brown June 8, 2023, 3:18 p.m. UTC | #4
On Thu, 08 Jun 2023 10:47:22 +0200, AngeloGioacchino Del Regno wrote:
> This series performs some cleanups to the mt8188-mt6359 driver,
> including usage of bitfield macros, adding definitions of register
> fields and some others for readability and consistency.
> 
> AngeloGioacchino Del Regno (4):
>   ASoC: mediatek: mt8188-mt6359: Compress of_device_id entries
>   ASoC: mediatek: mt8188-mt6359: Cleanup return 0 disguised as return
>     ret
>   ASoC: mediatek: mt8188-mt6359: Clean up log levels
>   ASoC: mediatek: mt8188-mt6359: Use bitfield macros for registers
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/5] ASoC: mediatek: mt8188-mt6359: Compress of_device_id entries
      commit: 22628e92d76a403181916f7bac7848dd2326d750
[2/5] ASoC: mediatek: mt8188-mt6359: clean up a return in codec_init
      commit: 1148b42257e2bf30093708398db2c4570ae9fe97
[3/5] ASoC: mediatek: mt8188-mt6359: Cleanup return 0 disguised as return ret
      commit: 4882ef44f51bbb759b8a738b747fdbcbad38e51b
[4/5] ASoC: mediatek: mt8188-mt6359: Clean up log levels
      commit: acb43baf8b7e75acdb14920de29881e3f70c6819
[5/5] ASoC: mediatek: mt8188-mt6359: Use bitfield macros for registers
      commit: b0e2e4fb8a5467f4f64bcf64d1454d18cb665cc8

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark
Matthias Brugger June 8, 2023, 4:48 p.m. UTC | #5
On 08/06/2023 10:47, AngeloGioacchino Del Regno wrote:
> Those entries fit in one line: compress them to reduce line count.
> While at it, also add the sentinel comment to the last entry.
> 
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>

Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>

> ---
>   sound/soc/mediatek/mt8188/mt8188-mt6359.c | 12 +++---------
>   1 file changed, 3 insertions(+), 9 deletions(-)
> 
> diff --git a/sound/soc/mediatek/mt8188/mt8188-mt6359.c b/sound/soc/mediatek/mt8188/mt8188-mt6359.c
> index bc4b74970a46..643a7a12a96b 100644
> --- a/sound/soc/mediatek/mt8188/mt8188-mt6359.c
> +++ b/sound/soc/mediatek/mt8188/mt8188-mt6359.c
> @@ -1117,15 +1117,9 @@ static struct mt8188_card_data mt8188_nau8825_card = {
>   };
>   
>   static const struct of_device_id mt8188_mt6359_dt_match[] = {
> -	{
> -		.compatible = "mediatek,mt8188-mt6359-evb",
> -		.data = &mt8188_evb_card,
> -	},
> -	{
> -		.compatible = "mediatek,mt8188-nau8825",
> -		.data = &mt8188_nau8825_card,
> -	},
> -	{},
> +	{ .compatible = "mediatek,mt8188-mt6359-evb", .data = &mt8188_evb_card, },
> +	{ .compatible = "mediatek,mt8188-nau8825", .data = &mt8188_nau8825_card, },
> +	{ /* sentinel */ },
>   };
>   MODULE_DEVICE_TABLE(of, mt8188_mt6359_dt_match);
>
Matthias Brugger June 8, 2023, 4:49 p.m. UTC | #6
On 08/06/2023 10:47, AngeloGioacchino Del Regno wrote:
> Change all instances of `return ret` to `return 0` at the end of
> functions where ret is always zero and also change functions
> mt8188_{hdmi,dptx}_codec_init to be consistent with how other
> functions are returning errors
> 
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>

Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>

> ---
>   sound/soc/mediatek/mt8188/mt8188-mt6359.c | 20 ++++++++++++--------
>   1 file changed, 12 insertions(+), 8 deletions(-)
> 
> diff --git a/sound/soc/mediatek/mt8188/mt8188-mt6359.c b/sound/soc/mediatek/mt8188/mt8188-mt6359.c
> index b2735496d140..260cace408b9 100644
> --- a/sound/soc/mediatek/mt8188/mt8188-mt6359.c
> +++ b/sound/soc/mediatek/mt8188/mt8188-mt6359.c
> @@ -491,11 +491,13 @@ static int mt8188_hdmi_codec_init(struct snd_soc_pcm_runtime *rtd)
>   	}
>   
>   	ret = snd_soc_component_set_jack(component, &priv->hdmi_jack, NULL);
> -	if (ret)
> +	if (ret) {
>   		dev_info(rtd->dev, "%s, set jack failed on %s (ret=%d)\n",
>   			 __func__, component->name, ret);
> +		return ret;
> +	}
>   
> -	return ret;
> +	return 0;
>   }
>   
>   static int mt8188_dptx_codec_init(struct snd_soc_pcm_runtime *rtd)
> @@ -513,11 +515,13 @@ static int mt8188_dptx_codec_init(struct snd_soc_pcm_runtime *rtd)
>   	}
>   
>   	ret = snd_soc_component_set_jack(component, &priv->dp_jack, NULL);
> -	if (ret)
> +	if (ret) {
>   		dev_info(rtd->dev, "%s, set jack failed on %s (ret=%d)\n",
>   			 __func__, component->name, ret);
> +		return ret;
> +	}
>   
> -	return ret;
> +	return 0;
>   }
>   
>   static int mt8188_dumb_amp_init(struct snd_soc_pcm_runtime *rtd)
> @@ -539,7 +543,7 @@ static int mt8188_dumb_amp_init(struct snd_soc_pcm_runtime *rtd)
>   		return ret;
>   	}
>   
> -	return ret;
> +	return 0;
>   }
>   
>   static int mt8188_max98390_hw_params(struct snd_pcm_substream *substream,
> @@ -612,7 +616,7 @@ static int mt8188_max98390_codec_init(struct snd_soc_pcm_runtime *rtd)
>   		return ret;
>   	}
>   
> -	return ret;
> +	return 0;
>   }
>   
>   static int mt8188_nau8825_codec_init(struct snd_soc_pcm_runtime *rtd)
> @@ -660,7 +664,7 @@ static int mt8188_nau8825_codec_init(struct snd_soc_pcm_runtime *rtd)
>   		return ret;
>   	}
>   
> -	return ret;
> +	return 0;
>   };
>   
>   static void mt8188_nau8825_codec_exit(struct snd_soc_pcm_runtime *rtd)
> @@ -697,7 +701,7 @@ static int mt8188_nau8825_hw_params(struct snd_pcm_substream *substream,
>   		return ret;
>   	}
>   
> -	return ret;
> +	return 0;
>   }
>   
>   static const struct snd_soc_ops mt8188_nau8825_ops = {