diff --git a/drivers/i2c/busses/i2c-hisi.c b/drivers/i2c/busses/i2c-hisi.c index 80af92e491ef863c8b4f16b9169f8176f21abda4..ddadd6fe8b27f1cc5f878e61681619cd6e8798f1 100644 --- a/drivers/i2c/busses/i2c-hisi.c +++ b/drivers/i2c/busses/i2c-hisi.c @@ -498,7 +498,10 @@ static void hisi_i2c_init_recovery_info(struct hisi_i2c_controller *ctlr) struct acpi_device *adev = ACPI_COMPANION(ctlr->dev); struct gpio_desc *gpio; - if (!acpi_has_method(adev->handle, HISI_I2C_PIN_MUX_METHOD)) + if (acpi_disabled) + return; + + if (!adev || !acpi_has_method(adev->handle, HISI_I2C_PIN_MUX_METHOD)) return; gpio = devm_gpiod_get_optional(ctlr->dev, "scl", GPIOD_OUT_HIGH);