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 12:51:13 +0000, broonie@xxxxxxxxxx wrote:
> 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.

Thank you very much for your reviewer.
I will use "switch" to differentiate devices


Best regards
Weidong Wang




[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