mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	linux-kernel@vger.kernel.org
Cc: Andy Shevchenko <andy@kernel.org>, Lee Jones <lee.jones@linaro.org>
Subject: [PATCH v1 05/11] mfd: intel_soc_pmic_bxtwc: Extend use of temporary variable for struct device
Date: Thu, 16 Jun 2022 19:58:17 +0300	[thread overview]
Message-ID: <20220616165823.4919-5-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20220616165823.4919-1-andriy.shevchenko@linux.intel.com>

Extend use of temporary variable for struct device to make code neater.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/mfd/intel_soc_pmic_bxtwc.c | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c
index 576fe55bd4d4..a211c70d532b 100644
--- a/drivers/mfd/intel_soc_pmic_bxtwc.c
+++ b/drivers/mfd/intel_soc_pmic_bxtwc.c
@@ -431,19 +431,17 @@ static int bxtwc_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
 	int ret;
-	acpi_handle handle;
 	acpi_status status;
 	unsigned long long hrv;
 	struct intel_soc_pmic *pmic;
 
-	handle = ACPI_HANDLE(&pdev->dev);
-	status = acpi_evaluate_integer(handle, "_HRV", NULL, &hrv);
+	status = acpi_evaluate_integer(ACPI_HANDLE(dev), "_HRV", NULL, &hrv);
 	if (ACPI_FAILURE(status))
 		return dev_err_probe(dev, -ENODEV, "Failed to get PMIC hardware revision\n");
 	if (hrv != BROXTON_PMIC_WC_HRV)
 		return dev_err_probe(dev, -ENODEV, "Invalid PMIC hardware revision: %llu\n", hrv);
 
-	pmic = devm_kzalloc(&pdev->dev, sizeof(*pmic), GFP_KERNEL);
+	pmic = devm_kzalloc(dev, sizeof(*pmic), GFP_KERNEL);
 	if (!pmic)
 		return -ENOMEM;
 
@@ -453,18 +451,17 @@ static int bxtwc_probe(struct platform_device *pdev)
 	pmic->irq = ret;
 
 	platform_set_drvdata(pdev, pmic);
-	pmic->dev = &pdev->dev;
+	pmic->dev = dev;
 
-	pmic->scu = devm_intel_scu_ipc_dev_get(&pdev->dev);
+	pmic->scu = devm_intel_scu_ipc_dev_get(dev);
 	if (!pmic->scu)
 		return -EPROBE_DEFER;
 
-	pmic->regmap = devm_regmap_init(&pdev->dev, NULL, pmic,
-					&bxtwc_regmap_config);
+	pmic->regmap = devm_regmap_init(dev, NULL, pmic, &bxtwc_regmap_config);
 	if (IS_ERR(pmic->regmap))
 		return dev_err_probe(dev, PTR_ERR(pmic->regmap), "Failed to initialise regmap\n");
 
-	ret = devm_regmap_add_irq_chip(&pdev->dev, pmic->regmap, pmic->irq,
+	ret = devm_regmap_add_irq_chip(dev, pmic->regmap, pmic->irq,
 				       IRQF_ONESHOT | IRQF_SHARED,
 				       0, &bxtwc_regmap_irq_chip,
 				       &pmic->irq_chip_data);
@@ -523,8 +520,8 @@ static int bxtwc_probe(struct platform_device *pdev)
 	if (ret)
 		return dev_err_probe(dev, ret, "Failed to add CRIT IRQ chip\n");
 
-	ret = devm_mfd_add_devices(&pdev->dev, PLATFORM_DEVID_NONE, bxt_wc_dev,
-				   ARRAY_SIZE(bxt_wc_dev), NULL, 0, NULL);
+	ret = devm_mfd_add_devices(dev, PLATFORM_DEVID_NONE, bxt_wc_dev, ARRAY_SIZE(bxt_wc_dev),
+				   NULL, 0, NULL);
 	if (ret)
 		return dev_err_probe(dev, ret, "Failed to add devices\n");
 
-- 
2.35.1


  parent reply	other threads:[~2022-06-16 16:59 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-16 16:58 [PATCH v1 01/11] mfd: intel_soc_pmic_bxtwc: Don't shadow error codes in show()/store() Andy Shevchenko
2022-06-16 16:58 ` [PATCH v1 02/11] mfd: intel_soc_pmic_bxtwc: Create sysfs attributes using core driver's facility Andy Shevchenko
2022-06-27  9:07   ` Lee Jones
2022-06-16 16:58 ` [PATCH v1 03/11] mfd: intel_soc_pmic_bxtwc: Convert to use platform_get/set_drvdata() Andy Shevchenko
2022-06-27  9:08   ` Lee Jones
2022-06-16 16:58 ` [PATCH v1 04/11] mfd: intel_soc_pmic_bxtwc: Use dev_err_probe() Andy Shevchenko
2022-06-27  9:22   ` Lee Jones
2022-06-16 16:58 ` Andy Shevchenko [this message]
2022-06-27  9:27   ` [PATCH v1 05/11] mfd: intel_soc_pmic_bxtwc: Extend use of temporary variable for struct device Lee Jones
2022-06-16 16:58 ` [PATCH v1 06/11] mfd: intel_soc_pmic_bxtwc: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc Andy Shevchenko
2022-06-27  9:27   ` Lee Jones
2022-06-16 16:58 ` [PATCH v1 07/11] mfd: intel_soc_pmic_bxtwc: Drop redundant ACPI_PTR() Andy Shevchenko
2022-06-27  9:28   ` Lee Jones
2022-06-16 16:58 ` [PATCH v1 08/11] mfd: intel_soc_pmic_bxtwc: Use bits.h macros for all masks Andy Shevchenko
2022-06-27  9:30   ` Lee Jones
2022-06-16 16:58 ` [PATCH v1 09/11] mfd: intel_soc_pmic_bxtwc: Use sysfs_emit() instead of sprintf() Andy Shevchenko
2022-06-27  9:30   ` Lee Jones
2022-06-16 16:58 ` [PATCH v1 10/11] mfd: intel_soc_pmic_bxtwc: Drop unneeded casting Andy Shevchenko
2022-06-27  9:31   ` Lee Jones
2022-06-16 16:58 ` [PATCH v1 11/11] mfd: intel_soc_pmic_bxtwc: Fix spelling in the comment Andy Shevchenko
2022-06-27  9:33   ` Lee Jones
2022-06-28  9:38     ` Andy Shevchenko
2022-06-28  9:56       ` Lee Jones
2022-06-28 10:36         ` Andy Shevchenko
2022-06-27  9:05 ` [PATCH v1 01/11] mfd: intel_soc_pmic_bxtwc: Don't shadow error codes in show()/store() Lee Jones
2022-06-28  9:45   ` Andy Shevchenko
2022-06-28  9:47     ` Lee Jones
2022-06-28 10:38       ` Andy Shevchenko
2022-06-29 14:34         ` Lee Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220616165823.4919-5-andriy.shevchenko@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=andy@kernel.org \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome