linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Kári Davíðsson" <kari.davidsson-zCUwNCi8n9MAvxtiuMwx3w@public.gmane.org>
Cc: "spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org"
	<spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
Subject: [PATCH] mpc52xx-psc-spi: Enumerate child nodes in the OF tree
Date: Tue, 3 Nov 2009 11:43:13 +0000	[thread overview]
Message-ID: <4AF01751.1090806@marel.com> (raw)
In-Reply-To: <fa686aa40911020808n73a898ack5fb66933188555da-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 214 bytes --]

Hello,

I need to apply the following patch in order to get the mpc52xx-psc-spi driver
to instantiate my spi device driver.

This patch is based on 2.6.29 but should apply cleanly to the most recent kernel.

rg
kd

[-- Attachment #2: spi.patch --]
[-- Type: text/x-diff, Size: 1218 bytes --]

Index: drivers/spi/mpc52xx_psc_spi.c
===================================================================
--- drivers/spi/mpc52xx_psc_spi.c	(revision 692)
+++ drivers/spi/mpc52xx_psc_spi.c	(working copy)
@@ -21,6 +21,7 @@
 #include <linux/io.h>
 #include <linux/delay.h>
 #include <linux/spi/spi.h>
+#include <linux/of_spi.h>
 #include <linux/fsl_devices.h>
 
 #include <asm/mpc52xx.h>
@@ -370,9 +371,10 @@
 }
 
 /* bus_num is used only for the case dev->platform_data == NULL */
-static int __init mpc52xx_psc_spi_do_probe(struct device *dev, u32 regaddr,
+static int __init mpc52xx_psc_spi_do_probe(struct of_device *op, u32 regaddr,
 				u32 size, unsigned int irq, s16 bus_num)
 {
+    struct device * dev = &op->dev;
 	struct fsl_spi_platform_data *pdata = dev->platform_data;
 	struct mpc52xx_psc_spi *mps;
 	struct spi_master *master;
@@ -439,6 +441,8 @@
 	if (ret < 0)
 		goto unreg_master;
 
+	of_register_spi_devices(master, op->node);
+
 	return ret;
 
 unreg_master:
@@ -495,7 +499,7 @@
 		id = *psc_nump + 1;
 	}
 
-	return mpc52xx_psc_spi_do_probe(&op->dev, (u32)regaddr64, (u32)size64,
+	return mpc52xx_psc_spi_do_probe(op, (u32)regaddr64, (u32)size64,
 					irq_of_parse_and_map(op->node, 0), id);
 }
 

[-- Attachment #3: Type: text/plain, Size: 399 bytes --]

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference

[-- Attachment #4: Type: text/plain, Size: 210 bytes --]

_______________________________________________
spi-devel-general mailing list
spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/spi-devel-general

  parent reply	other threads:[~2009-11-03 11:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-30 19:44 [PATCH] mpc52xx-psc-spi: refactor probe and remove to make use of of_register_spi_devices() Wolfram Sang
2009-10-31  5:32 ` Stephen Rothwell
2009-10-31  9:03   ` Wolfram Sang
2009-11-01  1:03 ` Grant Likely
2009-11-02 13:14   ` Wolfram Sang
2009-11-02 16:08     ` Grant Likely
     [not found]       ` <fa686aa40911020808n73a898ack5fb66933188555da-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-11-03 11:43         ` Kári Davíðsson [this message]
     [not found]           ` <4AF01751.1090806-zCUwNCi8n9MAvxtiuMwx3w@public.gmane.org>
2009-11-03 13:05             ` [PATCH] mpc52xx-psc-spi: Enumerate child nodes in the OF tree Wolfram Sang
     [not found]               ` <20091103130515.GS3571-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2009-11-03 13:47                 ` Grant Likely

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=4AF01751.1090806@marel.com \
    --to=kari.davidsson-zcuwnci8n9mavxtiumwx3w@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).