summaryrefslogtreecommitdiffstats
path: root/drivers/pnp/core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pnp/core.c')
-rw-r--r--drivers/pnp/core.c25
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 @@
#include "base.h"
-
static LIST_HEAD(pnp_protocols);
LIST_HEAD(pnp_global);
DEFINE_SPINLOCK(pnp_lock);
@@ -36,7 +35,7 @@ void *pnp_alloc(long size)
void *result;
result = kzalloc(size, GFP_KERNEL);
- if (!result){
+ if (!result) {
printk(KERN_ERR "pnp: Out of Memory\n");
return NULL;
}
@@ -53,7 +52,7 @@ void *pnp_alloc(long size)
int pnp_register_protocol(struct pnp_protocol *protocol)
{
int nodenum;
- struct list_head * pos;
+ struct list_head *pos;
if (!protocol)
return -EINVAL;
@@ -64,9 +63,9 @@ int pnp_register_protocol(struct pnp_protocol *protocol)
spin_lock(&pnp_lock);
/* assign the lowest unused number */
- list_for_each(pos,&pnp_protocols) {
- struct pnp_protocol * cur = to_pnp_protocol(pos);
- if (cur->number == nodenum){
+ list_for_each(pos, &pnp_protocols) {
+ struct pnp_protocol *cur = to_pnp_protocol(pos);
+ if (cur->number == nodenum) {
pos = &pnp_protocols;
nodenum++;
}
@@ -93,11 +92,10 @@ void pnp_unregister_protocol(struct pnp_protocol *protocol)
device_unregister(&protocol->dev);
}
-
static void pnp_free_ids(struct pnp_dev *dev)
{
- struct pnp_id * id;
- struct pnp_id * next;
+ struct pnp_id *id;
+ struct pnp_id *next;
if (!dev)
return;
id = dev->id;
@@ -110,7 +108,7 @@ static void pnp_free_ids(struct pnp_dev *dev)
static void pnp_release_device(struct device *dmdev)
{
- struct pnp_dev * dev = to_pnp_dev(dmdev);
+ struct pnp_dev *dev = to_pnp_dev(dmdev);
pnp_free_option(dev->independent);
pnp_free_option(dev->dependent);
pnp_free_ids(dev);
@@ -149,7 +147,8 @@ int pnp_add_device(struct pnp_dev *dev)
if (!dev || !dev->protocol || dev->card)
return -EINVAL;
dev->dev.parent = &dev->protocol->dev;
- sprintf(dev->dev.bus_id, "%02x:%02x", dev->protocol->number, dev->number);
+ sprintf(dev->dev.bus_id, "%02x:%02x", dev->protocol->number,
+ dev->number);
return __pnp_add_device(dev);
}
@@ -175,7 +174,7 @@ void pnp_remove_device(struct pnp_dev *dev)
return;
__pnp_remove_device(dev);
}
-#endif /* 0 */
+#endif /* 0 */
static int __init pnp_init(void)
{
@@ -190,4 +189,4 @@ EXPORT_SYMBOL(pnp_register_protocol);
EXPORT_SYMBOL(pnp_unregister_protocol);
EXPORT_SYMBOL(pnp_add_device);
EXPORT_SYMBOL(pnp_remove_device);
-#endif /* 0 */
+#endif /* 0 */