linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Ng <daniel.ng1234@gmail.com>
To: "Stepanov, Sergej" <Sergej.Stepanov@ids.de>
Cc: "linuxppc-dev@ozlabs.org" <linuxppc-dev@ozlabs.org>
Subject: Re: spidev.c driver on the ppc8247 (kernel 2.6.27.19)
Date: Fri, 20 Mar 2009 12:19:54 +1100	[thread overview]
Message-ID: <547eba1b0903191819v5b03d38ci7a60839873e5bd66@mail.gmail.com> (raw)
In-Reply-To: <547eba1b0903190132pfd11ad5ld4b1bffb6dc22758@mail.gmail.com>

On Thu, Mar 19, 2009 at 7:32 PM, Daniel Ng <daniel.ng1234@gmail.com> wrote:
>
> So, I tried to call spidev_probe() directly from the probe() function
> of my SPI Controller driver. However in this case spidev_probe()
> failed because its call to device_create_drvdata() failed with error
> code ENODEV. Why would this be?
>
> This is how I make the call from my SPI Controller driver:
>
> spidev_probe(to_spi_device(&ofdev->dev));
>
> And this is the relevant code in spidev_probe():
>
> dev =3D device_create_drvdata(spidev_class, &spi->dev, spidev->devt,
> spidev, "spidev%d.%d",
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /*spi->master=
->bus_num*/0, spi->chip_select);

It looks like spidev_class was uninitialised because spidev_init() had
not yet been called. To force spidev_init() to be called before my SPI
Controller's driver initialisation, I just used:

subsys_initcall(spidev_init);

This seems to do the job...

  reply	other threads:[~2009-03-20  1:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-18  7:36 spidev.c driver on the ppc8247 (kernel 2.6.27.19) Daniel Ng
2009-03-18  8:30 ` AW: " Stepanov, Sergej
2009-03-19  8:32   ` Daniel Ng
2009-03-20  1:19     ` Daniel Ng [this message]
2009-03-20  9:37       ` AW: " Stepanov, Sergej
2009-03-24  5:05         ` Daniel Ng
2019-06-06 13:14           ` siva krishna
2019-06-06 13:15           ` siva krishna

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=547eba1b0903191819v5b03d38ci7a60839873e5bd66@mail.gmail.com \
    --to=daniel.ng1234@gmail.com \
    --cc=Sergej.Stepanov@ids.de \
    --cc=linuxppc-dev@ozlabs.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).