aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpio
diff options
context:
space:
mode:
authorGravatar Andy Shevchenko <andriy.shevchenko@linux.intel.com> 2023-09-01 16:40:37 +0300
committerGravatar Andy Shevchenko <andriy.shevchenko@linux.intel.com> 2024-04-15 16:12:18 +0300
commit2d485d47560eeb6e73f6db10c99f1dab2fa6e08f (patch)
tree5bf3dab92593d39f9289669306977f3399c93e2d /drivers/gpio
parentgpio: sch: Switch to memory mapped IO accessors (diff)
downloadlinux-2d485d47560eeb6e73f6db10c99f1dab2fa6e08f.tar.gz
linux-2d485d47560eeb6e73f6db10c99f1dab2fa6e08f.tar.bz2
linux-2d485d47560eeb6e73f6db10c99f1dab2fa6e08f.zip
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 <andriy.shevchenko@linux.intel.com>
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/gpio-sch.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/gpio/gpio-sch.c b/drivers/gpio/gpio-sch.c
index 0c765558d03f..ff0341b1222f 100644
--- a/drivers/gpio/gpio-sch.c
+++ b/drivers/gpio/gpio-sch.c
@@ -328,7 +328,7 @@ static int sch_gpio_probe(struct platform_device *pdev)
void __iomem *regs;
int ret;
- sch = devm_kzalloc(&pdev->dev, sizeof(*sch), GFP_KERNEL);
+ sch = devm_kzalloc(dev, sizeof(*sch), GFP_KERNEL);
if (!sch)
return -ENOMEM;
@@ -344,8 +344,8 @@ static int sch_gpio_probe(struct platform_device *pdev)
spin_lock_init(&sch->lock);
sch->chip = sch_gpio_chip;
- sch->chip.label = dev_name(&pdev->dev);
- sch->chip.parent = &pdev->dev;
+ sch->chip.label = dev_name(dev);
+ sch->chip.parent = dev;
switch (pdev->id) {
case PCI_DEVICE_ID_INTEL_SCH_LPC:
@@ -399,9 +399,9 @@ static int sch_gpio_probe(struct platform_device *pdev)
ret = sch_gpio_install_gpe_handler(sch);
if (ret)
- dev_warn(&pdev->dev, "Can't setup GPE, no IRQ support\n");
+ dev_warn(dev, "Can't setup GPE, no IRQ support\n");
- return devm_gpiochip_add_data(&pdev->dev, &sch->chip, sch);
+ return devm_gpiochip_add_data(dev, &sch->chip, sch);
}
static struct platform_driver sch_gpio_driver = {