Skip to content

Commit 2d485d4

Browse files
committed
gpio: sch: Utilise temporary variable for struct device
We have a temporary variable to keep a pointer to struct device. Utilise it where it makes sense. Signed-off-by: Andy Shevchenko <[email protected]>
1 parent abaed89 commit 2d485d4

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/gpio/gpio-sch.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ static int sch_gpio_probe(struct platform_device *pdev)
328328
void __iomem *regs;
329329
int ret;
330330

331-
sch = devm_kzalloc(&pdev->dev, sizeof(*sch), GFP_KERNEL);
331+
sch = devm_kzalloc(dev, sizeof(*sch), GFP_KERNEL);
332332
if (!sch)
333333
return -ENOMEM;
334334

@@ -344,8 +344,8 @@ static int sch_gpio_probe(struct platform_device *pdev)
344344

345345
spin_lock_init(&sch->lock);
346346
sch->chip = sch_gpio_chip;
347-
sch->chip.label = dev_name(&pdev->dev);
348-
sch->chip.parent = &pdev->dev;
347+
sch->chip.label = dev_name(dev);
348+
sch->chip.parent = dev;
349349

350350
switch (pdev->id) {
351351
case PCI_DEVICE_ID_INTEL_SCH_LPC:
@@ -399,9 +399,9 @@ static int sch_gpio_probe(struct platform_device *pdev)
399399

400400
ret = sch_gpio_install_gpe_handler(sch);
401401
if (ret)
402-
dev_warn(&pdev->dev, "Can't setup GPE, no IRQ support\n");
402+
dev_warn(dev, "Can't setup GPE, no IRQ support\n");
403403

404-
return devm_gpiochip_add_data(&pdev->dev, &sch->chip, sch);
404+
return devm_gpiochip_add_data(dev, &sch->chip, sch);
405405
}
406406

407407
static struct platform_driver sch_gpio_driver = {

0 commit comments

Comments
 (0)