linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anatolij Gustschin <agust-ynQEQJNshbs@public.gmane.org>
To: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Cc: David Brownell
	<dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>,
	Anatolij Gustschin <agust-ynQEQJNshbs@public.gmane.org>
Subject: [PATCH] spi/mpc5121: register spi child devices of spi node
Date: Tue, 27 Jul 2010 00:59:38 +0200	[thread overview]
Message-ID: <1280185178-5002-1-git-send-email-agust@denx.de> (raw)

Signed-off-by: Anatolij Gustschin <agust-ynQEQJNshbs@public.gmane.org>
---
 drivers/spi/mpc512x_psc_spi.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/drivers/spi/mpc512x_psc_spi.c b/drivers/spi/mpc512x_psc_spi.c
index c8d69fc..39e5faf 100644
--- a/drivers/spi/mpc512x_psc_spi.c
+++ b/drivers/spi/mpc512x_psc_spi.c
@@ -27,6 +27,7 @@
 #include <linux/clk.h>
 #include <linux/spi/spi.h>
 #include <linux/fsl_devices.h>
+#include <linux/of_spi.h>
 #include <asm/mpc52xx_psc.h>
 
 struct mpc512x_psc_spi {
@@ -511,6 +512,7 @@ static int __devinit mpc512x_psc_spi_of_probe(struct of_device *op,
 	const u32 *regaddr_p;
 	u64 regaddr64, size64;
 	s16 id = -1;
+	int ret;
 
 	regaddr_p = of_get_address(op->dev.of_node, 0, &size64, NULL);
 	if (!regaddr_p) {
@@ -533,8 +535,14 @@ static int __devinit mpc512x_psc_spi_of_probe(struct of_device *op,
 		id = *psc_nump;
 	}
 
-	return mpc512x_psc_spi_do_probe(&op->dev, (u32) regaddr64, (u32) size64,
+	ret = mpc512x_psc_spi_do_probe(&op->dev, (u32) regaddr64, (u32) size64,
 				irq_of_parse_and_map(op->dev.of_node, 0), id);
+
+	if (!ret)
+		of_register_spi_devices(dev_get_drvdata(&op->dev),
+					op->dev.of_node);
+
+	return ret;
 }
 
 static int __devexit mpc512x_psc_spi_of_remove(struct of_device *op)
-- 
1.7.0.4


------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share 
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/

             reply	other threads:[~2010-07-26 22:59 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-26 22:59 Anatolij Gustschin [this message]
     [not found] ` <1280185178-5002-1-git-send-email-agust-ynQEQJNshbs@public.gmane.org>
2010-07-27  6:17   ` [PATCH] spi/mpc5121: register spi child devices of spi node Baruch Siach
     [not found]     ` <20100727061744.GB22765-X57xyCW21FZ5l4KbKkTfamZHpeb/A1Y/@public.gmane.org>
2010-07-27  6:21       ` Grant Likely
2010-07-27  6:28       ` David Brownell
     [not found]         ` <298403.16600.qm-g47maUHHHF9+W+z1sZEpBPu2YVrzzGjVVpNB7YpNyf8@public.gmane.org>
2010-07-27  6:37           ` Grant Likely
     [not found]             ` <AANLkTik9GYDGi3jnMdPdyOa6sFv4bo_+4b-RWMq7nW6x-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-07-27  6:47               ` David Brownell
2010-07-27 13:39               ` [PATCH] of/spi: call of_register_spi_devices() from spi core code Anatolij Gustschin
     [not found]                 ` <1280237967-2460-1-git-send-email-agust-ynQEQJNshbs@public.gmane.org>
2010-07-27 17:40                   ` Grant Likely
     [not found]                     ` <AANLkTimG+QLksWVbQ63F=Bc1h-9946J1RO0qSavBAegO-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-07-27 20:35                       ` [PATCH v2] " Anatolij Gustschin
2010-07-27  7:14           ` [PATCH] spi/mpc5121: register spi child devices of spi node Feng Tang
2010-07-27  7:00             ` Grant Likely
     [not found]               ` <AANLkTikZ4MMqmM3jn8yh49kh5+qOh2nmaYDVBOYhbo-K-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-07-27  7:27                 ` Feng Tang
2010-07-27  7:18                   ` David Brownell
2010-07-27  7:07             ` David Brownell
     [not found]               ` <793633.1143.qm-4JhmkcZgSkk/JfqJOfUXs/u2YVrzzGjVVpNB7YpNyf8@public.gmane.org>
2010-07-27  7:33                 ` Feng Tang
2010-07-27  7:27                   ` David Brownell
     [not found]                     ` <200077.42951.qm-g47maUHHHF8P4eY3Ra60wvu2YVrzzGjVVpNB7YpNyf8@public.gmane.org>
2010-07-27  7:52                       ` Feng Tang
2010-07-27  7:44                         ` David Brownell
     [not found]                           ` <395617.66036.qm-g47maUHHHF/6X00i2u5GFvu2YVrzzGjVVpNB7YpNyf8@public.gmane.org>
2010-07-27  8:07                             ` Feng Tang

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=1280185178-5002-1-git-send-email-agust@denx.de \
    --to=agust-ynqeqjnshbs@public.gmane.org \
    --cc=dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@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).