diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-14 23:00:28 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-14 23:00:28 -0500 |
commit | 5393f780277165f282a37ed82dd878159ec9dad5 (patch) | |
tree | 00df86ebd8b598b5db3c4fe4612c6614409caf94 /drivers | |
parent | bca268565fd18f0b36ab8fff6e1623d8dffae2b1 (diff) | |
parent | ea0105ea3881b409e362451690184af494bce6e3 (diff) |
Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (29 commits)
powerpc/83xx: Move mcu_mpc8349emitx driver out of drivers/i2c/chips/
powerpc/83xx: Make serial ports work on MPC8315E-RDB w/ FSL U-Boots
powerpc/e500mc: Doorbells need to be taken w/exceptions disabled
powerpc: Enable PS3 options and QPACE in ppc64_defconfig
powerpc/powermac: Fix occasional SMP boot failure
powerpc/cacheinfo: Rename cache_dir per-cpu variable
hvc_console: Use kzalloc() instead of kmalloc() + memset()
hvc_console: Do not set low_latency when using interrupts
hvc_console: Call free_irq() only if request_irq() was successful
hvc_console: Change an mb() to smp_mb() and add some comments
powerpc: Cleanup from l64 to ll64 change: drivers/net
powerpc: Cleanup from l64 to ll64 change: drivers/char
powerpc: Cleanup from l64 to ll64 change: arch code
powerpc: Change u64/s64 to a long long integer type
powerpc/kexec: Check crash_base for relocatable kernel
powerpc: Make dummy section a valid note header
Xilinx: SPI: updated driver for device tree
drivers/of: Add the of_find_i2c_device_by_node function.
powerpc/xsysace: add compatible string for non-ipcore instance
powerpc/mpc52xx: remove dead code from GPIO driver
...
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/block/xsysace.c | 1 | ||||
-rw-r--r-- | drivers/char/bsr.c | 2 | ||||
-rw-r--r-- | drivers/char/hvc_console.c | 14 | ||||
-rw-r--r-- | drivers/char/hvc_irq.c | 2 | ||||
-rw-r--r-- | drivers/i2c/chips/Kconfig | 11 | ||||
-rw-r--r-- | drivers/i2c/chips/Makefile | 1 | ||||
-rw-r--r-- | drivers/i2c/chips/mcu_mpc8349emitx.c | 209 | ||||
-rw-r--r-- | drivers/net/ehea/ehea_main.c | 8 | ||||
-rw-r--r-- | drivers/net/ehea/ehea_qmr.c | 18 | ||||
-rw-r--r-- | drivers/net/ibmveth.c | 16 | ||||
-rw-r--r-- | drivers/net/iseries_veth.c | 2 | ||||
-rw-r--r-- | drivers/net/pasemi_mac.c | 6 | ||||
-rw-r--r-- | drivers/of/of_i2c.c | 19 | ||||
-rw-r--r-- | drivers/pcmcia/electra_cf.c | 2 | ||||
-rw-r--r-- | drivers/scsi/ibmvscsi/ibmvscsi.c | 12 | ||||
-rw-r--r-- | drivers/spi/xilinx_spi.c | 137 |
16 files changed, 143 insertions, 317 deletions
diff --git a/drivers/block/xsysace.c b/drivers/block/xsysace.c index 29e1dfafb7c6..381d686fc1a3 100644 --- a/drivers/block/xsysace.c +++ b/drivers/block/xsysace.c | |||
@@ -1206,6 +1206,7 @@ static struct of_device_id ace_of_match[] __devinitdata = { | |||
1206 | { .compatible = "xlnx,opb-sysace-1.00.b", }, | 1206 | { .compatible = "xlnx,opb-sysace-1.00.b", }, |
1207 | { .compatible = "xlnx,opb-sysace-1.00.c", }, | 1207 | { .compatible = "xlnx,opb-sysace-1.00.c", }, |
1208 | { .compatible = "xlnx,xps-sysace-1.00.a", }, | 1208 | { .compatible = "xlnx,xps-sysace-1.00.a", }, |
1209 | { .compatible = "xlnx,sysace", }, | ||
1209 | {}, | 1210 | {}, |
1210 | }; | 1211 | }; |
1211 | MODULE_DEVICE_TABLE(of, ace_of_match); | 1212 | MODULE_DEVICE_TABLE(of, ace_of_match); |
diff --git a/drivers/char/bsr.c b/drivers/char/bsr.c index 977dfb1096a0..f6094ae0ef33 100644 --- a/drivers/char/bsr.c +++ b/drivers/char/bsr.c | |||
@@ -103,7 +103,7 @@ static ssize_t | |||
103 | bsr_len_show(struct device *dev, struct device_attribute *attr, char *buf) | 103 | bsr_len_show(struct device *dev, struct device_attribute *attr, char *buf) |
104 | { | 104 | { |
105 | struct bsr_dev *bsr_dev = dev_get_drvdata(dev); | 105 | struct bsr_dev *bsr_dev = dev_get_drvdata(dev); |
106 | return sprintf(buf, "%lu\n", bsr_dev->bsr_len); | 106 | return sprintf(buf, "%llu\n", bsr_dev->bsr_len); |
107 | } | 107 | } |
108 | 108 | ||
109 | static struct device_attribute bsr_dev_attrs[] = { | 109 | static struct device_attribute bsr_dev_attrs[] = { |
diff --git a/drivers/char/hvc_console.c b/drivers/char/hvc_console.c index 5a8a4c28c867..09676b4e5d89 100644 --- a/drivers/char/hvc_console.c +++ b/drivers/char/hvc_console.c | |||
@@ -318,7 +318,8 @@ static int hvc_open(struct tty_struct *tty, struct file * filp) | |||
318 | } /* else count == 0 */ | 318 | } /* else count == 0 */ |
319 | 319 | ||
320 | tty->driver_data = hp; | 320 | tty->driver_data = hp; |
321 | tty->low_latency = 1; /* Makes flushes to ldisc synchronous. */ | 321 | if (!hp->irq_requested) |
322 | tty->low_latency = 1; /* Makes flushes to ldisc synchronous. */ | ||
322 | 323 | ||
323 | hp->tty = tty; | 324 | hp->tty = tty; |
324 | 325 | ||
@@ -764,13 +765,11 @@ struct hvc_struct __devinit *hvc_alloc(uint32_t vtermno, int data, | |||
764 | return ERR_PTR(err); | 765 | return ERR_PTR(err); |
765 | } | 766 | } |
766 | 767 | ||
767 | hp = kmalloc(ALIGN(sizeof(*hp), sizeof(long)) + outbuf_size, | 768 | hp = kzalloc(ALIGN(sizeof(*hp), sizeof(long)) + outbuf_size, |
768 | GFP_KERNEL); | 769 | GFP_KERNEL); |
769 | if (!hp) | 770 | if (!hp) |
770 | return ERR_PTR(-ENOMEM); | 771 | return ERR_PTR(-ENOMEM); |
771 | 772 | ||
772 | memset(hp, 0x00, sizeof(*hp)); | ||
773 | |||
774 | hp->vtermno = vtermno; | 773 | hp->vtermno = vtermno; |
775 | hp->data = data; | 774 | hp->data = data; |
776 | hp->ops = ops; | 775 | hp->ops = ops; |
@@ -876,8 +875,11 @@ static int hvc_init(void) | |||
876 | goto stop_thread; | 875 | goto stop_thread; |
877 | } | 876 | } |
878 | 877 | ||
879 | /* FIXME: This mb() seems completely random. Remove it. */ | 878 | /* |
880 | mb(); | 879 | * Make sure tty is fully registered before allowing it to be |
880 | * found by hvc_console_device. | ||
881 | */ | ||
882 | smp_mb(); | ||
881 | hvc_driver = drv; | 883 | hvc_driver = drv; |
882 | return 0; | 884 | return 0; |
883 | 885 | ||
diff --git a/drivers/char/hvc_irq.c b/drivers/char/hvc_irq.c index d09e5688d449..2623e177e8d6 100644 --- a/drivers/char/hvc_irq.c +++ b/drivers/char/hvc_irq.c | |||
@@ -37,7 +37,7 @@ int notifier_add_irq(struct hvc_struct *hp, int irq) | |||
37 | 37 | ||
38 | void notifier_del_irq(struct hvc_struct *hp, int irq) | 38 | void notifier_del_irq(struct hvc_struct *hp, int irq) |
39 | { | 39 | { |
40 | if (!irq) | 40 | if (!hp->irq_requested) |
41 | return; | 41 | return; |
42 | free_irq(irq, hp); | 42 | free_irq(irq, hp); |
43 | hp->irq_requested = 0; | 43 | hp->irq_requested = 0; |
diff --git a/drivers/i2c/chips/Kconfig b/drivers/i2c/chips/Kconfig index 59c3d23f5bdc..b9bef04b7be4 100644 --- a/drivers/i2c/chips/Kconfig +++ b/drivers/i2c/chips/Kconfig | |||
@@ -139,15 +139,4 @@ config SENSORS_TSL2550 | |||
139 | This driver can also be built as a module. If so, the module | 139 | This driver can also be built as a module. If so, the module |
140 | will be called tsl2550. | 140 | will be called tsl2550. |
141 | 141 | ||
142 | config MCU_MPC8349EMITX | ||
143 | tristate "MPC8349E-mITX MCU driver" | ||
144 | depends on I2C && PPC_83xx | ||
145 | select GENERIC_GPIO | ||
146 | select ARCH_REQUIRE_GPIOLIB | ||
147 | help | ||
148 | Say Y here to enable soft power-off functionality on the Freescale | ||
149 | boards with the MPC8349E-mITX-compatible MCU chips. This driver will | ||
150 | also register MCU GPIOs with the generic GPIO API, so you'll able | ||
151 | to use MCU pins as GPIOs. | ||
152 | |||
153 | endmenu | 142 | endmenu |
diff --git a/drivers/i2c/chips/Makefile b/drivers/i2c/chips/Makefile index 83accaaf8164..00fcb5193ac2 100644 --- a/drivers/i2c/chips/Makefile +++ b/drivers/i2c/chips/Makefile | |||
@@ -19,7 +19,6 @@ obj-$(CONFIG_SENSORS_PCF8574) += pcf8574.o | |||
19 | obj-$(CONFIG_PCF8575) += pcf8575.o | 19 | obj-$(CONFIG_PCF8575) += pcf8575.o |
20 | obj-$(CONFIG_SENSORS_PCF8591) += pcf8591.o | 20 | obj-$(CONFIG_SENSORS_PCF8591) += pcf8591.o |
21 | obj-$(CONFIG_SENSORS_TSL2550) += tsl2550.o | 21 | obj-$(CONFIG_SENSORS_TSL2550) += tsl2550.o |
22 | obj-$(CONFIG_MCU_MPC8349EMITX) += mcu_mpc8349emitx.o | ||
23 | 22 | ||
24 | ifeq ($(CONFIG_I2C_DEBUG_CHIP),y) | 23 | ifeq ($(CONFIG_I2C_DEBUG_CHIP),y) |
25 | EXTRA_CFLAGS += -DDEBUG | 24 | EXTRA_CFLAGS += -DDEBUG |
diff --git a/drivers/i2c/chips/mcu_mpc8349emitx.c b/drivers/i2c/chips/mcu_mpc8349emitx.c deleted file mode 100644 index 82a9bcb858b6..000000000000 --- a/drivers/i2c/chips/mcu_mpc8349emitx.c +++ /dev/null | |||
@@ -1,209 +0,0 @@ | |||
1 | /* | ||
2 | * Power Management and GPIO expander driver for MPC8349E-mITX-compatible MCU | ||
3 | * | ||
4 | * Copyright (c) 2008 MontaVista Software, Inc. | ||
5 | * | ||
6 | * Author: Anton Vorontsov <avorontsov@ru.mvista.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | */ | ||
13 | |||
14 | #include <linux/init.h> | ||
15 | #include <linux/kernel.h> | ||
16 | #include <linux/module.h> | ||
17 | #include <linux/device.h> | ||
18 | #include <linux/mutex.h> | ||
19 | #include <linux/i2c.h> | ||
20 | #include <linux/gpio.h> | ||
21 | #include <linux/of.h> | ||
22 | #include <linux/of_gpio.h> | ||
23 | #include <asm/prom.h> | ||
24 | #include <asm/machdep.h> | ||
25 | |||
26 | /* | ||
27 | * I don't have specifications for the MCU firmware, I found this register | ||
28 | * and bits positions by the trial&error method. | ||
29 | */ | ||
30 | #define MCU_REG_CTRL 0x20 | ||
31 | #define MCU_CTRL_POFF 0x40 | ||
32 | |||
33 | #define MCU_NUM_GPIO 2 | ||
34 | |||
35 | struct mcu { | ||
36 | struct mutex lock; | ||
37 | struct device_node *np; | ||
38 | struct i2c_client *client; | ||
39 | struct of_gpio_chip of_gc; | ||
40 | u8 reg_ctrl; | ||
41 | }; | ||
42 | |||
43 | static struct mcu *glob_mcu; | ||
44 | |||
45 | static void mcu_power_off(void) | ||
46 | { | ||
47 | struct mcu *mcu = glob_mcu; | ||
48 | |||
49 | pr_info("Sending power-off request to the MCU...\n"); | ||
50 | mutex_lock(&mcu->lock); | ||
51 | i2c_smbus_write_byte_data(glob_mcu->client, MCU_REG_CTRL, | ||
52 | mcu->reg_ctrl | MCU_CTRL_POFF); | ||
53 | mutex_unlock(&mcu->lock); | ||
54 | } | ||
55 | |||
56 | static void mcu_gpio_set(struct gpio_chip *gc, unsigned int gpio, int val) | ||
57 | { | ||
58 | struct of_gpio_chip *of_gc = to_of_gpio_chip(gc); | ||
59 | struct mcu *mcu = container_of(of_gc, struct mcu, of_gc); | ||
60 | u8 bit = 1 << (4 + gpio); | ||
61 | |||
62 | mutex_lock(&mcu->lock); | ||
63 | if (val) | ||
64 | mcu->reg_ctrl &= ~bit; | ||
65 | else | ||
66 | mcu->reg_ctrl |= bit; | ||
67 | |||
68 | i2c_smbus_write_byte_data(mcu->client, MCU_REG_CTRL, mcu->reg_ctrl); | ||
69 | mutex_unlock(&mcu->lock); | ||
70 | } | ||
71 | |||
72 | static int mcu_gpio_dir_out(struct gpio_chip *gc, unsigned int gpio, int val) | ||
73 | { | ||
74 | mcu_gpio_set(gc, gpio, val); | ||
75 | return 0; | ||
76 | } | ||
77 | |||
78 | static int mcu_gpiochip_add(struct mcu *mcu) | ||
79 | { | ||
80 | struct device_node *np; | ||
81 | struct of_gpio_chip *of_gc = &mcu->of_gc; | ||
82 | struct gpio_chip *gc = &of_gc->gc; | ||
83 | int ret; | ||
84 | |||
85 | np = of_find_compatible_node(NULL, NULL, "fsl,mcu-mpc8349emitx"); | ||
86 | if (!np) | ||
87 | return -ENODEV; | ||
88 | |||
89 | gc->owner = THIS_MODULE; | ||
90 | gc->label = np->full_name; | ||
91 | gc->can_sleep = 1; | ||
92 | gc->ngpio = MCU_NUM_GPIO; | ||
93 | gc->base = -1; | ||
94 | gc->set = mcu_gpio_set; | ||
95 | gc->direction_output = mcu_gpio_dir_out; | ||
96 | of_gc->gpio_cells = 2; | ||
97 | of_gc->xlate = of_gpio_simple_xlate; | ||
98 | |||
99 | np->data = of_gc; | ||
100 | mcu->np = np; | ||
101 | |||
102 | /* | ||
103 | * We don't want to lose the node, its ->data and ->full_name... | ||
104 | * So, if succeeded, we don't put the node here. | ||
105 | */ | ||
106 | ret = gpiochip_add(gc); | ||
107 | if (ret) | ||
108 | of_node_put(np); | ||
109 | return ret; | ||
110 | } | ||
111 | |||
112 | static int mcu_gpiochip_remove(struct mcu *mcu) | ||
113 | { | ||
114 | int ret; | ||
115 | |||
116 | ret = gpiochip_remove(&mcu->of_gc.gc); | ||
117 | if (ret) | ||
118 | return ret; | ||
119 | of_node_put(mcu->np); | ||
120 | |||
121 | return 0; | ||
122 | } | ||
123 | |||
124 | static int __devinit mcu_probe(struct i2c_client *client, | ||
125 | const struct i2c_device_id *id) | ||
126 | { | ||
127 | struct mcu *mcu; | ||
128 | int ret; | ||
129 | |||
130 | mcu = kzalloc(sizeof(*mcu), GFP_KERNEL); | ||
131 | if (!mcu) | ||
132 | return -ENOMEM; | ||
133 | |||
134 | mutex_init(&mcu->lock); | ||
135 | mcu->client = client; | ||
136 | i2c_set_clientdata(client, mcu); | ||
137 | |||
138 | ret = i2c_smbus_read_byte_data(mcu->client, MCU_REG_CTRL); | ||
139 | if (ret < 0) | ||
140 | goto err; | ||
141 | mcu->reg_ctrl = ret; | ||
142 | |||
143 | ret = mcu_gpiochip_add(mcu); | ||
144 | if (ret) | ||
145 | goto err; | ||
146 | |||
147 | /* XXX: this is potentially racy, but there is no lock for ppc_md */ | ||
148 | if (!ppc_md.power_off) { | ||
149 | glob_mcu = mcu; | ||
150 | ppc_md.power_off = mcu_power_off; | ||
151 | dev_info(&client->dev, "will provide power-off service\n"); | ||
152 | } | ||
153 | |||
154 | return 0; | ||
155 | err: | ||
156 | kfree(mcu); | ||
157 | return ret; | ||
158 | } | ||
159 | |||
160 | static int __devexit mcu_remove(struct i2c_client *client) | ||
161 | { | ||
162 | struct mcu *mcu = i2c_get_clientdata(client); | ||
163 | int ret; | ||
164 | |||
165 | if (glob_mcu == mcu) { | ||
166 | ppc_md.power_off = NULL; | ||
167 | glob_mcu = NULL; | ||
168 | } | ||
169 | |||
170 | ret = mcu_gpiochip_remove(mcu); | ||
171 | if (ret) | ||
172 | return ret; | ||
173 | i2c_set_clientdata(client, NULL); | ||
174 | kfree(mcu); | ||
175 | return 0; | ||
176 | } | ||
177 | |||
178 | static const struct i2c_device_id mcu_ids[] = { | ||
179 | { "mcu-mpc8349emitx", }, | ||
180 | {}, | ||
181 | }; | ||
182 | MODULE_DEVICE_TABLE(i2c, mcu_ids); | ||
183 | |||
184 | static struct i2c_driver mcu_driver = { | ||
185 | .driver = { | ||
186 | .name = "mcu-mpc8349emitx", | ||
187 | .owner = THIS_MODULE, | ||
188 | }, | ||
189 | .probe = mcu_probe, | ||
190 | .remove = __devexit_p(mcu_remove), | ||
191 | .id_table = mcu_ids, | ||
192 | }; | ||
193 | |||
194 | static int __init mcu_init(void) | ||
195 | { | ||
196 | return i2c_add_driver(&mcu_driver); | ||
197 | } | ||
198 | module_init(mcu_init); | ||
199 | |||
200 | static void __exit mcu_exit(void) | ||
201 | { | ||
202 | i2c_del_driver(&mcu_driver); | ||
203 | } | ||
204 | module_exit(mcu_exit); | ||
205 | |||
206 | MODULE_DESCRIPTION("Power Management and GPIO expander driver for " | ||
207 | "MPC8349E-mITX-compatible MCU"); | ||
208 | MODULE_AUTHOR("Anton Vorontsov <avorontsov@ru.mvista.com>"); | ||
209 | MODULE_LICENSE("GPL"); | ||
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c index e3131ea629cd..dfe92264e825 100644 --- a/drivers/net/ehea/ehea_main.c +++ b/drivers/net/ehea/ehea_main.c | |||
@@ -132,7 +132,7 @@ void ehea_dump(void *adr, int len, char *msg) | |||
132 | int x; | 132 | int x; |
133 | unsigned char *deb = adr; | 133 | unsigned char *deb = adr; |
134 | for (x = 0; x < len; x += 16) { | 134 | for (x = 0; x < len; x += 16) { |
135 | printk(DRV_NAME " %s adr=%p ofs=%04x %016lx %016lx\n", msg, | 135 | printk(DRV_NAME " %s adr=%p ofs=%04x %016llx %016llx\n", msg, |
136 | deb, x, *((u64 *)&deb[0]), *((u64 *)&deb[8])); | 136 | deb, x, *((u64 *)&deb[0]), *((u64 *)&deb[8])); |
137 | deb += 16; | 137 | deb += 16; |
138 | } | 138 | } |
@@ -883,7 +883,7 @@ static irqreturn_t ehea_qp_aff_irq_handler(int irq, void *param) | |||
883 | 883 | ||
884 | while (eqe) { | 884 | while (eqe) { |
885 | qp_token = EHEA_BMASK_GET(EHEA_EQE_QP_TOKEN, eqe->entry); | 885 | qp_token = EHEA_BMASK_GET(EHEA_EQE_QP_TOKEN, eqe->entry); |
886 | ehea_error("QP aff_err: entry=0x%lx, token=0x%x", | 886 | ehea_error("QP aff_err: entry=0x%llx, token=0x%x", |
887 | eqe->entry, qp_token); | 887 | eqe->entry, qp_token); |
888 | 888 | ||
889 | qp = port->port_res[qp_token].qp; | 889 | qp = port->port_res[qp_token].qp; |
@@ -1159,7 +1159,7 @@ static void ehea_parse_eqe(struct ehea_adapter *adapter, u64 eqe) | |||
1159 | netif_stop_queue(port->netdev); | 1159 | netif_stop_queue(port->netdev); |
1160 | break; | 1160 | break; |
1161 | default: | 1161 | default: |
1162 | ehea_error("unknown event code %x, eqe=0x%lX", ec, eqe); | 1162 | ehea_error("unknown event code %x, eqe=0x%llX", ec, eqe); |
1163 | break; | 1163 | break; |
1164 | } | 1164 | } |
1165 | } | 1165 | } |
@@ -1971,7 +1971,7 @@ static void ehea_set_multicast_list(struct net_device *dev) | |||
1971 | } | 1971 | } |
1972 | 1972 | ||
1973 | if (dev->mc_count > port->adapter->max_mc_mac) { | 1973 | if (dev->mc_count > port->adapter->max_mc_mac) { |
1974 | ehea_info("Mcast registration limit reached (0x%lx). " | 1974 | ehea_info("Mcast registration limit reached (0x%llx). " |
1975 | "Use ALLMULTI!", | 1975 | "Use ALLMULTI!", |
1976 | port->adapter->max_mc_mac); | 1976 | port->adapter->max_mc_mac); |
1977 | goto out; | 1977 | goto out; |
diff --git a/drivers/net/ehea/ehea_qmr.c b/drivers/net/ehea/ehea_qmr.c index 225c692b5d99..49d766ebbcf4 100644 --- a/drivers/net/ehea/ehea_qmr.c +++ b/drivers/net/ehea/ehea_qmr.c | |||
@@ -168,7 +168,7 @@ struct ehea_cq *ehea_create_cq(struct ehea_adapter *adapter, | |||
168 | cq->fw_handle, rpage, 1); | 168 | cq->fw_handle, rpage, 1); |
169 | if (hret < H_SUCCESS) { | 169 | if (hret < H_SUCCESS) { |
170 | ehea_error("register_rpage_cq failed ehea_cq=%p " | 170 | ehea_error("register_rpage_cq failed ehea_cq=%p " |
171 | "hret=%lx counter=%i act_pages=%i", | 171 | "hret=%llx counter=%i act_pages=%i", |
172 | cq, hret, counter, cq->attr.nr_pages); | 172 | cq, hret, counter, cq->attr.nr_pages); |
173 | goto out_kill_hwq; | 173 | goto out_kill_hwq; |
174 | } | 174 | } |
@@ -178,13 +178,13 @@ struct ehea_cq *ehea_create_cq(struct ehea_adapter *adapter, | |||
178 | 178 | ||
179 | if ((hret != H_SUCCESS) || (vpage)) { | 179 | if ((hret != H_SUCCESS) || (vpage)) { |
180 | ehea_error("registration of pages not " | 180 | ehea_error("registration of pages not " |
181 | "complete hret=%lx\n", hret); | 181 | "complete hret=%llx\n", hret); |
182 | goto out_kill_hwq; | 182 | goto out_kill_hwq; |
183 | } | 183 | } |
184 | } else { | 184 | } else { |
185 | if (hret != H_PAGE_REGISTERED) { | 185 | if (hret != H_PAGE_REGISTERED) { |
186 | ehea_error("CQ: registration of page failed " | 186 | ehea_error("CQ: registration of page failed " |
187 | "hret=%lx\n", hret); | 187 | "hret=%llx\n", hret); |
188 | goto out_kill_hwq; | 188 | goto out_kill_hwq; |
189 | } | 189 | } |
190 | } | 190 | } |
@@ -986,15 +986,15 @@ void print_error_data(u64 *data) | |||
986 | length = EHEA_PAGESIZE; | 986 | length = EHEA_PAGESIZE; |
987 | 987 | ||
988 | if (type == 0x8) /* Queue Pair */ | 988 | if (type == 0x8) /* Queue Pair */ |
989 | ehea_error("QP (resource=%lX) state: AER=0x%lX, AERR=0x%lX, " | 989 | ehea_error("QP (resource=%llX) state: AER=0x%llX, AERR=0x%llX, " |
990 | "port=%lX", resource, data[6], data[12], data[22]); | 990 | "port=%llX", resource, data[6], data[12], data[22]); |
991 | 991 | ||
992 | if (type == 0x4) /* Completion Queue */ | 992 | if (type == 0x4) /* Completion Queue */ |
993 | ehea_error("CQ (resource=%lX) state: AER=0x%lX", resource, | 993 | ehea_error("CQ (resource=%llX) state: AER=0x%llX", resource, |
994 | data[6]); | 994 | data[6]); |
995 | 995 | ||
996 | if (type == 0x3) /* Event Queue */ | 996 | if (type == 0x3) /* Event Queue */ |
997 | ehea_error("EQ (resource=%lX) state: AER=0x%lX", resource, | 997 | ehea_error("EQ (resource=%llX) state: AER=0x%llX", resource, |
998 | data[6]); | 998 | data[6]); |
999 | 999 | ||
1000 | ehea_dump(data, length, "error data"); | 1000 | ehea_dump(data, length, "error data"); |
@@ -1016,11 +1016,11 @@ void ehea_error_data(struct ehea_adapter *adapter, u64 res_handle) | |||
1016 | rblock); | 1016 | rblock); |
1017 | 1017 | ||
1018 | if (ret == H_R_STATE) | 1018 | if (ret == H_R_STATE) |
1019 | ehea_error("No error data is available: %lX.", res_handle); | 1019 | ehea_error("No error data is available: %llX.", res_handle); |
1020 | else if (ret == H_SUCCESS) | 1020 | else if (ret == H_SUCCESS) |
1021 | print_error_data(rblock); | 1021 | print_error_data(rblock); |
1022 | else | 1022 | else |
1023 | ehea_error("Error data could not be fetched: %lX", res_handle); | 1023 | ehea_error("Error data could not be fetched: %llX", res_handle); |
1024 | 1024 | ||
1025 | kfree(rblock); | 1025 | kfree(rblock); |
1026 | } | 1026 | } |
diff --git a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c index ca3bb9f7321b..dfa6348ac1dc 100644 --- a/drivers/net/ibmveth.c +++ b/drivers/net/ibmveth.c | |||
@@ -602,7 +602,7 @@ static int ibmveth_open(struct net_device *netdev) | |||
602 | 602 | ||
603 | if(lpar_rc != H_SUCCESS) { | 603 | if(lpar_rc != H_SUCCESS) { |
604 | ibmveth_error_printk("h_register_logical_lan failed with %ld\n", lpar_rc); | 604 | ibmveth_error_printk("h_register_logical_lan failed with %ld\n", lpar_rc); |
605 | ibmveth_error_printk("buffer TCE:0x%lx filter TCE:0x%lx rxq desc:0x%lx MAC:0x%lx\n", | 605 | ibmveth_error_printk("buffer TCE:0x%llx filter TCE:0x%llx rxq desc:0x%llx MAC:0x%llx\n", |
606 | adapter->buffer_list_dma, | 606 | adapter->buffer_list_dma, |
607 | adapter->filter_list_dma, | 607 | adapter->filter_list_dma, |
608 | rxq_desc.desc, | 608 | rxq_desc.desc, |
@@ -1378,13 +1378,13 @@ static int ibmveth_show(struct seq_file *seq, void *v) | |||
1378 | seq_printf(seq, "Firmware MAC: %pM\n", firmware_mac); | 1378 | seq_printf(seq, "Firmware MAC: %pM\n", firmware_mac); |
1379 | 1379 | ||
1380 | seq_printf(seq, "\nAdapter Statistics:\n"); | 1380 | seq_printf(seq, "\nAdapter Statistics:\n"); |
1381 | seq_printf(seq, " TX: vio_map_single failres: %ld\n", adapter->tx_map_failed); | 1381 | seq_printf(seq, " TX: vio_map_single failres: %lld\n", adapter->tx_map_failed); |
1382 | seq_printf(seq, " send failures: %ld\n", adapter->tx_send_failed); | 1382 | seq_printf(seq, " send failures: %lld\n", adapter->tx_send_failed); |
1383 | seq_printf(seq, " RX: replenish task cycles: %ld\n", adapter->replenish_task_cycles); | 1383 | seq_printf(seq, " RX: replenish task cycles: %lld\n", adapter->replenish_task_cycles); |
1384 | seq_printf(seq, " alloc_skb_failures: %ld\n", adapter->replenish_no_mem); | 1384 | seq_printf(seq, " alloc_skb_failures: %lld\n", adapter->replenish_no_mem); |
1385 | seq_printf(seq, " add buffer failures: %ld\n", adapter->replenish_add_buff_failure); | 1385 | seq_printf(seq, " add buffer failures: %lld\n", adapter->replenish_add_buff_failure); |
1386 | seq_printf(seq, " invalid buffers: %ld\n", adapter->rx_invalid_buffer); | 1386 | seq_printf(seq, " invalid buffers: %lld\n", adapter->rx_invalid_buffer); |
1387 | seq_printf(seq, " no buffers: %ld\n", adapter->rx_no_buffer); | 1387 | seq_printf(seq, " no buffers: %lld\n", adapter->rx_no_buffer); |
1388 | 1388 | ||
1389 | return 0; | 1389 | return 0; |
1390 | } | 1390 | } |
diff --git a/drivers/net/iseries_veth.c b/drivers/net/iseries_veth.c index c7457f97259d..cb793c2bade2 100644 --- a/drivers/net/iseries_veth.c +++ b/drivers/net/iseries_veth.c | |||
@@ -429,7 +429,7 @@ SIMPLE_PORT_ATTR(promiscuous); | |||
429 | SIMPLE_PORT_ATTR(num_mcast); | 429 | SIMPLE_PORT_ATTR(num_mcast); |
430 | CUSTOM_PORT_ATTR(lpar_map, "0x%X\n", port->lpar_map); | 430 | CUSTOM_PORT_ATTR(lpar_map, "0x%X\n", port->lpar_map); |
431 | CUSTOM_PORT_ATTR(stopped_map, "0x%X\n", port->stopped_map); | 431 | CUSTOM_PORT_ATTR(stopped_map, "0x%X\n", port->stopped_map); |
432 | CUSTOM_PORT_ATTR(mac_addr, "0x%lX\n", port->mac_addr); | 432 | CUSTOM_PORT_ATTR(mac_addr, "0x%llX\n", port->mac_addr); |
433 | 433 | ||
434 | #define GET_PORT_ATTR(_name) (&veth_port_attr_##_name.attr) | 434 | #define GET_PORT_ATTR(_name) (&veth_port_attr_##_name.attr) |
435 | static struct attribute *veth_port_default_attrs[] = { | 435 | static struct attribute *veth_port_default_attrs[] = { |
diff --git a/drivers/net/pasemi_mac.c b/drivers/net/pasemi_mac.c index 5b7a574ce571..d0349e7d73ea 100644 --- a/drivers/net/pasemi_mac.c +++ b/drivers/net/pasemi_mac.c | |||
@@ -712,7 +712,7 @@ static inline void pasemi_mac_rx_error(const struct pasemi_mac *mac, | |||
712 | rcmdsta = read_dma_reg(PAS_DMA_RXINT_RCMDSTA(mac->dma_if)); | 712 | rcmdsta = read_dma_reg(PAS_DMA_RXINT_RCMDSTA(mac->dma_if)); |
713 | ccmdsta = read_dma_reg(PAS_DMA_RXCHAN_CCMDSTA(chan->chno)); | 713 | ccmdsta = read_dma_reg(PAS_DMA_RXCHAN_CCMDSTA(chan->chno)); |
714 | 714 | ||
715 | printk(KERN_ERR "pasemi_mac: rx error. macrx %016lx, rx status %lx\n", | 715 | printk(KERN_ERR "pasemi_mac: rx error. macrx %016llx, rx status %llx\n", |
716 | macrx, *chan->status); | 716 | macrx, *chan->status); |
717 | 717 | ||
718 | printk(KERN_ERR "pasemi_mac: rcmdsta %08x ccmdsta %08x\n", | 718 | printk(KERN_ERR "pasemi_mac: rcmdsta %08x ccmdsta %08x\n", |
@@ -730,8 +730,8 @@ static inline void pasemi_mac_tx_error(const struct pasemi_mac *mac, | |||
730 | 730 | ||
731 | cmdsta = read_dma_reg(PAS_DMA_TXCHAN_TCMDSTA(chan->chno)); | 731 | cmdsta = read_dma_reg(PAS_DMA_TXCHAN_TCMDSTA(chan->chno)); |
732 | 732 | ||
733 | printk(KERN_ERR "pasemi_mac: tx error. mactx 0x%016lx, "\ | 733 | printk(KERN_ERR "pasemi_mac: tx error. mactx 0x%016llx, "\ |
734 | "tx status 0x%016lx\n", mactx, *chan->status); | 734 | "tx status 0x%016llx\n", mactx, *chan->status); |
735 | 735 | ||
736 | printk(KERN_ERR "pasemi_mac: tcmdsta 0x%08x\n", cmdsta); | 736 | printk(KERN_ERR "pasemi_mac: tcmdsta 0x%08x\n", cmdsta); |
737 | } | 737 | } |
diff --git a/drivers/of/of_i2c.c b/drivers/of/of_i2c.c index e1b0ad6e918f..fa65a2b2ae2e 100644 --- a/drivers/of/of_i2c.c +++ b/drivers/of/of_i2c.c | |||
@@ -66,4 +66,23 @@ void of_register_i2c_devices(struct i2c_adapter *adap, | |||
66 | } | 66 | } |
67 | EXPORT_SYMBOL(of_register_i2c_devices); | 67 | EXPORT_SYMBOL(of_register_i2c_devices); |
68 | 68 | ||
69 | static int of_dev_node_match(struct device *dev, void *data) | ||
70 | { | ||
71 | return dev_archdata_get_node(&dev->archdata) == data; | ||
72 | } | ||
73 | |||
74 | /* must call put_device() when done with returned i2c_client device */ | ||
75 | struct i2c_client *of_find_i2c_device_by_node(struct device_node *node) | ||
76 | { | ||
77 | struct device *dev; | ||
78 | |||
79 | dev = bus_find_device(&i2c_bus_type, NULL, node, | ||
80 | of_dev_node_match); | ||
81 | if (!dev) | ||
82 | return NULL; | ||
83 | |||
84 | return to_i2c_client(dev); | ||
85 | } | ||
86 | EXPORT_SYMBOL(of_find_i2c_device_by_node); | ||
87 | |||
69 | MODULE_LICENSE("GPL"); | 88 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/pcmcia/electra_cf.c b/drivers/pcmcia/electra_cf.c index a34284b1482a..d187ba4c5e0e 100644 --- a/drivers/pcmcia/electra_cf.c +++ b/drivers/pcmcia/electra_cf.c | |||
@@ -297,7 +297,7 @@ static int __devinit electra_cf_probe(struct of_device *ofdev, | |||
297 | goto fail3; | 297 | goto fail3; |
298 | } | 298 | } |
299 | 299 | ||
300 | dev_info(device, "at mem 0x%lx io 0x%lx irq %d\n", | 300 | dev_info(device, "at mem 0x%lx io 0x%llx irq %d\n", |
301 | cf->mem_phys, io.start, cf->irq); | 301 | cf->mem_phys, io.start, cf->irq); |
302 | 302 | ||
303 | cf->active = 1; | 303 | cf->active = 1; |
diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c index 5c541f7850f9..74d07d137dae 100644 --- a/drivers/scsi/ibmvscsi/ibmvscsi.c +++ b/drivers/scsi/ibmvscsi/ibmvscsi.c | |||
@@ -1061,7 +1061,7 @@ static int ibmvscsi_eh_abort_handler(struct scsi_cmnd *cmd) | |||
1061 | } | 1061 | } |
1062 | 1062 | ||
1063 | sdev_printk(KERN_INFO, cmd->device, | 1063 | sdev_printk(KERN_INFO, cmd->device, |
1064 | "aborting command. lun 0x%lx, tag 0x%lx\n", | 1064 | "aborting command. lun 0x%llx, tag 0x%llx\n", |
1065 | (((u64) lun) << 48), (u64) found_evt); | 1065 | (((u64) lun) << 48), (u64) found_evt); |
1066 | 1066 | ||
1067 | wait_for_completion(&evt->comp); | 1067 | wait_for_completion(&evt->comp); |
@@ -1082,7 +1082,7 @@ static int ibmvscsi_eh_abort_handler(struct scsi_cmnd *cmd) | |||
1082 | if (rsp_rc) { | 1082 | if (rsp_rc) { |
1083 | if (printk_ratelimit()) | 1083 | if (printk_ratelimit()) |
1084 | sdev_printk(KERN_WARNING, cmd->device, | 1084 | sdev_printk(KERN_WARNING, cmd->device, |
1085 | "abort code %d for task tag 0x%lx\n", | 1085 | "abort code %d for task tag 0x%llx\n", |
1086 | rsp_rc, tsk_mgmt->task_tag); | 1086 | rsp_rc, tsk_mgmt->task_tag); |
1087 | return FAILED; | 1087 | return FAILED; |
1088 | } | 1088 | } |
@@ -1102,12 +1102,12 @@ static int ibmvscsi_eh_abort_handler(struct scsi_cmnd *cmd) | |||
1102 | 1102 | ||
1103 | if (found_evt == NULL) { | 1103 | if (found_evt == NULL) { |
1104 | spin_unlock_irqrestore(hostdata->host->host_lock, flags); | 1104 | spin_unlock_irqrestore(hostdata->host->host_lock, flags); |
1105 | sdev_printk(KERN_INFO, cmd->device, "aborted task tag 0x%lx completed\n", | 1105 | sdev_printk(KERN_INFO, cmd->device, "aborted task tag 0x%llx completed\n", |
1106 | tsk_mgmt->task_tag); | 1106 | tsk_mgmt->task_tag); |
1107 | return SUCCESS; | 1107 | return SUCCESS; |
1108 | } | 1108 | } |
1109 | 1109 | ||
1110 | sdev_printk(KERN_INFO, cmd->device, "successfully aborted task tag 0x%lx\n", | 1110 | sdev_printk(KERN_INFO, cmd->device, "successfully aborted task tag 0x%llx\n", |
1111 | tsk_mgmt->task_tag); | 1111 | tsk_mgmt->task_tag); |
1112 | 1112 | ||
1113 | cmd->result = (DID_ABORT << 16); | 1113 | cmd->result = (DID_ABORT << 16); |
@@ -1182,7 +1182,7 @@ static int ibmvscsi_eh_device_reset_handler(struct scsi_cmnd *cmd) | |||
1182 | return FAILED; | 1182 | return FAILED; |
1183 | } | 1183 | } |
1184 | 1184 | ||
1185 | sdev_printk(KERN_INFO, cmd->device, "resetting device. lun 0x%lx\n", | 1185 | sdev_printk(KERN_INFO, cmd->device, "resetting device. lun 0x%llx\n", |
1186 | (((u64) lun) << 48)); | 1186 | (((u64) lun) << 48)); |
1187 | 1187 | ||
1188 | wait_for_completion(&evt->comp); | 1188 | wait_for_completion(&evt->comp); |
@@ -1203,7 +1203,7 @@ static int ibmvscsi_eh_device_reset_handler(struct scsi_cmnd *cmd) | |||
1203 | if (rsp_rc) { | 1203 | if (rsp_rc) { |
1204 | if (printk_ratelimit()) | 1204 | if (printk_ratelimit()) |
1205 | sdev_printk(KERN_WARNING, cmd->device, | 1205 | sdev_printk(KERN_WARNING, cmd->device, |
1206 | "reset code %d for task tag 0x%lx\n", | 1206 | "reset code %d for task tag 0x%llx\n", |
1207 | rsp_rc, tsk_mgmt->task_tag); | 1207 | rsp_rc, tsk_mgmt->task_tag); |
1208 | return FAILED; | 1208 | return FAILED; |
1209 | } | 1209 | } |
diff --git a/drivers/spi/xilinx_spi.c b/drivers/spi/xilinx_spi.c index 68d6f4988fb5..fe7e5f35e5d0 100644 --- a/drivers/spi/xilinx_spi.c +++ b/drivers/spi/xilinx_spi.c | |||
@@ -15,12 +15,15 @@ | |||
15 | #include <linux/init.h> | 15 | #include <linux/init.h> |
16 | #include <linux/interrupt.h> | 16 | #include <linux/interrupt.h> |
17 | #include <linux/platform_device.h> | 17 | #include <linux/platform_device.h> |
18 | |||
19 | #include <linux/of_platform.h> | ||
20 | #include <linux/of_device.h> | ||
21 | #include <linux/of_spi.h> | ||
22 | |||
18 | #include <linux/spi/spi.h> | 23 | #include <linux/spi/spi.h> |
19 | #include <linux/spi/spi_bitbang.h> | 24 | #include <linux/spi/spi_bitbang.h> |
20 | #include <linux/io.h> | 25 | #include <linux/io.h> |
21 | 26 | ||
22 | #include <syslib/virtex_devices.h> | ||
23 | |||
24 | #define XILINX_SPI_NAME "xilinx_spi" | 27 | #define XILINX_SPI_NAME "xilinx_spi" |
25 | 28 | ||
26 | /* Register definitions as per "OPB Serial Peripheral Interface (SPI) (v1.00e) | 29 | /* Register definitions as per "OPB Serial Peripheral Interface (SPI) (v1.00e) |
@@ -144,23 +147,14 @@ static int xilinx_spi_setup_transfer(struct spi_device *spi, | |||
144 | struct spi_transfer *t) | 147 | struct spi_transfer *t) |
145 | { | 148 | { |
146 | u8 bits_per_word; | 149 | u8 bits_per_word; |
147 | u32 hz; | ||
148 | struct xilinx_spi *xspi = spi_master_get_devdata(spi->master); | ||
149 | 150 | ||
150 | bits_per_word = (t) ? t->bits_per_word : spi->bits_per_word; | 151 | bits_per_word = (t) ? t->bits_per_word : spi->bits_per_word; |
151 | hz = (t) ? t->speed_hz : spi->max_speed_hz; | ||
152 | if (bits_per_word != 8) { | 152 | if (bits_per_word != 8) { |
153 | dev_err(&spi->dev, "%s, unsupported bits_per_word=%d\n", | 153 | dev_err(&spi->dev, "%s, unsupported bits_per_word=%d\n", |
154 | __func__, bits_per_word); | 154 | __func__, bits_per_word); |
155 | return -EINVAL; | 155 | return -EINVAL; |
156 | } | 156 | } |
157 | 157 | ||
158 | if (hz && xspi->speed_hz > hz) { | ||
159 | dev_err(&spi->dev, "%s, unsupported clock rate %uHz\n", | ||
160 | __func__, hz); | ||
161 | return -EINVAL; | ||
162 | } | ||
163 | |||
164 | return 0; | 158 | return 0; |
165 | } | 159 | } |
166 | 160 | ||
@@ -304,32 +298,38 @@ static irqreturn_t xilinx_spi_irq(int irq, void *dev_id) | |||
304 | return IRQ_HANDLED; | 298 | return IRQ_HANDLED; |
305 | } | 299 | } |
306 | 300 | ||
307 | static int __init xilinx_spi_probe(struct platform_device *dev) | 301 | static int __init xilinx_spi_of_probe(struct of_device *ofdev, |
302 | const struct of_device_id *match) | ||
308 | { | 303 | { |
309 | int ret = 0; | ||
310 | struct spi_master *master; | 304 | struct spi_master *master; |
311 | struct xilinx_spi *xspi; | 305 | struct xilinx_spi *xspi; |
312 | struct xspi_platform_data *pdata; | 306 | struct resource r_irq_struct; |
313 | struct resource *r; | 307 | struct resource r_mem_struct; |
308 | |||
309 | struct resource *r_irq = &r_irq_struct; | ||
310 | struct resource *r_mem = &r_mem_struct; | ||
311 | int rc = 0; | ||
312 | const u32 *prop; | ||
313 | int len; | ||
314 | 314 | ||
315 | /* Get resources(memory, IRQ) associated with the device */ | 315 | /* Get resources(memory, IRQ) associated with the device */ |
316 | master = spi_alloc_master(&dev->dev, sizeof(struct xilinx_spi)); | 316 | master = spi_alloc_master(&ofdev->dev, sizeof(struct xilinx_spi)); |
317 | 317 | ||
318 | if (master == NULL) { | 318 | if (master == NULL) { |
319 | return -ENOMEM; | 319 | return -ENOMEM; |
320 | } | 320 | } |
321 | 321 | ||
322 | platform_set_drvdata(dev, master); | 322 | dev_set_drvdata(&ofdev->dev, master); |
323 | pdata = dev->dev.platform_data; | ||
324 | 323 | ||
325 | if (pdata == NULL) { | 324 | rc = of_address_to_resource(ofdev->node, 0, r_mem); |
326 | ret = -ENODEV; | 325 | if (rc) { |
326 | dev_warn(&ofdev->dev, "invalid address\n"); | ||
327 | goto put_master; | 327 | goto put_master; |
328 | } | 328 | } |
329 | 329 | ||
330 | r = platform_get_resource(dev, IORESOURCE_MEM, 0); | 330 | rc = of_irq_to_resource(ofdev->node, 0, r_irq); |
331 | if (r == NULL) { | 331 | if (rc == NO_IRQ) { |
332 | ret = -ENODEV; | 332 | dev_warn(&ofdev->dev, "no IRQ found\n"); |
333 | goto put_master; | 333 | goto put_master; |
334 | } | 334 | } |
335 | 335 | ||
@@ -341,47 +341,57 @@ static int __init xilinx_spi_probe(struct platform_device *dev) | |||
341 | xspi->bitbang.master->setup = xilinx_spi_setup; | 341 | xspi->bitbang.master->setup = xilinx_spi_setup; |
342 | init_completion(&xspi->done); | 342 | init_completion(&xspi->done); |
343 | 343 | ||
344 | if (!request_mem_region(r->start, | 344 | xspi->irq = r_irq->start; |
345 | r->end - r->start + 1, XILINX_SPI_NAME)) { | 345 | |
346 | ret = -ENXIO; | 346 | if (!request_mem_region(r_mem->start, |
347 | r_mem->end - r_mem->start + 1, XILINX_SPI_NAME)) { | ||
348 | rc = -ENXIO; | ||
349 | dev_warn(&ofdev->dev, "memory request failure\n"); | ||
347 | goto put_master; | 350 | goto put_master; |
348 | } | 351 | } |
349 | 352 | ||
350 | xspi->regs = ioremap(r->start, r->end - r->start + 1); | 353 | xspi->regs = ioremap(r_mem->start, r_mem->end - r_mem->start + 1); |
351 | if (xspi->regs == NULL) { | 354 | if (xspi->regs == NULL) { |
352 | ret = -ENOMEM; | 355 | rc = -ENOMEM; |
356 | dev_warn(&ofdev->dev, "ioremap failure\n"); | ||
353 | goto put_master; | 357 | goto put_master; |
354 | } | 358 | } |
359 | xspi->irq = r_irq->start; | ||
355 | 360 | ||
356 | ret = platform_get_irq(dev, 0); | 361 | /* dynamic bus assignment */ |
357 | if (ret < 0) { | 362 | master->bus_num = -1; |
358 | ret = -ENXIO; | ||
359 | goto unmap_io; | ||
360 | } | ||
361 | xspi->irq = ret; | ||
362 | 363 | ||
363 | master->bus_num = pdata->bus_num; | 364 | /* number of slave select bits is required */ |
364 | master->num_chipselect = pdata->num_chipselect; | 365 | prop = of_get_property(ofdev->node, "xlnx,num-ss-bits", &len); |
365 | xspi->speed_hz = pdata->speed_hz; | 366 | if (!prop || len < sizeof(*prop)) { |
367 | dev_warn(&ofdev->dev, "no 'xlnx,num-ss-bits' property\n"); | ||
368 | goto put_master; | ||
369 | } | ||
370 | master->num_chipselect = *prop; | ||
366 | 371 | ||
367 | /* SPI controller initializations */ | 372 | /* SPI controller initializations */ |
368 | xspi_init_hw(xspi->regs); | 373 | xspi_init_hw(xspi->regs); |
369 | 374 | ||
370 | /* Register for SPI Interrupt */ | 375 | /* Register for SPI Interrupt */ |
371 | ret = request_irq(xspi->irq, xilinx_spi_irq, 0, XILINX_SPI_NAME, xspi); | 376 | rc = request_irq(xspi->irq, xilinx_spi_irq, 0, XILINX_SPI_NAME, xspi); |
372 | if (ret != 0) | 377 | if (rc != 0) { |
378 | dev_warn(&ofdev->dev, "irq request failure: %d\n", xspi->irq); | ||
373 | goto unmap_io; | 379 | goto unmap_io; |
380 | } | ||
374 | 381 | ||
375 | ret = spi_bitbang_start(&xspi->bitbang); | 382 | rc = spi_bitbang_start(&xspi->bitbang); |
376 | if (ret != 0) { | 383 | if (rc != 0) { |
377 | dev_err(&dev->dev, "spi_bitbang_start FAILED\n"); | 384 | dev_err(&ofdev->dev, "spi_bitbang_start FAILED\n"); |
378 | goto free_irq; | 385 | goto free_irq; |
379 | } | 386 | } |
380 | 387 | ||
381 | dev_info(&dev->dev, "at 0x%08X mapped to 0x%08X, irq=%d\n", | 388 | dev_info(&ofdev->dev, "at 0x%08X mapped to 0x%08X, irq=%d\n", |
382 | r->start, (u32)xspi->regs, xspi->irq); | 389 | (unsigned int)r_mem->start, (u32)xspi->regs, xspi->irq); |
383 | 390 | ||
384 | return ret; | 391 | /* Add any subnodes on the SPI bus */ |
392 | of_register_spi_devices(master, ofdev->node); | ||
393 | |||
394 | return rc; | ||
385 | 395 | ||
386 | free_irq: | 396 | free_irq: |
387 | free_irq(xspi->irq, xspi); | 397 | free_irq(xspi->irq, xspi); |
@@ -389,21 +399,21 @@ unmap_io: | |||
389 | iounmap(xspi->regs); | 399 | iounmap(xspi->regs); |
390 | put_master: | 400 | put_master: |
391 | spi_master_put(master); | 401 | spi_master_put(master); |
392 | return ret; | 402 | return rc; |
393 | } | 403 | } |
394 | 404 | ||
395 | static int __devexit xilinx_spi_remove(struct platform_device *dev) | 405 | static int __devexit xilinx_spi_remove(struct of_device *ofdev) |
396 | { | 406 | { |
397 | struct xilinx_spi *xspi; | 407 | struct xilinx_spi *xspi; |
398 | struct spi_master *master; | 408 | struct spi_master *master; |
399 | 409 | ||
400 | master = platform_get_drvdata(dev); | 410 | master = platform_get_drvdata(ofdev); |
401 | xspi = spi_master_get_devdata(master); | 411 | xspi = spi_master_get_devdata(master); |
402 | 412 | ||
403 | spi_bitbang_stop(&xspi->bitbang); | 413 | spi_bitbang_stop(&xspi->bitbang); |
404 | free_irq(xspi->irq, xspi); | 414 | free_irq(xspi->irq, xspi); |
405 | iounmap(xspi->regs); | 415 | iounmap(xspi->regs); |
406 | platform_set_drvdata(dev, 0); | 416 | dev_set_drvdata(&ofdev->dev, 0); |
407 | spi_master_put(xspi->bitbang.master); | 417 | spi_master_put(xspi->bitbang.master); |
408 | 418 | ||
409 | return 0; | 419 | return 0; |
@@ -412,27 +422,42 @@ static int __devexit xilinx_spi_remove(struct platform_device *dev) | |||
412 | /* work with hotplug and coldplug */ | 422 | /* work with hotplug and coldplug */ |
413 | MODULE_ALIAS("platform:" XILINX_SPI_NAME); | 423 | MODULE_ALIAS("platform:" XILINX_SPI_NAME); |
414 | 424 | ||
415 | static struct platform_driver xilinx_spi_driver = { | 425 | static int __exit xilinx_spi_of_remove(struct of_device *op) |
416 | .probe = xilinx_spi_probe, | 426 | { |
417 | .remove = __devexit_p(xilinx_spi_remove), | 427 | return xilinx_spi_remove(op); |
428 | } | ||
429 | |||
430 | static struct of_device_id xilinx_spi_of_match[] = { | ||
431 | { .compatible = "xlnx,xps-spi-2.00.a", }, | ||
432 | { .compatible = "xlnx,xps-spi-2.00.b", }, | ||
433 | {} | ||
434 | }; | ||
435 | |||
436 | MODULE_DEVICE_TABLE(of, xilinx_spi_of_match); | ||
437 | |||
438 | static struct of_platform_driver xilinx_spi_of_driver = { | ||
439 | .owner = THIS_MODULE, | ||
440 | .name = "xilinx-xps-spi", | ||
441 | .match_table = xilinx_spi_of_match, | ||
442 | .probe = xilinx_spi_of_probe, | ||
443 | .remove = __exit_p(xilinx_spi_of_remove), | ||
418 | .driver = { | 444 | .driver = { |
419 | .name = XILINX_SPI_NAME, | 445 | .name = "xilinx-xps-spi", |
420 | .owner = THIS_MODULE, | 446 | .owner = THIS_MODULE, |
421 | }, | 447 | }, |
422 | }; | 448 | }; |
423 | 449 | ||
424 | static int __init xilinx_spi_init(void) | 450 | static int __init xilinx_spi_init(void) |
425 | { | 451 | { |
426 | return platform_driver_register(&xilinx_spi_driver); | 452 | return of_register_platform_driver(&xilinx_spi_of_driver); |
427 | } | 453 | } |
428 | module_init(xilinx_spi_init); | 454 | module_init(xilinx_spi_init); |
429 | 455 | ||
430 | static void __exit xilinx_spi_exit(void) | 456 | static void __exit xilinx_spi_exit(void) |
431 | { | 457 | { |
432 | platform_driver_unregister(&xilinx_spi_driver); | 458 | of_unregister_platform_driver(&xilinx_spi_of_driver); |
433 | } | 459 | } |
434 | module_exit(xilinx_spi_exit); | 460 | module_exit(xilinx_spi_exit); |
435 | |||
436 | MODULE_AUTHOR("MontaVista Software, Inc. <source@mvista.com>"); | 461 | MODULE_AUTHOR("MontaVista Software, Inc. <source@mvista.com>"); |
437 | MODULE_DESCRIPTION("Xilinx SPI driver"); | 462 | MODULE_DESCRIPTION("Xilinx SPI driver"); |
438 | MODULE_LICENSE("GPL"); | 463 | MODULE_LICENSE("GPL"); |