Commit 2197aa6b authored by Krishna Yarlagadda's avatar Krishna Yarlagadda Committed by Mark Brown

spi: tegra210-quad: Fix duplicate resource error

controller data alloc is done with client device data causing duplicate
resource error. Allocate memory using controller device when using devm

Fixes: f89d2cc3 ("spi: tegra210-quad: use devm call for cdata memory")
Signed-off-by: default avatarKrishna Yarlagadda <kyarlagadda@nvidia.com>
Reviewed-by: default avatarJon Hunter <jonathanh@nvidia.com>
Tested-by: default avatarJon Hunter <jonathanh@nvidia.com>
Link: https://lore.kernel.org/r/20221117070320.18720-1-kyarlagadda@nvidia.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 804313b6
......@@ -924,8 +924,9 @@ static int tegra_qspi_start_transfer_one(struct spi_device *spi,
static struct tegra_qspi_client_data *tegra_qspi_parse_cdata_dt(struct spi_device *spi)
{
struct tegra_qspi_client_data *cdata;
struct tegra_qspi *tqspi = spi_master_get_devdata(spi->master);
cdata = devm_kzalloc(&spi->dev, sizeof(*cdata), GFP_KERNEL);
cdata = devm_kzalloc(tqspi->dev, sizeof(*cdata), GFP_KERNEL);
if (!cdata)
return NULL;
......
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