From: Jonathan Cameron <jic23@kernel.org>
To: "Nuno Sá" <noname.nuno@gmail.com>
Cc: "Christophe JAILLET" <christophe.jaillet@wanadoo.fr>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
"Kyungmin Park" <kyungmin.park@samsung.com>,
"Karol Wrona" <k.wrona@samsung.com>,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
linux-iio@vger.kernel.org
Subject: Re: [PATCH] iio:common:ssp_sensors: Fix an error handling path ssp_probe()
Date: Sun, 12 Oct 2025 20:02:11 +0100 [thread overview]
Message-ID: <20251012200211.19170a6f@jic23-huawei> (raw)
In-Reply-To: <3e91c2a282499f862ed7d27842d5bc2ee461ebf8.camel@gmail.com>
On Fri, 10 Oct 2025 19:56:41 +0100
Nuno Sá <noname.nuno@gmail.com> wrote:
> On Fri, 2025-10-10 at 20:58 +0200, Christophe JAILLET wrote:
> > If an error occurs after a successful mfd_add_devices() call, it should be
> > undone by a corresponding mfd_remove_devices() call, as already done in the
> > remove function.
> >
> > Fixes: 50dd64d57eee ("iio: common: ssp_sensors: Add sensorhub driver")
> > Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> > ---
>
> Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Applied to my temporary fixes branch (I'll rebase on rc1) and marked
for stable.
Thanks,
Jonathan
>
> > drivers/iio/common/ssp_sensors/ssp_dev.c | 4 +++-
> > 1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/iio/common/ssp_sensors/ssp_dev.c
> > b/drivers/iio/common/ssp_sensors/ssp_dev.c
> > index 1e167dc673ca..da09c9f3ceb6 100644
> > --- a/drivers/iio/common/ssp_sensors/ssp_dev.c
> > +++ b/drivers/iio/common/ssp_sensors/ssp_dev.c
> > @@ -503,7 +503,7 @@ static int ssp_probe(struct spi_device *spi)
> > ret = spi_setup(spi);
> > if (ret < 0) {
> > dev_err(&spi->dev, "Failed to setup spi\n");
> > - return ret;
> > + goto err_setup_spi;
> > }
> >
> > data->fw_dl_state = SSP_FW_DL_STATE_NONE;
> > @@ -568,6 +568,8 @@ static int ssp_probe(struct spi_device *spi)
> > err_setup_irq:
> > mutex_destroy(&data->pending_lock);
> > mutex_destroy(&data->comm_lock);
> > +err_setup_spi:
> > + mfd_remove_devices(&spi->dev);
> >
> > dev_err(&spi->dev, "Probe failed!\n");
> >
prev parent reply other threads:[~2025-10-12 19:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-10 18:58 [PATCH] iio:common:ssp_sensors: Fix an error handling path ssp_probe() Christophe JAILLET
2025-10-10 18:56 ` Nuno Sá
2025-10-12 19:02 ` Jonathan Cameron [this message]
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=20251012200211.19170a6f@jic23-huawei \
--to=jic23@kernel.org \
--cc=andy@kernel.org \
--cc=christophe.jaillet@wanadoo.fr \
--cc=dlechner@baylibre.com \
--cc=k.wrona@samsung.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=kyungmin.park@samsung.com \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=noname.nuno@gmail.com \
--cc=nuno.sa@analog.com \
/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