Skip to contentSkip to conversation

hwmon: xgene: Minor clean up of ifdef and acpi_match_table reference

PATCH Applied Hoan Tran 2 participants 3 messages Oct 31, 2017 – Nov 1, 2017 Hardware monitoring

lore
Share & tools
lore

Hoan Tran

author
#0 lore raw

PATCH 1/1 hwmon: xgene: Minor clean up of ifdef and acpi_match_table reference

This patch removes the un-necessary ifdef CONFIG_ACPI and directly uses the acpi_match_table from the driver pdev.

---
 drivers/hwmon/xgene-hwmon.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/hwmon/xgene-hwmon.c +3 -4
index 5783436..85c4e3d 100644
@@ -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 = XGENE_HWMON_V1;
 
-		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)) {
Signature · 1 line
2.7.4
maintainer Applied
#1 lore raw
Quoted 4 lines · hotran

This patch removes the un-necessary ifdef CONFIG_ACPI and directly uses the acpi_match_table from the driver pdev.

Applied to hwmon-next, with now unnecessary initialization of 'version' removed.

Thanks,
Guenter

Quoted 28 lines
---
 drivers/hwmon/xgene-hwmon.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/hwmon/xgene-hwmon.c +3 -4
index 5783436..85c4e3d 100644
@@ -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 = XGENE_HWMON_V1;
 
-		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)) {
author
#2 lore raw
Quoted 8 lines · Guenter Roeck
Quoted 4 lines · hotran

This patch removes the un-necessary ifdef CONFIG_ACPI and directly uses the acpi_match_table from the driver pdev.

Applied to hwmon-next, with now unnecessary initialization of 'version' removed.

Thanks, Guenter

Regards
Hoan

Quoted 32 lines

Thanks,
Guenter

Quoted 28 lines
---
 drivers/hwmon/xgene-hwmon.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/hwmon/xgene-hwmon.c +3 -4
index 5783436..85c4e3d 100644
@@ -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 = XGENE_HWMON_V1;
 
-             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)) {