linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/2] spi: propagate error code to the caller of acpi_spi_device_alloc()
@ 2022-07-09  0:07 Andy Shevchenko
  2022-07-09  0:07 ` [PATCH v1 2/2] spi: remove duplicate parameters check in acpi_spi_add_resource() Andy Shevchenko
  2022-07-11 12:46 ` [PATCH v1 1/2] spi: propagate error code to the caller of acpi_spi_device_alloc() Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Andy Shevchenko @ 2022-07-09  0:07 UTC (permalink / raw)
  To: Mark Brown, linux-spi, linux-kernel; +Cc: Andy Shevchenko

Since acpi_spi_device_alloc() has been designed to return an error
pointer we may now properly propagate error codes to the caller of
it. It helps debugging a lot.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/spi/spi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 0690f018c413..d4a8665410ea 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -2565,7 +2565,7 @@ struct spi_device *acpi_spi_device_alloc(struct spi_controller *ctlr,
 
 	if (ret < 0)
 		/* Found SPI in _CRS but it points to another controller */
-		return ERR_PTR(-ENODEV);
+		return ERR_PTR(ret);
 
 	if (!lookup.max_speed_hz &&
 	    ACPI_SUCCESS(acpi_get_parent(adev->handle, &parent_handle)) &&
-- 
2.35.1


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

* [PATCH v1 2/2] spi: remove duplicate parameters check in acpi_spi_add_resource()
  2022-07-09  0:07 [PATCH v1 1/2] spi: propagate error code to the caller of acpi_spi_device_alloc() Andy Shevchenko
@ 2022-07-09  0:07 ` Andy Shevchenko
  2022-07-11 12:46 ` [PATCH v1 1/2] spi: propagate error code to the caller of acpi_spi_device_alloc() Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Andy Shevchenko @ 2022-07-09  0:07 UTC (permalink / raw)
  To: Mark Brown, linux-spi, linux-kernel; +Cc: Andy Shevchenko

The acpi_spi_add_resource() is never called with ctrl == NULL and
index == -1. The only caller already performs the check. Hence
remove the duplication from the acpi_spi_add_resource().

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/spi/spi.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index d4a8665410ea..9b080dafa52c 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -2459,9 +2459,6 @@ static int acpi_spi_add_resource(struct acpi_resource *ares, void *data)
 			if (lookup->index != -1 && lookup->n++ != lookup->index)
 				return 1;
 
-			if (lookup->index == -1 && !ctlr)
-				return -ENODEV;
-
 			status = acpi_get_handle(NULL,
 						 sb->resource_source.string_ptr,
 						 &parent_handle);
-- 
2.35.1


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

* Re: [PATCH v1 1/2] spi: propagate error code to the caller of acpi_spi_device_alloc()
  2022-07-09  0:07 [PATCH v1 1/2] spi: propagate error code to the caller of acpi_spi_device_alloc() Andy Shevchenko
  2022-07-09  0:07 ` [PATCH v1 2/2] spi: remove duplicate parameters check in acpi_spi_add_resource() Andy Shevchenko
@ 2022-07-11 12:46 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2022-07-11 12:46 UTC (permalink / raw)
  To: andriy.shevchenko, linux-spi, linux-kernel

On Sat, 9 Jul 2022 03:07:08 +0300, Andy Shevchenko wrote:
> Since acpi_spi_device_alloc() has been designed to return an error
> pointer we may now properly propagate error codes to the caller of
> it. It helps debugging a lot.
> 
> 

Applied to

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

Thanks!

[1/2] spi: propagate error code to the caller of acpi_spi_device_alloc()
      commit: b6747f4fba399a73a87fac80ac1d0c952a44b222
[2/2] spi: remove duplicate parameters check in acpi_spi_add_resource()
      commit: cdb0cc9379f1b4fa5ea3e0492bacf8008f3f4e5a

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-07-11 12:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-09  0:07 [PATCH v1 1/2] spi: propagate error code to the caller of acpi_spi_device_alloc() Andy Shevchenko
2022-07-09  0:07 ` [PATCH v1 2/2] spi: remove duplicate parameters check in acpi_spi_add_resource() Andy Shevchenko
2022-07-11 12:46 ` [PATCH v1 1/2] spi: propagate error code to the caller of acpi_spi_device_alloc() 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).