From: Grant Likely <grant.likely@secretlab.ca>
To: Jun Chen <jun.d.chen@intel.com>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>,
linux-kernel@vger.kernel.org, Bi Chao <chao.bi@intel.com>,
spi-devel-general@lists.sourceforge.net, jun.zhang@intel.com
Subject: Re: [PATCH] spi: Add the flag indicate to registe new device as children of master or not.
Date: Fri, 11 Jan 2013 14:57:54 +0000 [thread overview]
Message-ID: <20130111145754.76BB53E08C3@localhost> (raw)
In-Reply-To: <1356365812.6818.24.camel@chenjun-workstation>
On Mon, 24 Dec 2012 11:16:52 -0500, Jun Chen <jun.d.chen@intel.com> wrote:
> On Fri, 2012-12-21 at 19:06 +0000, Grant Likely wrote:
> > The problem is that I don't understand why this change is necessary.
> > spi_devices should always be children of an spi_master, not siblings.
> > What is the problem you're trying to solve with this change?
> >
> When spi drivers try to use the core function(spi_register_master),it
> will trigger error,because they use the function
> spi_match_master_to_boardinfo to create new spi device as the children
> of the master.
> In the old version of spi core, the new devices are registered as
> siblings of the spi_master. My spi driver based on the old version runs
> normal.
>
> But after applying for this patch:
> {
> spi: Fix device unregistration when unregistering the bus master
>
> 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.
>
>
> - spi->dev.parent = dev;
> + spi->dev.parent = &master->dev;
> }
>
> Then my driver will be crash.
> Maybe I have mistake on this issue, thank for your more explanation and
> detail replay.
Sounds like you've got a driver bug. Make sure it isn't trying to use
the spi_client parent pointer to find the device instance.
g.
prev parent reply other threads:[~2013-01-11 14:57 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-18 16:29 [PATCH] spi: Add the flag indicate to registe new device as children of master or not Jun Chen
2012-12-18 15:26 ` Mark Brown
[not found] ` <20121218152623.GA26077-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2012-12-19 9:44 ` Jun Chen
2012-12-19 9:04 ` Mark Brown
[not found] ` <20121219090416.GK4985-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2012-12-19 16:21 ` Grant Likely
2012-12-21 17:39 ` Jun Chen
2012-12-21 19:06 ` Grant Likely
2012-12-24 16:16 ` Jun Chen
2013-01-11 14:57 ` Grant Likely [this message]
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=20130111145754.76BB53E08C3@localhost \
--to=grant.likely@secretlab.ca \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=chao.bi@intel.com \
--cc=jun.d.chen@intel.com \
--cc=jun.zhang@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=spi-devel-general@lists.sourceforge.net \
/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).