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]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux