Skip to content

Commit 8c5a689

Browse files
spandruvadajwrdegoede
authored andcommitted
platform/x86: ISST: Use local variable for auxdev->dev
Define a local variable for &auxdev->dev and use to shorten length of lines. No functional change is done. Signed-off-by: Srinivas Pandruvada <[email protected]> Suggested-by: Andy Shevchenko <[email protected]> Reviewed-by: Ilpo Järvinen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
1 parent c8405cc commit 8c5a689

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -313,12 +313,11 @@ static int sst_add_perf_profiles(struct auxiliary_device *auxdev,
313313
struct tpmi_per_power_domain_info *pd_info,
314314
int levels)
315315
{
316+
struct device *dev = &auxdev->dev;
316317
u64 perf_level_offsets;
317318
int i;
318319

319-
pd_info->perf_levels = devm_kcalloc(&auxdev->dev, levels,
320-
sizeof(struct perf_level),
321-
GFP_KERNEL);
320+
pd_info->perf_levels = devm_kcalloc(dev, levels, sizeof(struct perf_level), GFP_KERNEL);
322321
if (!pd_info->perf_levels)
323322
return 0;
324323

@@ -349,6 +348,7 @@ static int sst_add_perf_profiles(struct auxiliary_device *auxdev,
349348

350349
static int sst_main(struct auxiliary_device *auxdev, struct tpmi_per_power_domain_info *pd_info)
351350
{
351+
struct device *dev = &auxdev->dev;
352352
int i, mask, levels;
353353

354354
*((u64 *)&pd_info->sst_header) = readq(pd_info->sst_base);
@@ -359,13 +359,13 @@ static int sst_main(struct auxiliary_device *auxdev, struct tpmi_per_power_domai
359359
return -ENODEV;
360360

361361
if (TPMI_MAJOR_VERSION(pd_info->sst_header.interface_version) != ISST_MAJOR_VERSION) {
362-
dev_err(&auxdev->dev, "SST: Unsupported major version:%lx\n",
362+
dev_err(dev, "SST: Unsupported major version:%lx\n",
363363
TPMI_MAJOR_VERSION(pd_info->sst_header.interface_version));
364364
return -ENODEV;
365365
}
366366

367367
if (TPMI_MINOR_VERSION(pd_info->sst_header.interface_version) != ISST_MINOR_VERSION)
368-
dev_info(&auxdev->dev, "SST: Ignore: Unsupported minor version:%lx\n",
368+
dev_info(dev, "SST: Ignore: Unsupported minor version:%lx\n",
369369
TPMI_MINOR_VERSION(pd_info->sst_header.interface_version));
370370

371371
/* Read SST CP Header */
@@ -1273,28 +1273,29 @@ int tpmi_sst_dev_add(struct auxiliary_device *auxdev)
12731273
{
12741274
bool read_blocked = 0, write_blocked = 0;
12751275
struct intel_tpmi_plat_info *plat_info;
1276+
struct device *dev = &auxdev->dev;
12761277
struct tpmi_sst_struct *tpmi_sst;
12771278
int i, ret, pkg = 0, inst = 0;
12781279
int num_resources;
12791280

12801281
ret = tpmi_get_feature_status(auxdev, TPMI_ID_SST, &read_blocked, &write_blocked);
12811282
if (ret)
1282-
dev_info(&auxdev->dev, "Can't read feature status: ignoring read/write blocked status\n");
1283+
dev_info(dev, "Can't read feature status: ignoring read/write blocked status\n");
12831284

12841285
if (read_blocked) {
1285-
dev_info(&auxdev->dev, "Firmware has blocked reads, exiting\n");
1286+
dev_info(dev, "Firmware has blocked reads, exiting\n");
12861287
return -ENODEV;
12871288
}
12881289

12891290
plat_info = tpmi_get_platform_data(auxdev);
12901291
if (!plat_info) {
1291-
dev_err(&auxdev->dev, "No platform info\n");
1292+
dev_err(dev, "No platform info\n");
12921293
return -EINVAL;
12931294
}
12941295

12951296
pkg = plat_info->package_id;
12961297
if (pkg >= topology_max_packages()) {
1297-
dev_err(&auxdev->dev, "Invalid package id :%x\n", pkg);
1298+
dev_err(dev, "Invalid package id :%x\n", pkg);
12981299
return -EINVAL;
12991300
}
13001301

@@ -1306,11 +1307,11 @@ int tpmi_sst_dev_add(struct auxiliary_device *auxdev)
13061307
if (!num_resources)
13071308
return -EINVAL;
13081309

1309-
tpmi_sst = devm_kzalloc(&auxdev->dev, sizeof(*tpmi_sst), GFP_KERNEL);
1310+
tpmi_sst = devm_kzalloc(dev, sizeof(*tpmi_sst), GFP_KERNEL);
13101311
if (!tpmi_sst)
13111312
return -ENOMEM;
13121313

1313-
tpmi_sst->power_domain_info = devm_kcalloc(&auxdev->dev, num_resources,
1314+
tpmi_sst->power_domain_info = devm_kcalloc(dev, num_resources,
13141315
sizeof(*tpmi_sst->power_domain_info),
13151316
GFP_KERNEL);
13161317
if (!tpmi_sst->power_domain_info)
@@ -1331,13 +1332,13 @@ int tpmi_sst_dev_add(struct auxiliary_device *auxdev)
13311332
tpmi_sst->power_domain_info[i].power_domain_id = i;
13321333
tpmi_sst->power_domain_info[i].auxdev = auxdev;
13331334
tpmi_sst->power_domain_info[i].write_blocked = write_blocked;
1334-
tpmi_sst->power_domain_info[i].sst_base = devm_ioremap_resource(&auxdev->dev, res);
1335+
tpmi_sst->power_domain_info[i].sst_base = devm_ioremap_resource(dev, res);
13351336
if (IS_ERR(tpmi_sst->power_domain_info[i].sst_base))
13361337
return PTR_ERR(tpmi_sst->power_domain_info[i].sst_base);
13371338

13381339
ret = sst_main(auxdev, &tpmi_sst->power_domain_info[i]);
13391340
if (ret) {
1340-
devm_iounmap(&auxdev->dev, tpmi_sst->power_domain_info[i].sst_base);
1341+
devm_iounmap(dev, tpmi_sst->power_domain_info[i].sst_base);
13411342
tpmi_sst->power_domain_info[i].sst_base = NULL;
13421343
continue;
13431344
}

0 commit comments

Comments
 (0)