[PATCH] ALSA: atmel: ac97c: use platform helpers and devm cleanup

Takashi Iwai tiwai at suse.de
Wed Jul 22 04:27:19 PDT 2026


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 <rosenp at gmail.com>

Applied to for-next branch.  Thanks.


Takashi



More information about the linux-arm-kernel mailing list