linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] ACPI: bus: Eliminate acpi_bus_get_device()
@ 2022-04-05 16:57 Rafael J. Wysocki
  2022-04-05 17:04 ` Mark Brown
  0 siblings, 1 reply; 3+ messages in thread
From: Rafael J. Wysocki @ 2022-04-05 16:57 UTC (permalink / raw)
  To: Linux ACPI; +Cc: LKML, Mark Brown, linux-spi

From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Replace the last instance of acpi_bus_get_device(), added recently
by commit 87e59b36e5e2 ("spi: Support selection of the index of the
ACPI Spi Resource before alloc"), with acpi_fetch_acpi_dev() and
finally drop acpi_bus_get_device() that has no more users.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 drivers/acpi/scan.c     |   13 -------------
 drivers/spi/spi.c       |    3 ++-
 include/acpi/acpi_bus.h |    1 -
 3 files changed, 2 insertions(+), 15 deletions(-)

Index: linux-pm/drivers/spi/spi.c
===================================================================
--- linux-pm.orig/drivers/spi/spi.c
+++ linux-pm/drivers/spi/spi.c
@@ -2406,7 +2406,8 @@ static int acpi_spi_add_resource(struct
 			} else {
 				struct acpi_device *adev;
 
-				if (acpi_bus_get_device(parent_handle, &adev))
+				adev = acpi_fetch_acpi_dev(parent_handle);
+				if (!adev)
 					return -ENODEV;
 
 				ctlr = acpi_spi_find_controller_by_adev(adev);
Index: linux-pm/include/acpi/acpi_bus.h
===================================================================
--- linux-pm.orig/include/acpi/acpi_bus.h
+++ linux-pm/include/acpi/acpi_bus.h
@@ -511,7 +511,6 @@ extern int unregister_acpi_notifier(stru
  * External Functions
  */
 
-int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device);
 struct acpi_device *acpi_fetch_acpi_dev(acpi_handle handle);
 acpi_status acpi_bus_get_status_handle(acpi_handle handle,
 				       unsigned long long *sta);
Index: linux-pm/drivers/acpi/scan.c
===================================================================
--- linux-pm.orig/drivers/acpi/scan.c
+++ linux-pm/drivers/acpi/scan.c
@@ -588,19 +588,6 @@ static struct acpi_device *handle_to_dev
 	return adev;
 }
 
-int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device)
-{
-	if (!device)
-		return -EINVAL;
-
-	*device = handle_to_device(handle, NULL);
-	if (!*device)
-		return -ENODEV;
-
-	return 0;
-}
-EXPORT_SYMBOL(acpi_bus_get_device);
-
 /**
  * acpi_fetch_acpi_dev - Retrieve ACPI device object.
  * @handle: ACPI handle associated with the requested ACPI device object.




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

* Re: [PATCH v1] ACPI: bus: Eliminate acpi_bus_get_device()
  2022-04-05 16:57 [PATCH v1] ACPI: bus: Eliminate acpi_bus_get_device() Rafael J. Wysocki
@ 2022-04-05 17:04 ` Mark Brown
  2022-04-06 11:08   ` Rafael J. Wysocki
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Brown @ 2022-04-05 17:04 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: Linux ACPI, LKML, linux-spi

[-- Attachment #1: Type: text/plain, Size: 484 bytes --]

On Tue, Apr 05, 2022 at 06:57:10PM +0200, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> 
> Replace the last instance of acpi_bus_get_device(), added recently
> by commit 87e59b36e5e2 ("spi: Support selection of the index of the
> ACPI Spi Resource before alloc"), with acpi_fetch_acpi_dev() and
> finally drop acpi_bus_get_device() that has no more users.

Acked-by: Mark Brown <broonie@kernel.org>

Or I can take this via the SPI tree?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH v1] ACPI: bus: Eliminate acpi_bus_get_device()
  2022-04-05 17:04 ` Mark Brown
@ 2022-04-06 11:08   ` Rafael J. Wysocki
  0 siblings, 0 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2022-04-06 11:08 UTC (permalink / raw)
  To: Mark Brown; +Cc: Rafael J. Wysocki, Linux ACPI, LKML, linux-spi

On Wed, Apr 6, 2022 at 3:48 AM Mark Brown <broonie@kernel.org> wrote:
>
> On Tue, Apr 05, 2022 at 06:57:10PM +0200, Rafael J. Wysocki wrote:
> > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> >
> > Replace the last instance of acpi_bus_get_device(), added recently
> > by commit 87e59b36e5e2 ("spi: Support selection of the index of the
> > ACPI Spi Resource before alloc"), with acpi_fetch_acpi_dev() and
> > finally drop acpi_bus_get_device() that has no more users.
>
> Acked-by: Mark Brown <broonie@kernel.org>

Thanks!

> Or I can take this via the SPI tree?

I'm going to push this for -rc2 so acpi_bus_get_device() is not there
in case somebody has a plan to use it again. :-)

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

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

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-05 16:57 [PATCH v1] ACPI: bus: Eliminate acpi_bus_get_device() Rafael J. Wysocki
2022-04-05 17:04 ` Mark Brown
2022-04-06 11:08   ` Rafael J. Wysocki

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