[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221102152915.22995-2-andriy.shevchenko@linux.intel.com>
Date: Wed, 2 Nov 2022 17:29:15 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: Mika Westerberg <mika.westerberg@...ux.intel.com>,
Andy Shevchenko <andy@...nel.org>,
Linus Walleij <linus.walleij@...aro.org>
Subject: [PATCH v1 2/2] pinctrl: merrifield: Use temporary variable for struct device
Use temporary variable for struct device to make code neater.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
---
drivers/pinctrl/intel/pinctrl-merrifield.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/drivers/pinctrl/intel/pinctrl-merrifield.c b/drivers/pinctrl/intel/pinctrl-merrifield.c
index 527957ea35b7..c0845bb1e9e3 100644
--- a/drivers/pinctrl/intel/pinctrl-merrifield.c
+++ b/drivers/pinctrl/intel/pinctrl-merrifield.c
@@ -897,17 +897,18 @@ static const struct pinctrl_desc mrfld_pinctrl_desc = {
static int mrfld_pinctrl_probe(struct platform_device *pdev)
{
+ struct device *dev = &pdev->dev;
struct mrfld_family *families;
struct mrfld_pinctrl *mp;
void __iomem *regs;
size_t nfamilies;
unsigned int i;
- mp = devm_kzalloc(&pdev->dev, sizeof(*mp), GFP_KERNEL);
+ mp = devm_kzalloc(dev, sizeof(*mp), GFP_KERNEL);
if (!mp)
return -ENOMEM;
- mp->dev = &pdev->dev;
+ mp->dev = dev;
raw_spin_lock_init(&mp->lock);
regs = devm_platform_ioremap_resource(pdev, 0);
@@ -919,9 +920,7 @@ static int mrfld_pinctrl_probe(struct platform_device *pdev)
* to the registers.
*/
nfamilies = ARRAY_SIZE(mrfld_families),
- families = devm_kmemdup(&pdev->dev, mrfld_families,
- sizeof(mrfld_families),
- GFP_KERNEL);
+ families = devm_kmemdup(dev, mrfld_families, sizeof(mrfld_families), GFP_KERNEL);
if (!families)
return -ENOMEM;
@@ -939,13 +938,13 @@ static int mrfld_pinctrl_probe(struct platform_device *pdev)
mp->groups = mrfld_groups;
mp->ngroups = ARRAY_SIZE(mrfld_groups);
mp->pctldesc = mrfld_pinctrl_desc;
- mp->pctldesc.name = dev_name(&pdev->dev);
+ mp->pctldesc.name = dev_name(dev);
mp->pctldesc.pins = mrfld_pins;
mp->pctldesc.npins = ARRAY_SIZE(mrfld_pins);
- mp->pctldev = devm_pinctrl_register(&pdev->dev, &mp->pctldesc, mp);
+ mp->pctldev = devm_pinctrl_register(dev, &mp->pctldesc, mp);
if (IS_ERR(mp->pctldev)) {
- dev_err(&pdev->dev, "failed to register pinctrl driver\n");
+ dev_err(dev, "failed to register pinctrl driver\n");
return PTR_ERR(mp->pctldev);
}
--
2.35.1
Powered by blists - more mailing lists