Re: [PATCH v3 4/7] ASoC: codecs: Add RK3308 internal audio codec driver
From: Philipp Zabel
Date: Wed Feb 21 2024 - 08:22:16 EST
On Mi, 2024-02-21 at 11:22 +0100, Luca Ceresoli wrote:
> Add driver for the internal audio codec of the Rockchip RK3308 SoC.
>
> Initially based on the vendor kernel driver [0], with lots of cleanups,
> fixes, improvements, conversion to DAPM and removal of some features.
>
> [0] https://github.com/rockchip-linux/kernel/blob/develop-4.19/sound/soc/codecs/rk3308_codec.c
>
> Signed-off-by: Luca Ceresoli <luca.ceresoli@xxxxxxxxxxx>
>
[...]
> diff --git a/sound/soc/codecs/rk3308_codec.c b/sound/soc/codecs/rk3308_codec.c
> new file mode 100644
> index 000000000000..61bfb75f92a3
> --- /dev/null
> +++ b/sound/soc/codecs/rk3308_codec.c
> @@ -0,0 +1,993 @@
[...]
> +static int rk3308_codec_platform_probe(struct platform_device *pdev)
> +{
[...]
> + rk3308->reset = devm_reset_control_get(&pdev->dev, "codec");
> + if (IS_ERR(rk3308->reset)) {
> + err = PTR_ERR(rk3308->reset);
> + if (err != -ENOENT)
> + return err;
> +
> + dev_dbg(&pdev->dev, "No reset control found\n");
> + rk3308->reset = NULL;
> + }
Please use devm_reset_control_get_optional_exclusive(). That already
returns NULL instead of -ENOENT if the reset control is not specified
in the device tree. Then dev_err_probe() can be used to report errors.
regards
Philipp