diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2023-01-31 16:08:20 +0300 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2023-02-02 23:06:24 +0300 |
commit | 2153a87ff9ef5537b8a96e7c94a9d79a78c7a30c (patch) | |
tree | e813150f156a26d70aaddfc6230e2c3b16e8b6a4 /drivers/thermal/intel | |
parent | ae98e57a6e829dee26c1573134a24709d2cb82a3 (diff) | |
download | linux-2153a87ff9ef5537b8a96e7c94a9d79a78c7a30c.tar.xz |
thermal: intel: intel_pch: Drop struct board_info
Because the only member of struct board_info is the name, the
board_info[] array of struct board_info elements can be replaced with
an array of strings.
Modify the code accordingly and drop struct board_info.
No intentional functional impact.
Suggested-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Tested-by: Zhang Rui <rui.zhang@intel.com>
Reviewed-by: Zhang Rui <rui.zhang@intel.com>
Diffstat (limited to 'drivers/thermal/intel')
-rw-r--r-- | drivers/thermal/intel/intel_pch_thermal.c | 42 |
1 files changed, 13 insertions, 29 deletions
diff --git a/drivers/thermal/intel/intel_pch_thermal.c b/drivers/thermal/intel/intel_pch_thermal.c index 12600bca89b6..b855d031a855 100644 --- a/drivers/thermal/intel/intel_pch_thermal.c +++ b/drivers/thermal/intel/intel_pch_thermal.c @@ -145,37 +145,20 @@ enum pch_board_ids { PCH_BOARD_WBG, }; -static const struct board_info { - const char *name; -} board_info[] = { - [PCH_BOARD_HSW] = { - .name = "pch_haswell", - }, - [PCH_BOARD_WPT] = { - .name = "pch_wildcat_point", - }, - [PCH_BOARD_SKL] = { - .name = "pch_skylake", - }, - [PCH_BOARD_CNL] = { - .name = "pch_cannonlake", - }, - [PCH_BOARD_CML] = { - .name = "pch_cometlake", - }, - [PCH_BOARD_LWB] = { - .name = "pch_lewisburg", - }, - [PCH_BOARD_WBG] = { - .name = "pch_wellsburg", - }, +static const char *board_names[] = { + [PCH_BOARD_HSW] = "pch_haswell", + [PCH_BOARD_WPT] = "pch_wildcat_point", + [PCH_BOARD_SKL] = "pch_skylake", + [PCH_BOARD_CNL] = "pch_cannonlake", + [PCH_BOARD_CML] = "pch_cometlake", + [PCH_BOARD_LWB] = "pch_lewisburg", + [PCH_BOARD_WBG] = "pch_wellsburg", }; static int intel_pch_thermal_probe(struct pci_dev *pdev, const struct pci_device_id *id) { enum pch_board_ids board_id = id->driver_data; - const struct board_info *bi = &board_info[board_id]; struct pch_thermal_device *ptd; int nr_trips = 0; u16 trip_temp; @@ -249,12 +232,13 @@ read_trips: nr_trips += pch_wpt_add_acpi_psv_trip(ptd, nr_trips); - ptd->tzd = thermal_zone_device_register_with_trips(bi->name, ptd->trips, - nr_trips, 0, ptd, - &tzd_ops, NULL, 0, 0); + ptd->tzd = thermal_zone_device_register_with_trips(board_names[board_id], + ptd->trips, nr_trips, + 0, ptd, &tzd_ops, + NULL, 0, 0); if (IS_ERR(ptd->tzd)) { dev_err(&pdev->dev, "Failed to register thermal zone %s\n", - bi->name); + board_names[board_id]); err = PTR_ERR(ptd->tzd); goto error_cleanup; } |