From: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
To: Laurent Pinchart
<laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>
Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: [PATCH v2] spi: Fix device unregistration when unregistering the bus master
Date: Tue, 13 Dec 2011 16:45:20 -0700 [thread overview]
Message-ID: <20111213234520.GA24922@ponder.secretlab.ca> (raw)
In-Reply-To: <1323648906-24863-1-git-send-email-laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>
On Mon, Dec 12, 2011 at 01:15:06AM +0100, Laurent Pinchart wrote:
> Device are added as children of the bus master's parent device, but
> spi_unregister_master() looks for devices to unregister in the bus
> master's children. This results in the child devices not being
> unregistered.
>
> Fix this by registering devices as direct children of the bus master.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>
> ---
> drivers/spi/spi.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
> index 2e13a14..b423fe9 100644
> --- a/drivers/spi/spi.c
> +++ b/drivers/spi/spi.c
> @@ -318,7 +318,7 @@ struct spi_device *spi_alloc_device(struct spi_master *master)
> }
>
> spi->master = master;
> - spi->dev.parent = dev;
> + spi->dev.parent = &master->dev;
> spi->dev.bus = &spi_bus_type;
> spi->dev.release = spidev_release;
> device_initialize(&spi->dev);
Yes, I agree and I think this is the correct fix. However, I'd like
to make sure it behaves correctly. Can you test and confirm that
with this patch in place and an spi_device in use (bound to a driver)
that the kernel will either refuse to unbind the driver, or correctly
release the spi_driver from the spi_device?
Thanks,
g.
------------------------------------------------------------------------------
Cloud Computing - Latest Buzzword or a Glimpse of the Future?
This paper surveys cloud computing today: What are the benefits?
Why are businesses embracing it? What are its payoffs and pitfalls?
http://www.accelacomm.com/jaw/sdnl/114/51425149/
next prev parent reply other threads:[~2011-12-13 23:45 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-28 13:23 [PATCH/RFC] spi: Fix device unregistration when unregistering the bus master Laurent Pinchart
[not found] ` <1322486604-27808-1-git-send-email-laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>
2011-12-02 12:14 ` Linus Walleij
[not found] ` <CACRpkdZf0pcdJyh2Th=KbrcCa=D-aqCiMCNoCmPGQo3iFZpsdg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-12-06 16:22 ` Laurent Pinchart
[not found] ` <201112061722.48910.laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>
2011-12-06 19:32 ` Linus Walleij
[not found] ` <CACRpkda685p+fe_P5Ww=4Qtup6qmCe_oqiwTqN+KAaAktPNKFw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-12-12 0:15 ` [PATCH v2] " Laurent Pinchart
[not found] ` <1323648906-24863-1-git-send-email-laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>
2011-12-13 22:10 ` Linus Walleij
2011-12-13 23:45 ` Grant Likely [this message]
[not found] ` <20111213234520.GA24922-e0URQFbLeQY2iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
2011-12-16 16:52 ` Laurent Pinchart
[not found] ` <201112161752.05318.laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>
2011-12-16 16:59 ` Grant Likely
[not found] ` <CACxGe6tYCNdfj7BeHt-801M01=3Lk4LVfR91z6Pyfiq+LqXiJA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-12-16 17:18 ` Laurent Pinchart
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=20111213234520.GA24922@ponder.secretlab.ca \
--to=grant.likely-s3s/wqlpoipyb63q8fvjnq@public.gmane.org \
--cc=laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org \
--cc=spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.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).