Commit e8ba2597 authored by Nuno Sa's avatar Nuno Sa Committed by Mark Brown

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: default avatarNuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240705-dev-spi-xcomm-gpiochip-v2-2-b10842fc9636@analog.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 5211070c
......@@ -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);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment