All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] spi: microchip-core: fix potentially incorrect return from probe
@ 2022-06-14  6:58 ` Conor Dooley
  0 siblings, 0 replies; 6+ messages in thread
From: Conor Dooley @ 2022-06-14  6:58 UTC (permalink / raw)
  To: Mark Brown
  Cc: Daire McNamara, Lewis Hanly, Conor Dooley, linux-riscv,
	linux-spi, linux-kernel, Yang Li

If platform_get_irqi() returns 0, the error case will be triggered but
probe() will return 0 rather than an error. Ape the other drivers using
this pattern and return -ENXIO.

Reported-by: Yang Li <yang.lee@linux.alibaba.com>
Link: https://lore.kernel.org/linux-spi/20220609055533.95866-2-yang.lee@linux.alibaba.com/
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
---
 drivers/spi/spi-microchip-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-microchip-core.c b/drivers/spi/spi-microchip-core.c
index 5b22a1395554..856a68fd8e9f 100644
--- a/drivers/spi/spi-microchip-core.c
+++ b/drivers/spi/spi-microchip-core.c
@@ -541,7 +541,7 @@ static int mchp_corespi_probe(struct platform_device *pdev)
 	spi->irq = platform_get_irq(pdev, 0);
 	if (spi->irq <= 0) {
 		dev_err(&pdev->dev, "invalid IRQ %d for SPI controller\n", spi->irq);
-		ret = spi->irq;
+		ret = -ENXIO;
 		goto error_release_master;
 	}
 
-- 
2.36.1


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

* [PATCH] spi: microchip-core: fix potentially incorrect return from probe
@ 2022-06-14  6:58 ` Conor Dooley
  0 siblings, 0 replies; 6+ messages in thread
From: Conor Dooley @ 2022-06-14  6:58 UTC (permalink / raw)
  To: Mark Brown
  Cc: Daire McNamara, Lewis Hanly, Conor Dooley, linux-riscv,
	linux-spi, linux-kernel, Yang Li

If platform_get_irqi() returns 0, the error case will be triggered but
probe() will return 0 rather than an error. Ape the other drivers using
this pattern and return -ENXIO.

Reported-by: Yang Li <yang.lee@linux.alibaba.com>
Link: https://lore.kernel.org/linux-spi/20220609055533.95866-2-yang.lee@linux.alibaba.com/
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
---
 drivers/spi/spi-microchip-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-microchip-core.c b/drivers/spi/spi-microchip-core.c
index 5b22a1395554..856a68fd8e9f 100644
--- a/drivers/spi/spi-microchip-core.c
+++ b/drivers/spi/spi-microchip-core.c
@@ -541,7 +541,7 @@ static int mchp_corespi_probe(struct platform_device *pdev)
 	spi->irq = platform_get_irq(pdev, 0);
 	if (spi->irq <= 0) {
 		dev_err(&pdev->dev, "invalid IRQ %d for SPI controller\n", spi->irq);
-		ret = spi->irq;
+		ret = -ENXIO;
 		goto error_release_master;
 	}
 
-- 
2.36.1


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* Re: [PATCH] spi: microchip-core: fix potentially incorrect return from probe
  2022-06-14  6:58 ` Conor Dooley
@ 2022-06-14  7:34   ` Conor.Dooley
  -1 siblings, 0 replies; 6+ messages in thread
From: Conor.Dooley @ 2022-06-14  7:34 UTC (permalink / raw)
  To: broonie
  Cc: Daire.McNamara, Lewis.Hanly, linux-riscv, linux-spi,
	linux-kernel, yang.lee

On 14/06/2022 07:58, Conor Dooley wrote:
> If platform_get_irqi() returns 0, the error case will be triggered but
> probe() will return 0 rather than an error. Ape the other drivers using
> this pattern and return -ENXIO.
> 
> Reported-by: Yang Li <yang.lee@linux.alibaba.com>
> Link: https://lore.kernel.org/linux-spi/20220609055533.95866-2-yang.lee@linux.alibaba.com/

Woops, forgot this one:
Fixes: 9ac8d17694b6 ("spi: add support for microchip fpga spi controllers")

> Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
> ---
>   drivers/spi/spi-microchip-core.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/spi/spi-microchip-core.c b/drivers/spi/spi-microchip-core.c
> index 5b22a1395554..856a68fd8e9f 100644
> --- a/drivers/spi/spi-microchip-core.c
> +++ b/drivers/spi/spi-microchip-core.c
> @@ -541,7 +541,7 @@ static int mchp_corespi_probe(struct platform_device *pdev)
>   	spi->irq = platform_get_irq(pdev, 0);
>   	if (spi->irq <= 0) {
>   		dev_err(&pdev->dev, "invalid IRQ %d for SPI controller\n", spi->irq);
> -		ret = spi->irq;
> +		ret = -ENXIO;
>   		goto error_release_master;
>   	}
>   


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

* Re: [PATCH] spi: microchip-core: fix potentially incorrect return from probe
@ 2022-06-14  7:34   ` Conor.Dooley
  0 siblings, 0 replies; 6+ messages in thread
From: Conor.Dooley @ 2022-06-14  7:34 UTC (permalink / raw)
  To: broonie
  Cc: Daire.McNamara, Lewis.Hanly, linux-riscv, linux-spi,
	linux-kernel, yang.lee

On 14/06/2022 07:58, Conor Dooley wrote:
> If platform_get_irqi() returns 0, the error case will be triggered but
> probe() will return 0 rather than an error. Ape the other drivers using
> this pattern and return -ENXIO.
> 
> Reported-by: Yang Li <yang.lee@linux.alibaba.com>
> Link: https://lore.kernel.org/linux-spi/20220609055533.95866-2-yang.lee@linux.alibaba.com/

Woops, forgot this one:
Fixes: 9ac8d17694b6 ("spi: add support for microchip fpga spi controllers")

> Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
> ---
>   drivers/spi/spi-microchip-core.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/spi/spi-microchip-core.c b/drivers/spi/spi-microchip-core.c
> index 5b22a1395554..856a68fd8e9f 100644
> --- a/drivers/spi/spi-microchip-core.c
> +++ b/drivers/spi/spi-microchip-core.c
> @@ -541,7 +541,7 @@ static int mchp_corespi_probe(struct platform_device *pdev)
>   	spi->irq = platform_get_irq(pdev, 0);
>   	if (spi->irq <= 0) {
>   		dev_err(&pdev->dev, "invalid IRQ %d for SPI controller\n", spi->irq);
> -		ret = spi->irq;
> +		ret = -ENXIO;
>   		goto error_release_master;
>   	}
>   

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* Re: [PATCH] spi: microchip-core: fix potentially incorrect return from probe
  2022-06-14  6:58 ` Conor Dooley
@ 2022-06-14 11:51   ` Mark Brown
  -1 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2022-06-14 11:51 UTC (permalink / raw)
  To: conor.dooley
  Cc: linux-riscv, linux-spi, lewis.hanly, daire.mcnamara,
	linux-kernel, yang.lee

On Tue, 14 Jun 2022 07:58:10 +0100, Conor Dooley wrote:
> If platform_get_irqi() returns 0, the error case will be triggered but
> probe() will return 0 rather than an error. Ape the other drivers using
> this pattern and return -ENXIO.
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/1] spi: microchip-core: fix potentially incorrect return from probe
      commit: d38dc01a4e68133e11ae74af7585d2c4bbd5803d

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] 6+ messages in thread

* Re: [PATCH] spi: microchip-core: fix potentially incorrect return from probe
@ 2022-06-14 11:51   ` Mark Brown
  0 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2022-06-14 11:51 UTC (permalink / raw)
  To: conor.dooley
  Cc: linux-riscv, linux-spi, lewis.hanly, daire.mcnamara,
	linux-kernel, yang.lee

On Tue, 14 Jun 2022 07:58:10 +0100, Conor Dooley wrote:
> If platform_get_irqi() returns 0, the error case will be triggered but
> probe() will return 0 rather than an error. Ape the other drivers using
> this pattern and return -ENXIO.
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/1] spi: microchip-core: fix potentially incorrect return from probe
      commit: d38dc01a4e68133e11ae74af7585d2c4bbd5803d

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

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

end of thread, other threads:[~2022-06-14 11:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-14  6:58 [PATCH] spi: microchip-core: fix potentially incorrect return from probe Conor Dooley
2022-06-14  6:58 ` Conor Dooley
2022-06-14  7:34 ` Conor.Dooley
2022-06-14  7:34   ` Conor.Dooley
2022-06-14 11:51 ` Mark Brown
2022-06-14 11:51   ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.