From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Rob Herring <robh@kernel.org>,
Frank Rowand <frank.rowand@sony.com>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-gpio@vger.kernel.org
Cc: Rob Herring <robh+dt@kernel.org>,
Frank Rowand <frowand.list@gmail.com>,
Linus Walleij <linus.walleij@linaro.org>,
Bartosz Golaszewski <brgl@bgdev.pl>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: [PATCH v4 2/2] of: unittest: make unittest_gpio_remove() consistent with unittest_gpio_probe()
Date: Sat, 9 Jul 2022 00:45:39 +0300 [thread overview]
Message-ID: <20220708214539.7254-2-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20220708214539.7254-1-andriy.shevchenko@linux.intel.com>
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>
---
v2: no changes
drivers/of/unittest.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c
index 5a842dfc27e8..eafa8ffefbd0 100644
--- a/drivers/of/unittest.c
+++ b/drivers/of/unittest.c
@@ -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;
}
--
2.35.1
next prev parent reply other threads:[~2022-07-08 21:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-08 21:45 [PATCH v4 1/2] of: unittest: Switch to use fwnode instead of of_node Andy Shevchenko
2022-07-08 21:45 ` Andy Shevchenko [this message]
2022-07-11 23:08 ` [PATCH v4 2/2] of: unittest: make unittest_gpio_remove() consistent with unittest_gpio_probe() Rob Herring
2022-07-11 23:08 ` [PATCH v4 1/2] of: unittest: Switch to use fwnode instead of of_node Rob Herring
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220708214539.7254-2-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=brgl@bgdev.pl \
--cc=devicetree@vger.kernel.org \
--cc=frank.rowand@sony.com \
--cc=frowand.list@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh+dt@kernel.org \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).