From: "Rafał Miłecki" <zajec5@gmail.com>
To: Kalle Valo <kvalo@codeaurora.org>, linux-wireless@vger.kernel.org
Cc: "Rafał Miłecki" <rafal@milecki.pl>
Subject: [PATCH fix?] bcma: use (get|put)_device when probing/removing device driver
Date: Sat, 28 Jan 2017 14:31:22 +0100 [thread overview]
Message-ID: <20170128133122.12360-1-zajec5@gmail.com> (raw)
From: Rafał Miłecki <rafal@milecki.pl>
This allows tracking device state and e.g. makes devm work as expected.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Cc: Stable <stable@vger.kernel.org>
---
Kalle: this issue is in bcma since /ever/, so I'm Cc-ing stable without
pointing any version.
If someone reviewes (you or anyone) you may consider taking it as 3.10 fix.
Can someone confirm this patch is OK?
---
drivers/bcma/main.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c
index 2c1798e38abd..38688236b3cd 100644
--- a/drivers/bcma/main.c
+++ b/drivers/bcma/main.c
@@ -633,8 +633,11 @@ static int bcma_device_probe(struct device *dev)
drv);
int err = 0;
+ get_device(dev);
if (adrv->probe)
err = adrv->probe(core);
+ if (err)
+ put_device(dev);
return err;
}
@@ -647,6 +650,7 @@ static int bcma_device_remove(struct device *dev)
if (adrv->remove)
adrv->remove(core);
+ put_device(dev);
return 0;
}
--
2.11.0
next reply other threads:[~2017-01-28 13:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-28 13:31 Rafał Miłecki [this message]
2017-01-31 7:15 ` [fix?] bcma: use (get|put)_device when probing/removing device driver Kalle Valo
2017-01-31 7:27 ` Kalle Valo
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=20170128133122.12360-1-zajec5@gmail.com \
--to=zajec5@gmail.com \
--cc=kvalo@codeaurora.org \
--cc=linux-wireless@vger.kernel.org \
--cc=rafal@milecki.pl \
/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).