Re: [PATCH] ALSA: atmel: ac97c: use platform helpers and devm cleanup
Takashi Iwai <[email protected]> Wed, 22 Jul 2026 13:27:19 +0200
| Newsgroups | dev.linux.lists.llvm,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-kernel,org.kernel.vger.linux-sound |
|---|---|
| Message-ID | <[email protected]> |
On Wed, 22 Jul 2026 00:54:11 +0200, Rosen Penev wrote: > > Convert atmel_ac97c_probe() to the managed APIs. Replace the open-coded > platform_get_resource() + ioremap() with devm_platform_ioremap_resource(), > which requests and maps the AC97C register window in one call. Switch the > clock to devm_clk_get_enabled(), the card to snd_devm_card_new(), and the > interrupt to devm_request_irq(). The now-unnecessary error-path cleanup > and the manual teardown in atmel_ac97c_remove() are dropped, since devm > handles them. > > platform_get_irq() was already used; tighten its error check to irq < 0. > > Both resource and IRQ lookups are equivalent for a platform-backed > device. The AC97C register window is owned solely by this driver, so the > new region request cannot conflict with another claimant, and it is > mapped exactly once (no double mapping). > > No functional change; built for ARM (allmodconfig + SND_ATMEL_AC97C) > with LLVM=1 and sound/atmel/ac97c.o compiles cleanly. > > Assisted-by: opencode:hy3-free > Signed-off-by: Rosen Penev <[email protected]> Applied to for-next branch. Thanks. Takashi