===================================================================
@@ -1407,9 +1407,9 @@ static acpi_status bgx_acpi_register_phy
{
struct bgx *bgx = context;
struct device *dev = &bgx->pdev->dev;
- struct acpi_device *adev;
+ struct acpi_device *adev = acpi_fetch_acpi_dev(handle);
- if (acpi_bus_get_device(handle, &adev))
+ if (!adev)
goto out;
acpi_get_mac_address(dev, adev, bgx->lmac[bgx->acpi_lmac_idx].mac);
===================================================================
@@ -1512,15 +1512,11 @@ static acpi_status
acpi_find_extended_socket_device(acpi_handle obj_handle, u32 level,
void *context, void **return_value)
{
- struct acpi_device *device;
+ struct acpi_device *device = acpi_fetch_acpi_dev(obj_handle);
bool *found = context;
- int result;
- result = acpi_bus_get_device(obj_handle, &device);
- if (result)
- return AE_OK;
-
- if (strcmp(acpi_device_hid(device), ACPI_MOTHERBOARD_RESOURCE_HID))
+ if (!device ||
+ strcmp(acpi_device_hid(device), ACPI_MOTHERBOARD_RESOURCE_HID))
return AE_OK;
if (!is_extended_socket_device(device))
===================================================================
@@ -280,15 +280,13 @@ static acpi_status acpi_register_phy(acp
void *context, void **ret)
{
struct mii_bus *mdio = context;
- struct acpi_device *adev;
+ struct acpi_device *adev = acpi_fetch_acpi_dev(handle);
struct phy_device *phy_dev;
const union acpi_object *obj;
u32 phy_addr;
- if (acpi_bus_get_device(handle, &adev))
- return AE_OK;
-
- if (acpi_dev_get_property(adev, "phy-channel", ACPI_TYPE_INTEGER, &obj))
+ if (!adev ||
+ acpi_dev_get_property(adev, "phy-channel", ACPI_TYPE_INTEGER, &obj))
return AE_OK;
phy_addr = obj->integer.value;