Skip to content

Commit ba3ea04

Browse files
andy-shevlag-linaro
authored andcommitted
mfd: intel_soc_pmic_bxtwc: Extend use of temporary variable for struct device
Extend use of temporary variable for struct device to make code neater. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Lee Jones <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent d30e2c3 commit ba3ea04

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

drivers/mfd/intel_soc_pmic_bxtwc.c

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -429,19 +429,17 @@ static int bxtwc_probe(struct platform_device *pdev)
429429
{
430430
struct device *dev = &pdev->dev;
431431
int ret;
432-
acpi_handle handle;
433432
acpi_status status;
434433
unsigned long long hrv;
435434
struct intel_soc_pmic *pmic;
436435

437-
handle = ACPI_HANDLE(&pdev->dev);
438-
status = acpi_evaluate_integer(handle, "_HRV", NULL, &hrv);
436+
status = acpi_evaluate_integer(ACPI_HANDLE(dev), "_HRV", NULL, &hrv);
439437
if (ACPI_FAILURE(status))
440438
return dev_err_probe(dev, -ENODEV, "Failed to get PMIC hardware revision\n");
441439
if (hrv != BROXTON_PMIC_WC_HRV)
442440
return dev_err_probe(dev, -ENODEV, "Invalid PMIC hardware revision: %llu\n", hrv);
443441

444-
pmic = devm_kzalloc(&pdev->dev, sizeof(*pmic), GFP_KERNEL);
442+
pmic = devm_kzalloc(dev, sizeof(*pmic), GFP_KERNEL);
445443
if (!pmic)
446444
return -ENOMEM;
447445

@@ -451,18 +449,17 @@ static int bxtwc_probe(struct platform_device *pdev)
451449
pmic->irq = ret;
452450

453451
platform_set_drvdata(pdev, pmic);
454-
pmic->dev = &pdev->dev;
452+
pmic->dev = dev;
455453

456-
pmic->scu = devm_intel_scu_ipc_dev_get(&pdev->dev);
454+
pmic->scu = devm_intel_scu_ipc_dev_get(dev);
457455
if (!pmic->scu)
458456
return -EPROBE_DEFER;
459457

460-
pmic->regmap = devm_regmap_init(&pdev->dev, NULL, pmic,
461-
&bxtwc_regmap_config);
458+
pmic->regmap = devm_regmap_init(dev, NULL, pmic, &bxtwc_regmap_config);
462459
if (IS_ERR(pmic->regmap))
463460
return dev_err_probe(dev, PTR_ERR(pmic->regmap), "Failed to initialise regmap\n");
464461

465-
ret = devm_regmap_add_irq_chip(&pdev->dev, pmic->regmap, pmic->irq,
462+
ret = devm_regmap_add_irq_chip(dev, pmic->regmap, pmic->irq,
466463
IRQF_ONESHOT | IRQF_SHARED,
467464
0, &bxtwc_regmap_irq_chip,
468465
&pmic->irq_chip_data);
@@ -521,8 +518,8 @@ static int bxtwc_probe(struct platform_device *pdev)
521518
if (ret)
522519
return dev_err_probe(dev, ret, "Failed to add CRIT IRQ chip\n");
523520

524-
ret = devm_mfd_add_devices(&pdev->dev, PLATFORM_DEVID_NONE, bxt_wc_dev,
525-
ARRAY_SIZE(bxt_wc_dev), NULL, 0, NULL);
521+
ret = devm_mfd_add_devices(dev, PLATFORM_DEVID_NONE, bxt_wc_dev, ARRAY_SIZE(bxt_wc_dev),
522+
NULL, 0, NULL);
526523
if (ret)
527524
return dev_err_probe(dev, ret, "Failed to add devices\n");
528525

0 commit comments

Comments
 (0)