Commit 9465a984 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Rob Herring

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: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarRob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20220708214539.7254-2-andriy.shevchenko@linux.intel.com
parent 652081b3
......@@ -1620,20 +1620,19 @@ static int unittest_gpio_probe(struct platform_device *pdev)
static int unittest_gpio_remove(struct platform_device *pdev)
{
struct unittest_gpio_dev *gdev = platform_get_drvdata(pdev);
struct unittest_gpio_dev *devptr = platform_get_drvdata(pdev);
struct device *dev = &pdev->dev;
struct device_node *np = pdev->dev.of_node;
dev_dbg(dev, "%s for node @%pOF\n", __func__, np);
dev_dbg(dev, "%s for node @%pfw\n", __func__, devptr->chip.fwnode);
if (!gdev)
if (!devptr)
return -EINVAL;
if (gdev->chip.base != -1)
gpiochip_remove(&gdev->chip);
if (devptr->chip.base != -1)
gpiochip_remove(&devptr->chip);
platform_set_drvdata(pdev, NULL);
kfree(gdev);
kfree(devptr);
return 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment