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
- Follow-Ups:
- Re: [PATCH V1 2/2] ASoC: codecs: Add aw88083 amplifier driver
- From: wangweidong . a
- Re: [PATCH V1 2/2] ASoC: codecs: Add aw88083 amplifier driver
- References:
- [PATCH V1 0/2] ASoC: codecs: Add aw88083 amplifier driver
- From: wangweidong . a
- [PATCH V1 2/2] ASoC: codecs: Add aw88083 amplifier driver
- From: wangweidong . a
- [PATCH V1 0/2] ASoC: codecs: Add aw88083 amplifier driver
- Prev by Date: [PATCH] ASoC: amd: yc: Fix bug where quirks code was skipped due to early return.
- Next by Date: Re: [PATCH V5] Docs/sound: Update codec-to-codec documentation
- Previous by thread: [PATCH V1 2/2] ASoC: codecs: Add aw88083 amplifier driver
- Next by thread: Re: [PATCH V1 2/2] ASoC: codecs: Add aw88083 amplifier driver
- Index(es):