Skip to contentSkip to conversation

spi: tegra210-quad: Fix duplicate resource error

PATCH In review Krishna Yarlagadda 3 participants 3 messages Nov 17, 2022

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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 f89d2cc3967a ("spi: tegra210-quad: use devm call for cdata memory")
---
 drivers/spi/spi-tegra210-quad.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/spi/spi-tegra210-quad.c +2 -1
index 10f0c5a6e0dc..9f356612ba7e 100644
@@ -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;
 
Signature · 1 line
2.17.1
maintainer Reviewed-by Tested-by on v1 1/1
#1 lore raw
Quoted 15 lines · Krishna Yarlagadda

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

Fixes f89d2cc3967a ("spi: tegra210-quad: use devm call for cdata memory")
---
  drivers/spi/spi-tegra210-quad.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
drivers/spi/spi-tegra210-quad.c +0 -0
index 10f0c5a6e0dc..9f356612ba7e 100644

drivers/spi/spi-tegra210-quad.c static int tegra_qspi_start_transfer_one(struct spi_device *spi, · line 932

Quoted 10 lines
drivers/spi/spi-tegra210-quad.c +2 -1
@@ -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;
 

Thanks
Jon

Signature · 1 line
nvpublic
maintainer
#2 lore raw
In reply to Krishna Yarlagadda
Quoted 6 lines · Krishna Yarlagadda

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

Fixes f89d2cc3967a ("spi: tegra210-quad: use devm call for cdata memory")

Applied to

broonie/spi.git for-next

Thanks!

[1/1] spi: tegra210-quad: Fix duplicate resource error

      commit: 2197aa6b0aa236b9896a09b9d08d6924d18b84f6

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark