aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/linux/linux-2.6.18/spi-fix-spi-busnum-to-master-buffer-and-bus_num-0.patch
diff options
context:
space:
mode:
authorDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
committerDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
commit709c4d66e0b107ca606941b988bad717c0b45d9b (patch)
tree37ee08b1eb308f3b2b6426d5793545c38396b838 /recipes/linux/linux-2.6.18/spi-fix-spi-busnum-to-master-buffer-and-bus_num-0.patch
parentfa6cd5a3b993f16c27de4ff82b42684516d433ba (diff)
downloadopenembedded-709c4d66e0b107ca606941b988bad717c0b45d9b.tar.gz
rename packages/ to recipes/ per earlier agreement
See links below for more details: http://thread.gmane.org/gmane.comp.handhelds.openembedded/21326 http://thread.gmane.org/gmane.comp.handhelds.openembedded/21816 Signed-off-by: Denys Dmytriyenko <denis@denix.org> Acked-by: Mike Westerhof <mwester@dls.net> Acked-by: Philip Balister <philip@balister.org> Acked-by: Khem Raj <raj.khem@gmail.com> Acked-by: Marcin Juszkiewicz <hrw@openembedded.org> Acked-by: Koen Kooi <koen@openembedded.org> Acked-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Diffstat (limited to 'recipes/linux/linux-2.6.18/spi-fix-spi-busnum-to-master-buffer-and-bus_num-0.patch')
-rw-r--r--recipes/linux/linux-2.6.18/spi-fix-spi-busnum-to-master-buffer-and-bus_num-0.patch50
1 files changed, 50 insertions, 0 deletions
diff --git a/recipes/linux/linux-2.6.18/spi-fix-spi-busnum-to-master-buffer-and-bus_num-0.patch b/recipes/linux/linux-2.6.18/spi-fix-spi-busnum-to-master-buffer-and-bus_num-0.patch
new file mode 100644
index 0000000000..e5e040bc32
--- /dev/null
+++ b/recipes/linux/linux-2.6.18/spi-fix-spi-busnum-to-master-buffer-and-bus_num-0.patch
@@ -0,0 +1,50 @@
+From 4740d387f3cb9e63f48f2488815b38a2c92755c8 Mon Sep 17 00:00:00 2001
+From: Hans-Christian Egtvedt <hcegtvedt@atmel.com>
+Date: Wed, 6 Dec 2006 20:36:17 -0800
+Subject: [PATCH] [PATCH] spi: correct bus_num and buffer bug in spi core
+
+Correct the following in driver/spi/spi.c in function spi_busnum_to_master:
+
+ * must allow bus_num 0, the if is really not needed.
+ * correct the name buffer which is too small for bus_num >= 10000. It
+
+should be 9 bytes big, not 8.
+
+Signed-off-by: Hans-Christian Egtvedt <hcegtvedt@atmel.com>
+Cc: David Brownell <david-b@pacbell.net>
+Signed-off-by: Andrew Morton <akpm@osdl.org>
+Signed-off-by: Linus Torvalds <torvalds@osdl.org>
+---
+ drivers/spi/spi.c | 16 +++++++---------
+ 1 files changed, 7 insertions(+), 9 deletions(-)
+
+diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
+index 1a3c963..7d215ea 100644
+--- a/drivers/spi/spi.c
++++ b/drivers/spi/spi.c
+@@ -465,15 +465,13 @@ EXPORT_SYMBOL_GPL(spi_unregister_master);
+ */
+ struct spi_master *spi_busnum_to_master(u16 bus_num)
+ {
+- if (bus_num) {
+- char name[8];
+- struct kobject *bus;
+-
+- snprintf(name, sizeof name, "spi%u", bus_num);
+- bus = kset_find_obj(&spi_master_class.subsys.kset, name);
+- if (bus)
+- return container_of(bus, struct spi_master, cdev.kobj);
+- }
++ char name[9];
++ struct kobject *bus;
++
++ snprintf(name, sizeof name, "spi%u", bus_num);
++ bus = kset_find_obj(&spi_master_class.subsys.kset, name);
++ if (bus)
++ return container_of(bus, struct spi_master, cdev.kobj);
+ return NULL;
+ }
+ EXPORT_SYMBOL_GPL(spi_busnum_to_master);
+--
+1.4.4.1
+