diff mbox series

[v3] drivers: net: Replace acpi_bus_get_device()

Message ID 11920660.O9o76ZdvQC@kreacher (mailing list archive)
State Accepted
Commit 52dae93f3bad842c6d585700460a0dea4d70e096
Delegated to: Netdev Maintainers
Headers show
Series [v3] drivers: net: Replace acpi_bus_get_device() | expand

Checks

Context Check Description
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 17 this patch: 17
netdev/cc_maintainers warning 3 maintainers not CCed: linux-arm-kernel@lists.infradead.org thunder.leizhen@huawei.com linux@armlinux.org.uk
netdev/build_clang success Errors and warnings before: 2 this patch: 2
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 17 this patch: 17
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 30 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/tree_selection success Guessing tree name failed - patch did not apply

Commit Message

Rafael J. Wysocki Feb. 2, 2022, 2:19 p.m. UTC
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Replace acpi_bus_get_device() that is going to be dropped with
acpi_fetch_acpi_dev().

While at it, rearrange the local variable definitions in
bgx_acpi_register_phy() and mdio-xgene.c:acpi_register_phy() so as
to put them in the reverse xmas tree order.

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---

v2 -> v3: Fix a build issue and avoid changing the lists of local
          variables (Jakub Kicinski).

-> v2: Put local variable definitions in two functions in the reverse xmas
       tree order (Andrew Lunn).

---
 drivers/net/ethernet/cavium/thunder/thunder_bgx.c |    3 ++-
 drivers/net/fjes/fjes_main.c                      |    5 ++---
 drivers/net/mdio/mdio-xgene.c                     |    3 ++-
 3 files changed, 6 insertions(+), 5 deletions(-)
diff mbox series

Patch

Index: linux-pm/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
===================================================================
--- linux-pm.orig/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
+++ linux-pm/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
@@ -1409,7 +1409,8 @@  static acpi_status bgx_acpi_register_phy
 	struct device *dev = &bgx->pdev->dev;
 	struct acpi_device *adev;
 
-	if (acpi_bus_get_device(handle, &adev))
+	adev = acpi_fetch_acpi_dev(handle);
+	if (!adev)
 		goto out;
 
 	acpi_get_mac_address(dev, adev, bgx->lmac[bgx->acpi_lmac_idx].mac);
Index: linux-pm/drivers/net/fjes/fjes_main.c
===================================================================
--- linux-pm.orig/drivers/net/fjes/fjes_main.c
+++ linux-pm/drivers/net/fjes/fjes_main.c
@@ -1514,10 +1514,9 @@  acpi_find_extended_socket_device(acpi_ha
 {
 	struct acpi_device *device;
 	bool *found = context;
-	int result;
 
-	result = acpi_bus_get_device(obj_handle, &device);
-	if (result)
+	device = acpi_fetch_acpi_dev(obj_handle);
+	if (!device)
 		return AE_OK;
 
 	if (strcmp(acpi_device_hid(device), ACPI_MOTHERBOARD_RESOURCE_HID))
Index: linux-pm/drivers/net/mdio/mdio-xgene.c
===================================================================
--- linux-pm.orig/drivers/net/mdio/mdio-xgene.c
+++ linux-pm/drivers/net/mdio/mdio-xgene.c
@@ -285,7 +285,8 @@  static acpi_status acpi_register_phy(acp
 	const union acpi_object *obj;
 	u32 phy_addr;
 
-	if (acpi_bus_get_device(handle, &adev))
+	adev = acpi_fetch_acpi_dev(handle);
+	if (!adev)
 		return AE_OK;
 
 	if (acpi_dev_get_property(adev, "phy-channel", ACPI_TYPE_INTEGER, &obj))