From: Nuno Sa via B4 Relay <devnull+nuno.sa.analog.com@kernel.org>
To: linux-spi@vger.kernel.org
Cc: Mark Brown <broonie@kernel.org>,
Michael Hennerich <Michael.Hennerich@analog.com>
Subject: [PATCH v2 2/4] spi: xcomm: make use of devm_spi_alloc_host()
Date: Fri, 05 Jul 2024 17:12:40 +0200 [thread overview]
Message-ID: <20240705-dev-spi-xcomm-gpiochip-v2-2-b10842fc9636@analog.com> (raw)
In-Reply-To: <20240705-dev-spi-xcomm-gpiochip-v2-0-b10842fc9636@analog.com>
From: Nuno Sa <nuno.sa@analog.com>
Use devm_spi_alloc_host() so that there's no need to call
spi_controller_put() in the error path.
Signed-off-by: Nuno Sa <nuno.sa@analog.com>
---
drivers/spi/spi-xcomm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/spi/spi-xcomm.c b/drivers/spi/spi-xcomm.c
index 063ce75af6504..5bbc250bc0534 100644
--- a/drivers/spi/spi-xcomm.c
+++ b/drivers/spi/spi-xcomm.c
@@ -248,7 +248,7 @@ static int spi_xcomm_probe(struct i2c_client *i2c)
struct spi_controller *host;
int ret;
- host = spi_alloc_host(&i2c->dev, sizeof(*spi_xcomm));
+ host = devm_spi_alloc_host(&i2c->dev, sizeof(*spi_xcomm));
if (!host)
return -ENOMEM;
@@ -265,7 +265,7 @@ static int spi_xcomm_probe(struct i2c_client *i2c)
ret = devm_spi_register_controller(&i2c->dev, host);
if (ret < 0)
- spi_controller_put(host);
+ return ret;
return spi_xcomm_gpio_add(spi_xcomm);
}
--
2.45.2
next prev parent reply other threads:[~2024-07-05 15:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-05 15:12 [PATCH v2 0/4] spi: xcomm: support GPO pin Nuno Sa via B4 Relay
2024-07-05 15:12 ` [PATCH v2 1/4] spi: xcomm: add gpiochip support Nuno Sa via B4 Relay
2024-07-05 15:12 ` Nuno Sa via B4 Relay [this message]
2024-07-05 15:12 ` [PATCH v2 3/4] spi: xcomm: remove i2c_set_clientdata() Nuno Sa via B4 Relay
2024-07-05 15:12 ` [PATCH v2 4/4] spi: xcomm: fix coding style Nuno Sa via B4 Relay
2024-07-05 19:48 ` [PATCH v2 0/4] spi: xcomm: support GPO pin Mark Brown
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=20240705-dev-spi-xcomm-gpiochip-v2-2-b10842fc9636@analog.com \
--to=devnull+nuno.sa.analog.com@kernel.org \
--cc=Michael.Hennerich@analog.com \
--cc=broonie@kernel.org \
--cc=linux-spi@vger.kernel.org \
--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;
as well as URLs for NNTP newsgroup(s).