Skip to content

Commit

Permalink
hwmon: (xgene) Minor clean up of ifdef and acpi_match_table reference
Browse files Browse the repository at this point in the history
This patch removes the un-necessary ifdef CONFIG_ACPI and directly
uses the acpi_match_table from the driver pdev.

Signed-off-by: Hoan Tran <hotran@apm.com>
[groeck: Dropped unnecessary initialization]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
  • Loading branch information
hotran authored and Guenter Roeck committed Nov 1, 2017
1 parent 5813da1 commit 2305a18
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions drivers/hwmon/xgene-hwmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -665,16 +665,15 @@ static int xgene_hwmon_probe(struct platform_device *pdev)
}
} else {
struct acpi_pcct_hw_reduced *cppc_ss;
int version = XGENE_HWMON_V1;
#ifdef CONFIG_ACPI
const struct acpi_device_id *acpi_id;
int version;

acpi_id = acpi_match_device(xgene_hwmon_acpi_match, &pdev->dev);
acpi_id = acpi_match_device(pdev->dev.driver->acpi_match_table,
&pdev->dev);
if (!acpi_id)
return -EINVAL;

version = (int)acpi_id->driver_data;
#endif

if (device_property_read_u32(&pdev->dev, "pcc-channel",
&ctx->mbox_idx)) {
Expand Down

0 comments on commit 2305a18

Please sign in to comment.