Re: [PATCH V1 2/2] ASoC: codecs: Add aw88083 amplifier driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On Tue, Dec 10, 2024 at 05:10:54PM +0800, wangweidong.a@xxxxxxxxxx wrote:

> -	aw88081_dev_clear_int_status(aw_dev);
> +	if (aw88081->devtype == AW88081)
> +		/* clear inturrupt */
> +		aw88081_dev_clear_int_status(aw_dev);
> +

These if (devtype) statements will get hard to maintain as more device
types are added (and the diff here is already pretty confusing).  It's
better to use a switch statement with cases for the devices that need
specific handling, that way more devices can easily slot in.

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Pulseaudio]     [Linux Audio Users]     [ALSA Devel]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux