Re: [PATCH v2] ALSA: atmel: ac97c: fix reset GPIO error handling
From: Takashi Iwai
Date: Fri Nov 27 2026 - 12:37:36 EST
On Fri, 27 Nov 2026 11:06:45 +0100,
Sreeraj S Kurup wrote:
>
> The driver currently ignores errors returned by
> devm_gpiod_get_index() and continues probing. This can cause problems
> when the GPIO provider is not ready and the function returns
> -EPROBE_DEFER.
>
> Use devm_gpiod_get_index_optional() to handle the reset GPIO as
> optional. If the GPIO is not available, the driver can continue using
> the internal reset mechanism. If GPIO acquisition fails for another
> reason, return the error using dev_err_probe().
>
> Also, check the GPIO descriptor for NULL in atmel_ac97c_reset(),
> because the optional GPIO API returns NULL when no GPIO is assigned.
>
> Fixes: 5f10e84934e4 ("ALSA: atmel: convert AC97c driver to GPIO descriptor API")
> Signed-off-by: Sreeraj S Kurup <sreekuttan2156239@xxxxxxxxx>
Applied to for-next branch. Thanks.
Takashi