aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pnp/pnpbios/core.c
diff options
context:
space:
mode:
authorBjorn Helgaas <bjorn.helgaas@hp.com>2007-07-26 13:41:21 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-26 14:35:21 -0400
commit07d4e9af109221ab731c5aaf832e89776c64b013 (patch)
tree05d05620af7b1b009f48dbad5f38004b682db271 /drivers/pnp/pnpbios/core.c
parent9dd78466c956ac4b4f38e12032dc4249ccf57ad1 (diff)
PNP: fix up after Lindent
These are manual fixups after running Lindent. No functional change. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Cc: Len Brown <lenb@kernel.org> Cc: Adam Belay <ambx1@neo.rr.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/pnp/pnpbios/core.c')
-rw-r--r--drivers/pnp/pnpbios/core.c28
1 files changed, 13 insertions, 15 deletions
diff --git a/drivers/pnp/pnpbios/core.c b/drivers/pnp/pnpbios/core.c
index 21289cb13a3..3692a099b45 100644
--- a/drivers/pnp/pnpbios/core.c
+++ b/drivers/pnp/pnpbios/core.c
@@ -100,25 +100,24 @@ static struct completion unload_sem;
100/* 100/*
101 * (Much of this belongs in a shared routine somewhere) 101 * (Much of this belongs in a shared routine somewhere)
102 */ 102 */
103
104static int pnp_dock_event(int dock, struct pnp_docking_station_info *info) 103static int pnp_dock_event(int dock, struct pnp_docking_station_info *info)
105{ 104{
106 char *argv[3], **envp, *buf, *scratch; 105 char *argv[3], **envp, *buf, *scratch;
107 int i = 0, value; 106 int i = 0, value;
108 107
109 if (!current->fs->root) { 108 if (!current->fs->root)
110 return -EAGAIN; 109 return -EAGAIN;
111 } 110 if (!(envp = kcalloc(20, sizeof(char *), GFP_KERNEL)))
112 if (!(envp = kcalloc(20, sizeof(char *), GFP_KERNEL))) {
113 return -ENOMEM; 111 return -ENOMEM;
114 }
115 if (!(buf = kzalloc(256, GFP_KERNEL))) { 112 if (!(buf = kzalloc(256, GFP_KERNEL))) {
116 kfree(envp); 113 kfree(envp);
117 return -ENOMEM; 114 return -ENOMEM;
118 } 115 }
119 116
120 /* FIXME: if there are actual users of this, it should be integrated into 117 /* FIXME: if there are actual users of this, it should be
121 * the driver core and use the usual infrastructure like sysfs and uevents */ 118 * integrated into the driver core and use the usual infrastructure
119 * like sysfs and uevents
120 */
122 argv[0] = "/sbin/pnpbios"; 121 argv[0] = "/sbin/pnpbios";
123 argv[1] = "dock"; 122 argv[1] = "dock";
124 argv[2] = NULL; 123 argv[2] = NULL;
@@ -146,7 +145,7 @@ static int pnp_dock_event(int dock, struct pnp_docking_station_info *info)
146 info->location_id, info->serial, info->capabilities); 145 info->location_id, info->serial, info->capabilities);
147 envp[i] = NULL; 146 envp[i] = NULL;
148 147
149 value = call_usermodehelper(argv[0], argv, envp, UMH_WAIT_EXEC); 148 value = call_usermodehelper(argv [0], argv, envp, UMH_WAIT_EXEC);
150 kfree(buf); 149 kfree(buf);
151 kfree(envp); 150 kfree(envp);
152 return 0; 151 return 0;
@@ -159,6 +158,7 @@ static int pnp_dock_thread(void *unused)
159{ 158{
160 static struct pnp_docking_station_info now; 159 static struct pnp_docking_station_info now;
161 int docked = -1, d = 0; 160 int docked = -1, d = 0;
161
162 set_freezable(); 162 set_freezable();
163 while (!unloading) { 163 while (!unloading) {
164 int status; 164 int status;
@@ -203,7 +203,7 @@ static int pnp_dock_thread(void *unused)
203 complete_and_exit(&unload_sem, 0); 203 complete_and_exit(&unload_sem, 0);
204} 204}
205 205
206#endif /* CONFIG_HOTPLUG */ 206#endif /* CONFIG_HOTPLUG */
207 207
208static int pnpbios_get_resources(struct pnp_dev *dev, 208static int pnpbios_get_resources(struct pnp_dev *dev,
209 struct pnp_resource_table *res) 209 struct pnp_resource_table *res)
@@ -211,7 +211,6 @@ static int pnpbios_get_resources(struct pnp_dev *dev,
211 u8 nodenum = dev->number; 211 u8 nodenum = dev->number;
212 struct pnp_bios_node *node; 212 struct pnp_bios_node *node;
213 213
214 /* just in case */
215 if (!pnpbios_is_dynamic(dev)) 214 if (!pnpbios_is_dynamic(dev))
216 return -EPERM; 215 return -EPERM;
217 216
@@ -235,7 +234,6 @@ static int pnpbios_set_resources(struct pnp_dev *dev,
235 struct pnp_bios_node *node; 234 struct pnp_bios_node *node;
236 int ret; 235 int ret;
237 236
238 /* just in case */
239 if (!pnpbios_is_dynamic(dev)) 237 if (!pnpbios_is_dynamic(dev))
240 return -EPERM; 238 return -EPERM;
241 239
@@ -263,6 +261,7 @@ static void pnpbios_zero_data_stream(struct pnp_bios_node *node)
263 unsigned char *end = (char *)(node->data + node->size); 261 unsigned char *end = (char *)(node->data + node->size);
264 unsigned int len; 262 unsigned int len;
265 int i; 263 int i;
264
266 while ((char *)p < (char *)end) { 265 while ((char *)p < (char *)end) {
267 if (p[0] & 0x80) { /* large tag */ 266 if (p[0] & 0x80) { /* large tag */
268 len = (p[2] << 8) | p[1]; 267 len = (p[2] << 8) | p[1];
@@ -287,7 +286,6 @@ static int pnpbios_disable_resources(struct pnp_dev *dev)
287 u8 nodenum = dev->number; 286 u8 nodenum = dev->number;
288 int ret; 287 int ret;
289 288
290 /* just in case */
291 if (dev->flags & PNPBIOS_NO_DISABLE || !pnpbios_is_dynamic(dev)) 289 if (dev->flags & PNPBIOS_NO_DISABLE || !pnpbios_is_dynamic(dev))
292 return -EPERM; 290 return -EPERM;
293 291
@@ -418,8 +416,8 @@ static void __init build_devlist(void)
418 * 416 *
419 */ 417 */
420 418
421static int pnpbios_disabled; /* = 0 */ 419static int pnpbios_disabled;
422int pnpbios_dont_use_current_config; /* = 0 */ 420int pnpbios_dont_use_current_config;
423 421
424#ifndef MODULE 422#ifndef MODULE
425static int __init pnpbios_setup(char *str) 423static int __init pnpbios_setup(char *str)
@@ -551,7 +549,7 @@ static int __init pnpbios_init(void)
551 printk(KERN_INFO "PnPBIOS: Disabled by ACPI PNP\n"); 549 printk(KERN_INFO "PnPBIOS: Disabled by ACPI PNP\n");
552 return -ENODEV; 550 return -ENODEV;
553 } 551 }
554#endif /* CONFIG_ACPI */ 552#endif /* CONFIG_ACPI */
555 553
556 /* scan the system for pnpbios support */ 554 /* scan the system for pnpbios support */
557 if (!pnpbios_probe_system()) 555 if (!pnpbios_probe_system())