diff options
author | Nuno Sa <nuno.sa@analog.com> | 2024-07-05 17:12:40 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2024-07-05 18:47:44 +0100 |
commit | e8ba259764c745e7de20ec517ae920ecd491b687 (patch) | |
tree | 0ea4ebdb3959c9774f1b6d27540ba4cb87f4d0b3 /drivers/spi | |
parent | 5211070c3309bb3679f4522c77b900f551db5739 (diff) |
spi: xcomm: make use of devm_spi_alloc_host()
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>
Link: https://patch.msgid.link/20240705-dev-spi-xcomm-gpiochip-v2-2-b10842fc9636@analog.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi')
-rw-r--r-- | drivers/spi/spi-xcomm.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/spi/spi-xcomm.c b/drivers/spi/spi-xcomm.c index 063ce75af650..5bbc250bc053 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); } |