From: Lizhe <sensor1010@163.com>
To: linus.walleij@linaro.org, orsonzhai@gmail.com,
baolin.wang@linux.alibaba.com, zhang.lyra@gmail.com,
andriy.shevchenko@linux.intel.com, sensor1010@163.com
Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] pinctrl:sprd: Check if the pinctrl_dev still exists
Date: Sun, 30 Apr 2023 12:22:54 +0800 [thread overview]
Message-ID: <20230430042254.7543-1-sensor1010@163.com> (raw)
to check if the pinctrl_dev still exists before calling
pinctrl_unregister().
Signed-off-by: Lizhe <sensor1010@163.com>
---
drivers/pinctrl/sprd/pinctrl-sprd.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/pinctrl/sprd/pinctrl-sprd.c b/drivers/pinctrl/sprd/pinctrl-sprd.c
index ca9659f4e4b1..6f3369130e8a 100644
--- a/drivers/pinctrl/sprd/pinctrl-sprd.c
+++ b/drivers/pinctrl/sprd/pinctrl-sprd.c
@@ -1115,7 +1115,9 @@ int sprd_pinctrl_remove(struct platform_device *pdev)
{
struct sprd_pinctrl *sprd_pctl = platform_get_drvdata(pdev);
- pinctrl_unregister(sprd_pctl->pctl);
+ if (sprd_pctl->dev)
+ pinctrl_unregister(sprd_pctl->pctl);
+
return 0;
}
EXPORT_SYMBOL_GPL(sprd_pinctrl_remove);
--
2.34.1
next reply other threads:[~2023-04-30 4:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-30 4:22 Lizhe [this message]
2023-04-30 9:43 ` [PATCH] pinctrl:sprd: Check if the pinctrl_dev still exists andy.shevchenko
-- strict thread matches above, loose matches on Subject: below --
2023-04-30 14:01 Lizhe
2023-04-30 19:18 ` andy.shevchenko
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=20230430042254.7543-1-sensor1010@163.com \
--to=sensor1010@163.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=baolin.wang@linux.alibaba.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=orsonzhai@gmail.com \
--cc=zhang.lyra@gmail.com \
/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).