[alsa-devel] [PATCH v2] ASoC: rt1308: Add RT1308 amplifier driver

Mark Brown broonie at kernel.org
Mon Jun 17 12:22:32 CEST 2019


On Sat, Jun 15, 2019 at 05:04:47PM +0800, derek.fang at realtek.com wrote:

This looks mostly good, a couple of really small things which should be
easy to fix:

> +	return devm_snd_soc_register_component(&i2c->dev,
> +			&soc_component_dev_rt1308,
> +			rt1308_dai, ARRAY_SIZE(rt1308_dai));
> +}
> +
> +static int rt1308_i2c_remove(struct i2c_client *i2c)
> +{
> +	snd_soc_unregister_component(&i2c->dev);
> +
> +	return 0;
> +}

You used devm_snd_soc_register_component() so no need to explicitly
unregister and this function can go.

> +#if defined(CONFIG_OF)
> +		.of_match_table = rt1308_of_match,
> +#endif

of_match_ptr()

> +#if defined(CONFIG_ACPI)
> +		.acpi_match_table = ACPI_PTR(rt1308_acpi_match)
> +#endif

No need for the ifdef, that's what ACPI_PTR() does.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20190617/1d60b4e9/attachment.sig>


More information about the Alsa-devel mailing list