From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: arina.kharlamova@mbzuai.ac.ae
Cc: Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
Takashi Iwai <tiwai@suse.com>, Frank Li <Frank.Li@nxp.com>,
Sascha Hauer <s.hauer@pengutronix.de>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
Fabio Estevam <festevam@gmail.com>,
Shawn Guo <shawnguo@kernel.org>, Heiko Stuebner <heiko@sntech.de>,
Sugar Zhang <sugar.zhang@rock-chips.com>,
Thierry Reding <thierry.reding@kernel.org>,
Jonathan Hunter <jonathanh@nvidia.com>,
Sameer Pujar <spujar@nvidia.com>,
Liam Girdwood <lgirdwood@gmail.com>,
linux-sound@vger.kernel.org, patches@opensource.cirrus.com,
imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
linux-rockchip@lists.infradead.org, linux-tegra@vger.kernel.org,
Wentao Liang <vulab@iscas.ac.cn>
Subject: Re: [PATCH 2/6] ASoC: wm8903: Use devm_gpiochip_add_data() to add the GPIO chip
Date: Wed, 2 Dec 2026 17:42:40 +0000 [thread overview]
Message-ID: <axBYkG/jMvMqYeXu@opensource.cirrus.com> (raw)
In-Reply-To: <20261201-s2p-asoc-misc-v1-2-eda774714731@mbzuai.ac.ae>
On Tue, Dec 01, 2026 at 11:23:33PM +0400, Arina Kharlamova via B4 Relay wrote:
> From: Arina Kharlamova <arina.kharlamova@mbzuai.ac.ae>
>
> wm8903_i2c_probe() adds the GPIO chip and can still fail after that,
> when the interrupt cannot be requested or the component cannot be
> registered. The error path only disables the regulators, so the chip
> stays registered while devres frees the wm8903_priv structure that
> contains it.
>
> wm8903_init_gpio() also only logs a failure of gpiochip_add_data(), and
> wm8903_i2c_remove() calls gpiochip_remove() regardless.
>
> Add the chip with devm_gpiochip_add_data(). It is then removed on probe
> failure and on unbind, before the regmap and the driver data are
> released, and only if it was added.
>
> Fixes: 0bf79ef2c303 ("ASoC: wm8903: init GPIOs during I2C probe not codec probe")
> Fixes: 7cfe56172ac1 ("ASoC: wm8903: Expose GPIOs through gpiolib")
> Signed-off-by: Arina Kharlamova <arina.kharlamova@mbzuai.ac.ae>
> ---
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Thanks,
Charles
next prev parent reply other threads:[~2026-12-02 17:44 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-01 19:23 [PATCH 0/6] ASoC: fix error and remove paths in several drivers Arina Kharlamova via B4 Relay
2026-12-01 19:23 ` [PATCH 1/6] ASoC: bcm: bcm63xx-pcm-whistler: Fix dma_desc leak and double free Arina Kharlamova via B4 Relay
2026-12-01 19:23 ` [PATCH 2/6] ASoC: wm8903: Use devm_gpiochip_add_data() to add the GPIO chip Arina Kharlamova via B4 Relay
2026-12-02 17:42 ` Charles Keepax [this message]
2026-12-01 19:23 ` [PATCH 3/6] ASoC: wm8903: Free the IRQ when component registration fails Arina Kharlamova via B4 Relay
2026-12-02 17:44 ` Charles Keepax
2026-12-01 19:23 ` [PATCH 4/6] ASoC: mxs-saif: Use devm helpers to register mclk Arina Kharlamova via B4 Relay
2026-12-01 19:32 ` sashiko-bot
2026-12-01 19:23 ` [PATCH 5/6] ASoC: rockchip: rockchip_pdm: Fix unbalanced clk disable in remove Arina Kharlamova via B4 Relay
2026-12-01 19:23 ` [PATCH 6/6] ASoC: tegra: tegra210_ahub: Depopulate child devices on remove Arina Kharlamova via B4 Relay
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=axBYkG/jMvMqYeXu@opensource.cirrus.com \
--to=ckeepax@opensource.cirrus.com \
--cc=Frank.Li@nxp.com \
--cc=arina.kharlamova@mbzuai.ac.ae \
--cc=broonie@kernel.org \
--cc=festevam@gmail.com \
--cc=heiko@sntech.de \
--cc=imx@lists.linux.dev \
--cc=jonathanh@nvidia.com \
--cc=kernel@pengutronix.de \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=linux-sound@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=patches@opensource.cirrus.com \
--cc=perex@perex.cz \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
--cc=spujar@nvidia.com \
--cc=sugar.zhang@rock-chips.com \
--cc=thierry.reding@kernel.org \
--cc=tiwai@suse.com \
--cc=vulab@iscas.ac.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox