Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

of: unittest: make unittest_gpio_remove() consistent with unittest_gpio_probe()

On the ->remove() stage the callback uses physical device node instead of one
from GPIO chip and the variable name which is different to one used in
unittest_gpio_probe(). Make these consistent with unittest_gpio_probe().

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20220708214539.7254-2-andriy.shevchenko@linux.intel.com

authored by

Andy Shevchenko and committed by
Rob Herring
9465a984 652081b3

+6 -7
+6 -7
drivers/of/unittest.c
··· 1620 1620 1621 1621 static int unittest_gpio_remove(struct platform_device *pdev) 1622 1622 { 1623 - struct unittest_gpio_dev *gdev = platform_get_drvdata(pdev); 1623 + struct unittest_gpio_dev *devptr = platform_get_drvdata(pdev); 1624 1624 struct device *dev = &pdev->dev; 1625 - struct device_node *np = pdev->dev.of_node; 1626 1625 1627 - dev_dbg(dev, "%s for node @%pOF\n", __func__, np); 1626 + dev_dbg(dev, "%s for node @%pfw\n", __func__, devptr->chip.fwnode); 1628 1627 1629 - if (!gdev) 1628 + if (!devptr) 1630 1629 return -EINVAL; 1631 1630 1632 - if (gdev->chip.base != -1) 1633 - gpiochip_remove(&gdev->chip); 1631 + if (devptr->chip.base != -1) 1632 + gpiochip_remove(&devptr->chip); 1634 1633 1635 1634 platform_set_drvdata(pdev, NULL); 1636 - kfree(gdev); 1635 + kfree(devptr); 1637 1636 1638 1637 return 0; 1639 1638 }