linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] spi: tegra210-quad: Fix duplicate resource error
@ 2022-11-17  7:03 Krishna Yarlagadda
  2022-11-17  8:08 ` Jon Hunter
  2022-11-17 11:48 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Krishna Yarlagadda @ 2022-11-17  7:03 UTC (permalink / raw)
  To: broonie, thierry.reding, jonathanh, linux-spi, linux-tegra
  Cc: skomatineni, ldewangan, linux-kernel, 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")

Signed-off-by: Krishna Yarlagadda <kyarlagadda@nvidia.com>
---
 drivers/spi/spi-tegra210-quad.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/spi-tegra210-quad.c b/drivers/spi/spi-tegra210-quad.c
index 10f0c5a6e0dc..9f356612ba7e 100644
--- a/drivers/spi/spi-tegra210-quad.c
+++ b/drivers/spi/spi-tegra210-quad.c
@@ -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;
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] spi: tegra210-quad: Fix duplicate resource error
  2022-11-17  7:03 [PATCH] spi: tegra210-quad: Fix duplicate resource error Krishna Yarlagadda
@ 2022-11-17  8:08 ` Jon Hunter
  2022-11-17 11:48 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Jon Hunter @ 2022-11-17  8:08 UTC (permalink / raw)
  To: Krishna Yarlagadda, broonie, thierry.reding, linux-spi, linux-tegra
  Cc: skomatineni, ldewangan, linux-kernel


On 17/11/2022 07:03, Krishna Yarlagadda wrote:
> 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")
> 
> Signed-off-by: Krishna Yarlagadda <kyarlagadda@nvidia.com>
> ---
>   drivers/spi/spi-tegra210-quad.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/spi/spi-tegra210-quad.c b/drivers/spi/spi-tegra210-quad.c
> index 10f0c5a6e0dc..9f356612ba7e 100644
> --- a/drivers/spi/spi-tegra210-quad.c
> +++ b/drivers/spi/spi-tegra210-quad.c
> @@ -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;
>   

Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
Tested-by: Jon Hunter <jonathanh@nvidia.com>

Thanks
Jon

-- 
nvpublic

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] spi: tegra210-quad: Fix duplicate resource error
  2022-11-17  7:03 [PATCH] spi: tegra210-quad: Fix duplicate resource error Krishna Yarlagadda
  2022-11-17  8:08 ` Jon Hunter
@ 2022-11-17 11:48 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2022-11-17 11:48 UTC (permalink / raw)
  To: jonathanh, Krishna Yarlagadda, linux-tegra, linux-spi, thierry.reding
  Cc: ldewangan, linux-kernel, skomatineni

On Thu, 17 Nov 2022 12:33:20 +0530, Krishna Yarlagadda wrote:
> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-11-17 11:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-17  7:03 [PATCH] spi: tegra210-quad: Fix duplicate resource error Krishna Yarlagadda
2022-11-17  8:08 ` Jon Hunter
2022-11-17 11:48 ` Mark Brown

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).