Skip to content

Commit c6f49ac

Browse files
rafaeljwwsakernel
authored andcommitted
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 <[email protected]> Acked-by: Shyam Sundar S K <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
1 parent 76eb4db commit c6f49ac

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/i2c/busses/i2c-amd-mp2-plat.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,12 +246,11 @@ static int i2c_amd_probe(struct platform_device *pdev)
246246
{
247247
int ret;
248248
struct amd_i2c_dev *i2c_dev;
249-
acpi_handle handle = ACPI_HANDLE(&pdev->dev);
250-
struct acpi_device *adev;
249+
struct acpi_device *adev = ACPI_COMPANION(&pdev->dev);
251250
struct amd_mp2_dev *mp2_dev;
252251
const char *uid;
253252

254-
if (acpi_bus_get_device(handle, &adev))
253+
if (!adev)
255254
return -ENODEV;
256255

257256
/* The ACPI namespace doesn't contain information about which MP2 PCI

0 commit comments

Comments
 (0)