diff options
author | Bjorn Helgaas <bjorn.helgaas@hp.com> | 2007-07-26 13:41:20 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-26 14:35:20 -0400 |
commit | 9dd78466c956ac4b4f38e12032dc4249ccf57ad1 (patch) | |
tree | 57ee3822b79049d38c1df952fe77e72a97c718f3 /drivers/pnp/core.c | |
parent | 8ec3cf7d29aef773eee5bc6cd9b0fa4d3fb42480 (diff) |
PNP: Lindent all source files
Run Lindent on all PNP source files.
Produced by:
$ quilt new pnp-lindent
$ find drivers/pnp -name \*.[ch] | xargs quilt add
$ quilt add include/linux/{pnp.h,pnpbios.h}
$ scripts/Lindent drivers/pnp/*.c drivers/pnp/*/*.c include/linux/pnp*.h
$ quilt refresh --sort
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/core.c')
-rw-r--r-- | drivers/pnp/core.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/drivers/pnp/core.c b/drivers/pnp/core.c index 8e7b2dd38810..1dfdc325211d 100644 --- a/drivers/pnp/core.c +++ b/drivers/pnp/core.c | |||
@@ -18,7 +18,6 @@ | |||
18 | 18 | ||
19 | #include "base.h" | 19 | #include "base.h" |
20 | 20 | ||
21 | |||
22 | static LIST_HEAD(pnp_protocols); | 21 | static LIST_HEAD(pnp_protocols); |
23 | LIST_HEAD(pnp_global); | 22 | LIST_HEAD(pnp_global); |
24 | DEFINE_SPINLOCK(pnp_lock); | 23 | DEFINE_SPINLOCK(pnp_lock); |
@@ -36,7 +35,7 @@ void *pnp_alloc(long size) | |||
36 | void *result; | 35 | void *result; |
37 | 36 | ||
38 | result = kzalloc(size, GFP_KERNEL); | 37 | result = kzalloc(size, GFP_KERNEL); |
39 | if (!result){ | 38 | if (!result) { |
40 | printk(KERN_ERR "pnp: Out of Memory\n"); | 39 | printk(KERN_ERR "pnp: Out of Memory\n"); |
41 | return NULL; | 40 | return NULL; |
42 | } | 41 | } |
@@ -53,7 +52,7 @@ void *pnp_alloc(long size) | |||
53 | int pnp_register_protocol(struct pnp_protocol *protocol) | 52 | int pnp_register_protocol(struct pnp_protocol *protocol) |
54 | { | 53 | { |
55 | int nodenum; | 54 | int nodenum; |
56 | struct list_head * pos; | 55 | struct list_head *pos; |
57 | 56 | ||
58 | if (!protocol) | 57 | if (!protocol) |
59 | return -EINVAL; | 58 | return -EINVAL; |
@@ -64,9 +63,9 @@ int pnp_register_protocol(struct pnp_protocol *protocol) | |||
64 | spin_lock(&pnp_lock); | 63 | spin_lock(&pnp_lock); |
65 | 64 | ||
66 | /* assign the lowest unused number */ | 65 | /* assign the lowest unused number */ |
67 | list_for_each(pos,&pnp_protocols) { | 66 | list_for_each(pos, &pnp_protocols) { |
68 | struct pnp_protocol * cur = to_pnp_protocol(pos); | 67 | struct pnp_protocol *cur = to_pnp_protocol(pos); |
69 | if (cur->number == nodenum){ | 68 | if (cur->number == nodenum) { |
70 | pos = &pnp_protocols; | 69 | pos = &pnp_protocols; |
71 | nodenum++; | 70 | nodenum++; |
72 | } | 71 | } |
@@ -93,11 +92,10 @@ void pnp_unregister_protocol(struct pnp_protocol *protocol) | |||
93 | device_unregister(&protocol->dev); | 92 | device_unregister(&protocol->dev); |
94 | } | 93 | } |
95 | 94 | ||
96 | |||
97 | static void pnp_free_ids(struct pnp_dev *dev) | 95 | static void pnp_free_ids(struct pnp_dev *dev) |
98 | { | 96 | { |
99 | struct pnp_id * id; | 97 | struct pnp_id *id; |
100 | struct pnp_id * next; | 98 | struct pnp_id *next; |
101 | if (!dev) | 99 | if (!dev) |
102 | return; | 100 | return; |
103 | id = dev->id; | 101 | id = dev->id; |
@@ -110,7 +108,7 @@ static void pnp_free_ids(struct pnp_dev *dev) | |||
110 | 108 | ||
111 | static void pnp_release_device(struct device *dmdev) | 109 | static void pnp_release_device(struct device *dmdev) |
112 | { | 110 | { |
113 | struct pnp_dev * dev = to_pnp_dev(dmdev); | 111 | struct pnp_dev *dev = to_pnp_dev(dmdev); |
114 | pnp_free_option(dev->independent); | 112 | pnp_free_option(dev->independent); |
115 | pnp_free_option(dev->dependent); | 113 | pnp_free_option(dev->dependent); |
116 | pnp_free_ids(dev); | 114 | pnp_free_ids(dev); |
@@ -149,7 +147,8 @@ int pnp_add_device(struct pnp_dev *dev) | |||
149 | if (!dev || !dev->protocol || dev->card) | 147 | if (!dev || !dev->protocol || dev->card) |
150 | return -EINVAL; | 148 | return -EINVAL; |
151 | dev->dev.parent = &dev->protocol->dev; | 149 | dev->dev.parent = &dev->protocol->dev; |
152 | sprintf(dev->dev.bus_id, "%02x:%02x", dev->protocol->number, dev->number); | 150 | sprintf(dev->dev.bus_id, "%02x:%02x", dev->protocol->number, |
151 | dev->number); | ||
153 | return __pnp_add_device(dev); | 152 | return __pnp_add_device(dev); |
154 | } | 153 | } |
155 | 154 | ||
@@ -175,7 +174,7 @@ void pnp_remove_device(struct pnp_dev *dev) | |||
175 | return; | 174 | return; |
176 | __pnp_remove_device(dev); | 175 | __pnp_remove_device(dev); |
177 | } | 176 | } |
178 | #endif /* 0 */ | 177 | #endif /* 0 */ |
179 | 178 | ||
180 | static int __init pnp_init(void) | 179 | static int __init pnp_init(void) |
181 | { | 180 | { |
@@ -190,4 +189,4 @@ EXPORT_SYMBOL(pnp_register_protocol); | |||
190 | EXPORT_SYMBOL(pnp_unregister_protocol); | 189 | EXPORT_SYMBOL(pnp_unregister_protocol); |
191 | EXPORT_SYMBOL(pnp_add_device); | 190 | EXPORT_SYMBOL(pnp_add_device); |
192 | EXPORT_SYMBOL(pnp_remove_device); | 191 | EXPORT_SYMBOL(pnp_remove_device); |
193 | #endif /* 0 */ | 192 | #endif /* 0 */ |