@@ -205,7 +205,7 @@ static acpi_status acpi_i2c_add_device(acpi_handle handle, u32 level,
void *data, void **return_value)
{
struct i2c_adapter *adapter = data;
- struct acpi_device *adev;
+ struct acpi_device *adev, *adapter_adev;
acpi_handle adapter_handle;
struct i2c_board_info info;
@@ -218,6 +218,12 @@ static acpi_status acpi_i2c_add_device(acpi_handle handle, u32 level,
if (adapter_handle != ACPI_HANDLE(&adapter->dev))
return AE_OK;
+ /* The adapter must be present */
+ if (acpi_bus_get_device(adapter_handle, &adapter_adev))
+ return AE_OK;
+ if (acpi_bus_get_status(adapter_adev) || !adapter_adev->status.present)
+ return AE_OK;
+
acpi_i2c_register_device(adapter, adev, &info);
return AE_OK;