LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Pan <pppeterpppan@gmail.com>
To: Scott Wood <scottwood@freescale.com>
Cc: linuxppc-dev@lists.ozlabs.org
Subject: something gets odd when I set the mtd.dev.parent
Date: Tue, 2 Mar 2010 10:20:26 +0800	[thread overview]
Message-ID: <48abf2c21003011820k4e259734ma5b1d0fd79fc4af9@mail.gmail.com> (raw)

2010/2/27 Peter Pan <pppeterpppan@gmail.com>:
> 2010/2/27 Scott Wood <scottwood@freescale.com>:
>> On Fri, Feb 26, 2010 at 10:08:09AM +0800, Peter Pan wrote:
>> There isn't one. =A0I was not under the impression that such a configura=
tion
>> was even possible (how do you control ALE/CLE, for example?). =A0There i=
s a
>> NAND driver that uses UPM, though -- perhaps you could use that?
>>
>> How specifically is NAND connected to the SoC on your board? =A0What abo=
ut it
>> suggests GPCM?
>>
>> -Scott
>>

We use Address A20 and A21 connect to ALE and CLE, the data bus is
connected through a buffer.
The RE is OE AND with CS. the WE is PBS0 AND with CS. CE pin is
connect to ground. It works
fine in VxWorks. And also in our previous Linux version 2.6.22.

Now, I get a odd problem. My GPCM Nand flash driver is mostly copied
from fsl_upm.c. In the fun_probe
function, I have printed out the of_device pointer status as follows:
ofdev=3D 0xcf851ca0
ofdev->dev=3D 0xcf851cb0
ofdev->dev.class=3D 0xcf851d50

Then I set the &ofdev->dev to mtd.dev.parent using
fun->mtd.dev.parent =3D &ofdev->dev;

Then I print out the values:
fun->mtd.dev.parent=3D 0xcf851cb0
fun->mtd.dev.parent->class=3D 0x0

The parent pointer is identical, but the class member is NULL, which
makes the access of NULL pointer oops
later.

I'm wondering why this could happen. The pointer points at the same
address, shouldn't all the members be the
same?

             reply	other threads:[~2010-03-02  2:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-02  2:20 Peter Pan [this message]
2010-03-02  3:18 ` something gets odd when I set the mtd.dev.parent Peter Pan

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=48abf2c21003011820k4e259734ma5b1d0fd79fc4af9@mail.gmail.com \
    --to=pppeterpppan@gmail.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=scottwood@freescale.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