From: Ding Xiang <dingxiang@cmss.chinamobile.com>
To: broonie@kernel.org
Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] spi: remove redundant put_device
Date: Wed, 17 Jul 2019 18:05:44 +0800 [thread overview]
Message-ID: <1563357944-24496-1-git-send-email-dingxiang@cmss.chinamobile.com> (raw)
device_unregister will call put_device,
so remove the redundant put_device
Signed-off-by: Ding Xiang <dingxiang@cmss.chinamobile.com>
---
drivers/spi/spi.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 75ac046..d753689 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -2133,11 +2133,9 @@ static ssize_t spi_slave_store(struct device *dev,
return -EINVAL;
child = device_find_child(&ctlr->dev, NULL, match_true);
- if (child) {
+ if (child)
/* Remove registered slave */
device_unregister(child);
- put_device(child);
- }
if (strcmp(name, "(null)")) {
/* Register new slave */
--
1.9.1
next reply other threads:[~2019-07-17 10:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-17 10:05 Ding Xiang [this message]
2019-07-17 11:11 ` [PATCH] spi: remove redundant put_device Mark Brown
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=1563357944-24496-1-git-send-email-dingxiang@cmss.chinamobile.com \
--to=dingxiang@cmss.chinamobile.com \
--cc=broonie@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.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).