aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/ibmasm
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
committerJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
commit8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch)
treea8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /drivers/misc/ibmasm
parent406089d01562f1e2bf9f089fd7637009ebaad589 (diff)
Patched in Tegra support.
Diffstat (limited to 'drivers/misc/ibmasm')
-rw-r--r--drivers/misc/ibmasm/command.c2
-rw-r--r--drivers/misc/ibmasm/dot_command.c2
-rw-r--r--drivers/misc/ibmasm/dot_command.h2
-rw-r--r--drivers/misc/ibmasm/event.c2
-rw-r--r--drivers/misc/ibmasm/heartbeat.c2
-rw-r--r--drivers/misc/ibmasm/i2o.h2
-rw-r--r--drivers/misc/ibmasm/ibmasm.h2
-rw-r--r--drivers/misc/ibmasm/ibmasmfs.c26
-rw-r--r--drivers/misc/ibmasm/lowlevel.c2
-rw-r--r--drivers/misc/ibmasm/lowlevel.h2
-rw-r--r--drivers/misc/ibmasm/module.c19
-rw-r--r--drivers/misc/ibmasm/r_heartbeat.c2
-rw-r--r--drivers/misc/ibmasm/remote.h2
-rw-r--r--drivers/misc/ibmasm/uart.c18
14 files changed, 48 insertions, 37 deletions
diff --git a/drivers/misc/ibmasm/command.c b/drivers/misc/ibmasm/command.c
index 7d56f45dee1..5c766b4fb23 100644
--- a/drivers/misc/ibmasm/command.c
+++ b/drivers/misc/ibmasm/command.c
@@ -18,7 +18,7 @@
18 * 18 *
19 * Copyright (C) IBM Corporation, 2004 19 * Copyright (C) IBM Corporation, 2004
20 * 20 *
21 * Author: Max Asbรถck <amax@us.ibm.com> 21 * Author: Max Asbck <amax@us.ibm.com>
22 * 22 *
23 */ 23 */
24 24
diff --git a/drivers/misc/ibmasm/dot_command.c b/drivers/misc/ibmasm/dot_command.c
index d7b2ca358b2..3dd2dfb8da1 100644
--- a/drivers/misc/ibmasm/dot_command.c
+++ b/drivers/misc/ibmasm/dot_command.c
@@ -17,7 +17,7 @@
17 * 17 *
18 * Copyright (C) IBM Corporation, 2004 18 * Copyright (C) IBM Corporation, 2004
19 * 19 *
20 * Author: Max Asbรถck <amax@us.ibm.com> 20 * Author: Max Asbck <amax@us.ibm.com>
21 * 21 *
22 */ 22 */
23 23
diff --git a/drivers/misc/ibmasm/dot_command.h b/drivers/misc/ibmasm/dot_command.h
index fc9fc9d4e08..6cbba1afef3 100644
--- a/drivers/misc/ibmasm/dot_command.h
+++ b/drivers/misc/ibmasm/dot_command.h
@@ -17,7 +17,7 @@
17 * 17 *
18 * Copyright (C) IBM Corporation, 2004 18 * Copyright (C) IBM Corporation, 2004
19 * 19 *
20 * Author: Max Asbรถck <amax@us.ibm.com> 20 * Author: Max Asbck <amax@us.ibm.com>
21 * 21 *
22 */ 22 */
23 23
diff --git a/drivers/misc/ibmasm/event.c b/drivers/misc/ibmasm/event.c
index 8e540f4e9d5..76bfda1ffaa 100644
--- a/drivers/misc/ibmasm/event.c
+++ b/drivers/misc/ibmasm/event.c
@@ -18,7 +18,7 @@
18 * 18 *
19 * Copyright (C) IBM Corporation, 2004 19 * Copyright (C) IBM Corporation, 2004
20 * 20 *
21 * Author: Max Asbรถck <amax@us.ibm.com> 21 * Author: Max Asbck <amax@us.ibm.com>
22 * 22 *
23 */ 23 */
24 24
diff --git a/drivers/misc/ibmasm/heartbeat.c b/drivers/misc/ibmasm/heartbeat.c
index 90746378f9b..1bc4306572a 100644
--- a/drivers/misc/ibmasm/heartbeat.c
+++ b/drivers/misc/ibmasm/heartbeat.c
@@ -18,7 +18,7 @@
18 * 18 *
19 * Copyright (C) IBM Corporation, 2004 19 * Copyright (C) IBM Corporation, 2004
20 * 20 *
21 * Author: Max Asbรถck <amax@us.ibm.com> 21 * Author: Max Asbck <amax@us.ibm.com>
22 * 22 *
23 */ 23 */
24 24
diff --git a/drivers/misc/ibmasm/i2o.h b/drivers/misc/ibmasm/i2o.h
index 2e9566dab2b..bf2c738d2b7 100644
--- a/drivers/misc/ibmasm/i2o.h
+++ b/drivers/misc/ibmasm/i2o.h
@@ -17,7 +17,7 @@
17 * 17 *
18 * Copyright (C) IBM Corporation, 2004 18 * Copyright (C) IBM Corporation, 2004
19 * 19 *
20 * Author: Max Asbรถck <amax@us.ibm.com> 20 * Author: Max Asbck <amax@us.ibm.com>
21 * 21 *
22 */ 22 */
23 23
diff --git a/drivers/misc/ibmasm/ibmasm.h b/drivers/misc/ibmasm/ibmasm.h
index 9b083448814..4d8a4e248b3 100644
--- a/drivers/misc/ibmasm/ibmasm.h
+++ b/drivers/misc/ibmasm/ibmasm.h
@@ -18,7 +18,7 @@
18 * 18 *
19 * Copyright (C) IBM Corporation, 2004 19 * Copyright (C) IBM Corporation, 2004
20 * 20 *
21 * Author: Max Asbรถck <amax@us.ibm.com> 21 * Author: Max Asbck <amax@us.ibm.com>
22 * 22 *
23 */ 23 */
24 24
diff --git a/drivers/misc/ibmasm/ibmasmfs.c b/drivers/misc/ibmasm/ibmasmfs.c
index 6673e578b3e..89947723a27 100644
--- a/drivers/misc/ibmasm/ibmasmfs.c
+++ b/drivers/misc/ibmasm/ibmasmfs.c
@@ -17,7 +17,7 @@
17 * 17 *
18 * Copyright (C) IBM Corporation, 2004 18 * Copyright (C) IBM Corporation, 2004
19 * 19 *
20 * Author: Max Asbรถck <amax@us.ibm.com> 20 * Author: Max Asbck <amax@us.ibm.com>
21 * 21 *
22 */ 22 */
23 23
@@ -87,7 +87,7 @@
87static LIST_HEAD(service_processors); 87static LIST_HEAD(service_processors);
88 88
89static struct inode *ibmasmfs_make_inode(struct super_block *sb, int mode); 89static struct inode *ibmasmfs_make_inode(struct super_block *sb, int mode);
90static void ibmasmfs_create_files (struct super_block *sb); 90static void ibmasmfs_create_files (struct super_block *sb, struct dentry *root);
91static int ibmasmfs_fill_super (struct super_block *sb, void *data, int silent); 91static int ibmasmfs_fill_super (struct super_block *sb, void *data, int silent);
92 92
93 93
@@ -114,6 +114,7 @@ static struct file_system_type ibmasmfs_type = {
114static int ibmasmfs_fill_super (struct super_block *sb, void *data, int silent) 114static int ibmasmfs_fill_super (struct super_block *sb, void *data, int silent)
115{ 115{
116 struct inode *root; 116 struct inode *root;
117 struct dentry *root_dentry;
117 118
118 sb->s_blocksize = PAGE_CACHE_SIZE; 119 sb->s_blocksize = PAGE_CACHE_SIZE;
119 sb->s_blocksize_bits = PAGE_CACHE_SHIFT; 120 sb->s_blocksize_bits = PAGE_CACHE_SHIFT;
@@ -128,11 +129,14 @@ static int ibmasmfs_fill_super (struct super_block *sb, void *data, int silent)
128 root->i_op = &simple_dir_inode_operations; 129 root->i_op = &simple_dir_inode_operations;
129 root->i_fop = ibmasmfs_dir_ops; 130 root->i_fop = ibmasmfs_dir_ops;
130 131
131 sb->s_root = d_make_root(root); 132 root_dentry = d_alloc_root(root);
132 if (!sb->s_root) 133 if (!root_dentry) {
134 iput(root);
133 return -ENOMEM; 135 return -ENOMEM;
136 }
137 sb->s_root = root_dentry;
134 138
135 ibmasmfs_create_files(sb); 139 ibmasmfs_create_files(sb, root_dentry);
136 return 0; 140 return 0;
137} 141}
138 142
@@ -500,6 +504,12 @@ static ssize_t r_heartbeat_file_write(struct file *file, const char __user *buf,
500 return 1; 504 return 1;
501} 505}
502 506
507static int remote_settings_file_open(struct inode *inode, struct file *file)
508{
509 file->private_data = inode->i_private;
510 return 0;
511}
512
503static int remote_settings_file_close(struct inode *inode, struct file *file) 513static int remote_settings_file_close(struct inode *inode, struct file *file)
504{ 514{
505 return 0; 515 return 0;
@@ -594,7 +604,7 @@ static const struct file_operations r_heartbeat_fops = {
594}; 604};
595 605
596static const struct file_operations remote_settings_fops = { 606static const struct file_operations remote_settings_fops = {
597 .open = simple_open, 607 .open = remote_settings_file_open,
598 .release = remote_settings_file_close, 608 .release = remote_settings_file_close,
599 .read = remote_settings_file_read, 609 .read = remote_settings_file_read,
600 .write = remote_settings_file_write, 610 .write = remote_settings_file_write,
@@ -602,7 +612,7 @@ static const struct file_operations remote_settings_fops = {
602}; 612};
603 613
604 614
605static void ibmasmfs_create_files (struct super_block *sb) 615static void ibmasmfs_create_files (struct super_block *sb, struct dentry *root)
606{ 616{
607 struct list_head *entry; 617 struct list_head *entry;
608 struct service_processor *sp; 618 struct service_processor *sp;
@@ -611,7 +621,7 @@ static void ibmasmfs_create_files (struct super_block *sb)
611 struct dentry *dir; 621 struct dentry *dir;
612 struct dentry *remote_dir; 622 struct dentry *remote_dir;
613 sp = list_entry(entry, struct service_processor, node); 623 sp = list_entry(entry, struct service_processor, node);
614 dir = ibmasmfs_create_dir(sb, sb->s_root, sp->dirname); 624 dir = ibmasmfs_create_dir(sb, root, sp->dirname);
615 if (!dir) 625 if (!dir)
616 continue; 626 continue;
617 627
diff --git a/drivers/misc/ibmasm/lowlevel.c b/drivers/misc/ibmasm/lowlevel.c
index 5319ea261c0..4b2398e27fd 100644
--- a/drivers/misc/ibmasm/lowlevel.c
+++ b/drivers/misc/ibmasm/lowlevel.c
@@ -17,7 +17,7 @@
17 * 17 *
18 * Copyright (C) IBM Corporation, 2004 18 * Copyright (C) IBM Corporation, 2004
19 * 19 *
20 * Author: Max Asbรถck <amax@us.ibm.com> 20 * Author: Max Asbck <amax@us.ibm.com>
21 * 21 *
22 */ 22 */
23 23
diff --git a/drivers/misc/ibmasm/lowlevel.h b/drivers/misc/ibmasm/lowlevel.h
index e97848f51b3..766766523a6 100644
--- a/drivers/misc/ibmasm/lowlevel.h
+++ b/drivers/misc/ibmasm/lowlevel.h
@@ -17,7 +17,7 @@
17 * 17 *
18 * Copyright (C) IBM Corporation, 2004 18 * Copyright (C) IBM Corporation, 2004
19 * 19 *
20 * Author: Max Asbรถck <amax@us.ibm.com> 20 * Author: Max Asbck <amax@us.ibm.com>
21 * 21 *
22 */ 22 */
23 23
diff --git a/drivers/misc/ibmasm/module.c b/drivers/misc/ibmasm/module.c
index 0346d87c5fe..a234d965243 100644
--- a/drivers/misc/ibmasm/module.c
+++ b/drivers/misc/ibmasm/module.c
@@ -18,7 +18,7 @@
18 * 18 *
19 * Copyright (C) IBM Corporation, 2004 19 * Copyright (C) IBM Corporation, 2004
20 * 20 *
21 * Author: Max Asbรถck <amax@us.ibm.com> 21 * Author: Max Asbck <amax@us.ibm.com>
22 * 22 *
23 * This driver is based on code originally written by Pete Reynolds 23 * This driver is based on code originally written by Pete Reynolds
24 * and others. 24 * and others.
@@ -62,7 +62,7 @@ module_param(ibmasm_debug, int , S_IRUGO | S_IWUSR);
62MODULE_PARM_DESC(ibmasm_debug, " Set debug mode on or off"); 62MODULE_PARM_DESC(ibmasm_debug, " Set debug mode on or off");
63 63
64 64
65static int ibmasm_init_one(struct pci_dev *pdev, const struct pci_device_id *id) 65static int __devinit ibmasm_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
66{ 66{
67 int result; 67 int result;
68 struct service_processor *sp; 68 struct service_processor *sp;
@@ -163,7 +163,7 @@ error_resources:
163 return result; 163 return result;
164} 164}
165 165
166static void ibmasm_remove_one(struct pci_dev *pdev) 166static void __devexit ibmasm_remove_one(struct pci_dev *pdev)
167{ 167{
168 struct service_processor *sp = (struct service_processor *)pci_get_drvdata(pdev); 168 struct service_processor *sp = (struct service_processor *)pci_get_drvdata(pdev);
169 169
@@ -198,7 +198,7 @@ static struct pci_driver ibmasm_driver = {
198 .name = DRIVER_NAME, 198 .name = DRIVER_NAME,
199 .id_table = ibmasm_pci_table, 199 .id_table = ibmasm_pci_table,
200 .probe = ibmasm_init_one, 200 .probe = ibmasm_init_one,
201 .remove = ibmasm_remove_one, 201 .remove = __devexit_p(ibmasm_remove_one),
202}; 202};
203 203
204static void __exit ibmasm_exit (void) 204static void __exit ibmasm_exit (void)
@@ -211,17 +211,18 @@ static void __exit ibmasm_exit (void)
211 211
212static int __init ibmasm_init(void) 212static int __init ibmasm_init(void)
213{ 213{
214 int result = pci_register_driver(&ibmasm_driver); 214 int result;
215 if (result)
216 return result;
217 215
218 result = ibmasmfs_register(); 216 result = ibmasmfs_register();
219 if (result) { 217 if (result) {
220 pci_unregister_driver(&ibmasm_driver);
221 err("Failed to register ibmasmfs file system"); 218 err("Failed to register ibmasmfs file system");
222 return result; 219 return result;
223 } 220 }
224 221 result = pci_register_driver(&ibmasm_driver);
222 if (result) {
223 ibmasmfs_unregister();
224 return result;
225 }
225 ibmasm_register_panic_notifier(); 226 ibmasm_register_panic_notifier();
226 info(DRIVER_DESC " version " DRIVER_VERSION " loaded"); 227 info(DRIVER_DESC " version " DRIVER_VERSION " loaded");
227 return 0; 228 return 0;
diff --git a/drivers/misc/ibmasm/r_heartbeat.c b/drivers/misc/ibmasm/r_heartbeat.c
index 232034f5da4..2de487ac788 100644
--- a/drivers/misc/ibmasm/r_heartbeat.c
+++ b/drivers/misc/ibmasm/r_heartbeat.c
@@ -16,7 +16,7 @@
16 * 16 *
17 * Copyright (C) IBM Corporation, 2004 17 * Copyright (C) IBM Corporation, 2004
18 * 18 *
19 * Author: Max Asbรถck <amax@us.ibm.com> 19 * Author: Max Asbck <amax@us.ibm.com>
20 * 20 *
21 */ 21 */
22 22
diff --git a/drivers/misc/ibmasm/remote.h b/drivers/misc/ibmasm/remote.h
index a7729ef76ac..00dbf1d4373 100644
--- a/drivers/misc/ibmasm/remote.h
+++ b/drivers/misc/ibmasm/remote.h
@@ -18,7 +18,7 @@
18 * 18 *
19 * Copyright (C) IBM Corporation, 2004 19 * Copyright (C) IBM Corporation, 2004
20 * 20 *
21 * Author: Max Asbรถck <amax@us.ibm.com> 21 * Author: Max Asbck <amax@us.ibm.com>
22 * 22 *
23 * Originally written by Pete Reynolds 23 * Originally written by Pete Reynolds
24 */ 24 */
diff --git a/drivers/misc/ibmasm/uart.c b/drivers/misc/ibmasm/uart.c
index 01e2b0d7e59..93baa350d69 100644
--- a/drivers/misc/ibmasm/uart.c
+++ b/drivers/misc/ibmasm/uart.c
@@ -18,7 +18,7 @@
18 * 18 *
19 * Copyright (C) IBM Corporation, 2004 19 * Copyright (C) IBM Corporation, 2004
20 * 20 *
21 * Author: Max Asbรถck <amax@us.ibm.com> 21 * Author: Max Asbck <amax@us.ibm.com>
22 * 22 *
23 */ 23 */
24 24
@@ -33,7 +33,7 @@
33 33
34void ibmasm_register_uart(struct service_processor *sp) 34void ibmasm_register_uart(struct service_processor *sp)
35{ 35{
36 struct uart_8250_port uart; 36 struct uart_port uport;
37 void __iomem *iomem_base; 37 void __iomem *iomem_base;
38 38
39 iomem_base = sp->base_address + SCOUT_COM_B_BASE; 39 iomem_base = sp->base_address + SCOUT_COM_B_BASE;
@@ -47,14 +47,14 @@ void ibmasm_register_uart(struct service_processor *sp)
47 return; 47 return;
48 } 48 }
49 49
50 memset(&uart, 0, sizeof(uart)); 50 memset(&uport, 0, sizeof(struct uart_port));
51 uart.port.irq = sp->irq; 51 uport.irq = sp->irq;
52 uart.port.uartclk = 3686400; 52 uport.uartclk = 3686400;
53 uart.port.flags = UPF_SHARE_IRQ; 53 uport.flags = UPF_SHARE_IRQ;
54 uart.port.iotype = UPIO_MEM; 54 uport.iotype = UPIO_MEM;
55 uart.port.membase = iomem_base; 55 uport.membase = iomem_base;
56 56
57 sp->serial_line = serial8250_register_8250_port(&uart); 57 sp->serial_line = serial8250_register_port(&uport);
58 if (sp->serial_line < 0) { 58 if (sp->serial_line < 0) {
59 dev_err(sp->dev, "Failed to register serial port\n"); 59 dev_err(sp->dev, "Failed to register serial port\n");
60 return; 60 return;