Skip to content

Commit 2153a87

Browse files
committed
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 <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]> Acked-by: Daniel Lezcano <[email protected]> Tested-by: Zhang Rui <[email protected]> Reviewed-by: Zhang Rui <[email protected]>
1 parent ae98e57 commit 2153a87

File tree

1 file changed

+13
-29
lines changed

1 file changed

+13
-29
lines changed

drivers/thermal/intel/intel_pch_thermal.c

Lines changed: 13 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -145,37 +145,20 @@ enum pch_board_ids {
145145
PCH_BOARD_WBG,
146146
};
147147

148-
static const struct board_info {
149-
const char *name;
150-
} board_info[] = {
151-
[PCH_BOARD_HSW] = {
152-
.name = "pch_haswell",
153-
},
154-
[PCH_BOARD_WPT] = {
155-
.name = "pch_wildcat_point",
156-
},
157-
[PCH_BOARD_SKL] = {
158-
.name = "pch_skylake",
159-
},
160-
[PCH_BOARD_CNL] = {
161-
.name = "pch_cannonlake",
162-
},
163-
[PCH_BOARD_CML] = {
164-
.name = "pch_cometlake",
165-
},
166-
[PCH_BOARD_LWB] = {
167-
.name = "pch_lewisburg",
168-
},
169-
[PCH_BOARD_WBG] = {
170-
.name = "pch_wellsburg",
171-
},
148+
static const char *board_names[] = {
149+
[PCH_BOARD_HSW] = "pch_haswell",
150+
[PCH_BOARD_WPT] = "pch_wildcat_point",
151+
[PCH_BOARD_SKL] = "pch_skylake",
152+
[PCH_BOARD_CNL] = "pch_cannonlake",
153+
[PCH_BOARD_CML] = "pch_cometlake",
154+
[PCH_BOARD_LWB] = "pch_lewisburg",
155+
[PCH_BOARD_WBG] = "pch_wellsburg",
172156
};
173157

174158
static int intel_pch_thermal_probe(struct pci_dev *pdev,
175159
const struct pci_device_id *id)
176160
{
177161
enum pch_board_ids board_id = id->driver_data;
178-
const struct board_info *bi = &board_info[board_id];
179162
struct pch_thermal_device *ptd;
180163
int nr_trips = 0;
181164
u16 trip_temp;
@@ -249,12 +232,13 @@ static int intel_pch_thermal_probe(struct pci_dev *pdev,
249232

250233
nr_trips += pch_wpt_add_acpi_psv_trip(ptd, nr_trips);
251234

252-
ptd->tzd = thermal_zone_device_register_with_trips(bi->name, ptd->trips,
253-
nr_trips, 0, ptd,
254-
&tzd_ops, NULL, 0, 0);
235+
ptd->tzd = thermal_zone_device_register_with_trips(board_names[board_id],
236+
ptd->trips, nr_trips,
237+
0, ptd, &tzd_ops,
238+
NULL, 0, 0);
255239
if (IS_ERR(ptd->tzd)) {
256240
dev_err(&pdev->dev, "Failed to register thermal zone %s\n",
257-
bi->name);
241+
board_names[board_id]);
258242
err = PTR_ERR(ptd->tzd);
259243
goto error_cleanup;
260244
}

0 commit comments

Comments
 (0)