From: Rafael J. Wysocki Date: Wed, 13 Oct 2021 16:09:39 +0000 (+0200) Subject: i2c: amd-mp2-plat: ACPI: Use ACPI_COMPANION() directly X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=c6f49acb52c79f8e84af2eda4fc002a2068a6c9e;p=linux.git i2c: amd-mp2-plat: ACPI: Use ACPI_COMPANION() directly The ACPI_HANDLE() macro is a wrapper arond the ACPI_COMPANION() macro and the ACPI handle produced by the former comes from the ACPI device object produced by the latter, so it is way more straightforward to evaluate the latter directly instead of passing the handle produced by the former to acpi_bus_get_device(). Modify i2c_amd_probe() accordingly (no intentional functional impact). Signed-off-by: Rafael J. Wysocki Acked-by: Shyam Sundar S K Signed-off-by: Wolfram Sang --- diff --git a/drivers/i2c/busses/i2c-amd-mp2-plat.c b/drivers/i2c/busses/i2c-amd-mp2-plat.c index de058671f9b87..84b7e6cbc67b0 100644 --- a/drivers/i2c/busses/i2c-amd-mp2-plat.c +++ b/drivers/i2c/busses/i2c-amd-mp2-plat.c @@ -246,12 +246,11 @@ static int i2c_amd_probe(struct platform_device *pdev) { int ret; struct amd_i2c_dev *i2c_dev; - acpi_handle handle = ACPI_HANDLE(&pdev->dev); - struct acpi_device *adev; + struct acpi_device *adev = ACPI_COMPANION(&pdev->dev); struct amd_mp2_dev *mp2_dev; const char *uid; - if (acpi_bus_get_device(handle, &adev)) + if (!adev) return -ENODEV; /* The ACPI namespace doesn't contain information about which MP2 PCI