summaryrefslogtreecommitdiffstats
path: root/drivers/pnp/isapnp
diff options
context:
space:
mode:
authorBjorn Helgaas <bjorn.helgaas@hp.com>2007-07-26 10:41:21 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-26 11:35:21 -0700
commit07d4e9af109221ab731c5aaf832e89776c64b013 (patch)
tree05d05620af7b1b009f48dbad5f38004b682db271 /drivers/pnp/isapnp
parent9dd78466c956ac4b4f38e12032dc4249ccf57ad1 (diff)
downloadop-kernel-dev-07d4e9af109221ab731c5aaf832e89776c64b013.zip
op-kernel-dev-07d4e9af109221ab731c5aaf832e89776c64b013.tar.gz
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/isapnp')
-rw-r--r--drivers/pnp/isapnp/compat.c23
-rw-r--r--drivers/pnp/isapnp/core.c30
-rw-r--r--drivers/pnp/isapnp/proc.c7
3 files changed, 20 insertions, 40 deletions
diff --git a/drivers/pnp/isapnp/compat.c b/drivers/pnp/isapnp/compat.c
index aaf45e3..10bdcc4 100644
--- a/drivers/pnp/isapnp/compat.c
+++ b/drivers/pnp/isapnp/compat.c
@@ -3,11 +3,8 @@
* the old isapnp APIs. If possible use the new APIs instead.
*
* Copyright 2002 Adam Belay <ambx1@neo.rr.com>
- *
*/
-/* TODO: see if more isapnp functions are needed here */
-
#include <linux/module.h>
#include <linux/isapnp.h>
#include <linux/string.h>
@@ -19,16 +16,17 @@ static void pnp_convert_id(char *buf, unsigned short vendor,
'A' + ((vendor >> 2) & 0x3f) - 1,
'A' + (((vendor & 3) << 3) | ((vendor >> 13) & 7)) - 1,
'A' + ((vendor >> 8) & 0x1f) - 1,
- (device >> 4) & 0x0f,
- device & 0x0f, (device >> 12) & 0x0f, (device >> 8) & 0x0f);
+ (device >> 4) & 0x0f, device & 0x0f,
+ (device >> 12) & 0x0f, (device >> 8) & 0x0f);
}
-struct pnp_card *pnp_find_card(unsigned short vendor,
- unsigned short device, struct pnp_card *from)
+struct pnp_card *pnp_find_card(unsigned short vendor, unsigned short device,
+ struct pnp_card *from)
{
char id[8];
char any[8];
struct list_head *list;
+
pnp_convert_id(id, vendor, device);
pnp_convert_id(any, ISAPNP_ANY_ID, ISAPNP_ANY_ID);
@@ -36,6 +34,7 @@ struct pnp_card *pnp_find_card(unsigned short vendor,
while (list != &pnp_cards) {
struct pnp_card *card = global_to_pnp_card(list);
+
if (compare_pnp_id(card->id, id) || (memcmp(id, any, 7) == 0))
return card;
list = list->next;
@@ -43,12 +42,12 @@ struct pnp_card *pnp_find_card(unsigned short vendor,
return NULL;
}
-struct pnp_dev *pnp_find_dev(struct pnp_card *card,
- unsigned short vendor,
+struct pnp_dev *pnp_find_dev(struct pnp_card *card, unsigned short vendor,
unsigned short function, struct pnp_dev *from)
{
char id[8];
char any[8];
+
pnp_convert_id(id, vendor, function);
pnp_convert_id(any, ISAPNP_ANY_ID, ISAPNP_ANY_ID);
if (card == NULL) { /* look for a logical device from all cards */
@@ -60,8 +59,9 @@ struct pnp_dev *pnp_find_dev(struct pnp_card *card,
while (list != &pnp_global) {
struct pnp_dev *dev = global_to_pnp_dev(list);
- if (compare_pnp_id(dev->id, id)
- || (memcmp(id, any, 7) == 0))
+
+ if (compare_pnp_id(dev->id, id) ||
+ (memcmp(id, any, 7) == 0))
return dev;
list = list->next;
}
@@ -76,6 +76,7 @@ struct pnp_dev *pnp_find_dev(struct pnp_card *card,
}
while (list != &card->devices) {
struct pnp_dev *dev = card_to_pnp_dev(list);
+
if (compare_pnp_id(dev->id, id))
return dev;
list = list->next;
diff --git a/drivers/pnp/isapnp/core.c b/drivers/pnp/isapnp/core.c
index 0d690a7..b4e2aa9 100644
--- a/drivers/pnp/isapnp/core.c
+++ b/drivers/pnp/isapnp/core.c
@@ -252,7 +252,6 @@ static inline void isapnp_set_rdp(void)
* Perform an isolation. The port selection code now tries to avoid
* "dangerous to read" ports.
*/
-
static int __init isapnp_isolate_rdp_select(void)
{
isapnp_wait();
@@ -281,7 +280,6 @@ static int __init isapnp_isolate_rdp_select(void)
/*
* Isolate (assign uniqued CSN) to all ISA PnP devices.
*/
-
static int __init isapnp_isolate(void)
{
unsigned char checksum = 0x6a;
@@ -352,7 +350,6 @@ static int __init isapnp_isolate(void)
/*
* Read one tag from stream.
*/
-
static int __init isapnp_read_tag(unsigned char *type, unsigned short *size)
{
unsigned char tag, tmp[2];
@@ -380,7 +377,6 @@ static int __init isapnp_read_tag(unsigned char *type, unsigned short *size)
/*
* Skip specified number of bytes from stream.
*/
-
static void __init isapnp_skip_bytes(int count)
{
isapnp_peek(NULL, count);
@@ -389,11 +385,11 @@ static void __init isapnp_skip_bytes(int count)
/*
* Parse EISA id.
*/
-
static void isapnp_parse_id(struct pnp_dev *dev, unsigned short vendor,
unsigned short device)
{
struct pnp_id *id;
+
if (!dev)
return;
id = kzalloc(sizeof(struct pnp_id), GFP_KERNEL);
@@ -411,7 +407,6 @@ static void isapnp_parse_id(struct pnp_dev *dev, unsigned short vendor,
/*
* Parse logical device tag.
*/
-
static struct pnp_dev *__init isapnp_parse_device(struct pnp_card *card,
int size, int number)
{
@@ -440,7 +435,6 @@ static struct pnp_dev *__init isapnp_parse_device(struct pnp_card *card,
/*
* Add IRQ resource to resources list.
*/
-
static void __init isapnp_parse_irq_resource(struct pnp_option *option,
int size)
{
@@ -459,13 +453,11 @@ static void __init isapnp_parse_irq_resource(struct pnp_option *option,
else
irq->flags = IORESOURCE_IRQ_HIGHEDGE;
pnp_register_irq_resource(option, irq);
- return;
}
/*
* Add DMA resource to resources list.
*/
-
static void __init isapnp_parse_dma_resource(struct pnp_option *option,
int size)
{
@@ -479,13 +471,11 @@ static void __init isapnp_parse_dma_resource(struct pnp_option *option,
dma->map = tmp[0];
dma->flags = tmp[1];
pnp_register_dma_resource(option, dma);
- return;
}
/*
* Add port resource to resources list.
*/
-
static void __init isapnp_parse_port_resource(struct pnp_option *option,
int size)
{
@@ -502,13 +492,11 @@ static void __init isapnp_parse_port_resource(struct pnp_option *option,
port->size = tmp[6];
port->flags = tmp[0] ? PNP_PORT_FLAG_16BITADDR : 0;
pnp_register_port_resource(option, port);
- return;
}
/*
* Add fixed port resource to resources list.
*/
-
static void __init isapnp_parse_fixed_port_resource(struct pnp_option *option,
int size)
{
@@ -524,13 +512,11 @@ static void __init isapnp_parse_fixed_port_resource(struct pnp_option *option,
port->align = 0;
port->flags = PNP_PORT_FLAG_FIXED;
pnp_register_port_resource(option, port);
- return;
}
/*
* Add memory resource to resources list.
*/
-
static void __init isapnp_parse_mem_resource(struct pnp_option *option,
int size)
{
@@ -547,13 +533,11 @@ static void __init isapnp_parse_mem_resource(struct pnp_option *option,
mem->size = ((tmp[8] << 8) | tmp[7]) << 8;
mem->flags = tmp[0];
pnp_register_mem_resource(option, mem);
- return;
}
/*
* Add 32-bit memory resource to resources list.
*/
-
static void __init isapnp_parse_mem32_resource(struct pnp_option *option,
int size)
{
@@ -577,7 +561,6 @@ static void __init isapnp_parse_mem32_resource(struct pnp_option *option,
/*
* Add 32-bit fixed memory resource to resources list.
*/
-
static void __init isapnp_parse_fixed_mem32_resource(struct pnp_option *option,
int size)
{
@@ -599,7 +582,6 @@ static void __init isapnp_parse_fixed_mem32_resource(struct pnp_option *option,
/*
* Parse card name for ISA PnP device.
*/
-
static void __init
isapnp_parse_name(char *name, unsigned int name_max, unsigned short *size)
{
@@ -619,7 +601,6 @@ isapnp_parse_name(char *name, unsigned int name_max, unsigned short *size)
/*
* Parse resource map for logical device.
*/
-
static int __init isapnp_create_device(struct pnp_card *card,
unsigned short size)
{
@@ -627,6 +608,7 @@ static int __init isapnp_create_device(struct pnp_card *card,
unsigned char type, tmp[17];
struct pnp_option *option;
struct pnp_dev *dev;
+
if ((dev = isapnp_parse_device(card, size, number++)) == NULL)
return 1;
option = pnp_register_independent_option(dev);
@@ -761,7 +743,6 @@ static int __init isapnp_create_device(struct pnp_card *card,
/*
* Parse resource map for ISA PnP card.
*/
-
static void __init isapnp_parse_resource_map(struct pnp_card *card)
{
unsigned char type, tmp[17];
@@ -816,7 +797,6 @@ static void __init isapnp_parse_resource_map(struct pnp_card *card)
/*
* Compute ISA PnP checksum for first eight bytes.
*/
-
static unsigned char __init isapnp_checksum(unsigned char *data)
{
int i, j;
@@ -839,11 +819,11 @@ static unsigned char __init isapnp_checksum(unsigned char *data)
/*
* Parse EISA id for ISA PnP card.
*/
-
static void isapnp_parse_card_id(struct pnp_card *card, unsigned short vendor,
unsigned short device)
{
struct pnp_id *id = kzalloc(sizeof(struct pnp_id), GFP_KERNEL);
+
if (!id)
return;
sprintf(id->id, "%c%c%c%x%x%x%x",
@@ -858,7 +838,6 @@ static void isapnp_parse_card_id(struct pnp_card *card, unsigned short vendor,
/*
* Build device list for all present ISA PnP devices.
*/
-
static int __init isapnp_build_device_list(void)
{
int csn;
@@ -911,6 +890,7 @@ static int __init isapnp_build_device_list(void)
int isapnp_present(void)
{
struct pnp_card *card;
+
pnp_for_each_card(card) {
if (card->protocol == &isapnp_protocol)
return 1;
@@ -953,7 +933,7 @@ int isapnp_cfg_end(void)
}
/*
- * Inititialization.
+ * Initialization.
*/
EXPORT_SYMBOL(isapnp_protocol);
diff --git a/drivers/pnp/isapnp/proc.c b/drivers/pnp/isapnp/proc.c
index fba4b07..3fbc0f9 100644
--- a/drivers/pnp/isapnp/proc.c
+++ b/drivers/pnp/isapnp/proc.c
@@ -2,7 +2,6 @@
* ISA Plug & Play support
* Copyright (c) by Jaroslav Kysela <perex@suse.cz>
*
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -16,7 +15,6 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
*/
#include <linux/module.h>
@@ -139,11 +137,12 @@ static int __exit isapnp_proc_detach_bus(struct pnp_card *bus)
remove_proc_entry(name, isapnp_proc_bus_dir);
return 0;
}
-#endif /* MODULE */
+#endif /* MODULE */
int __init isapnp_proc_init(void)
{
struct pnp_dev *dev;
+
isapnp_proc_bus_dir = proc_mkdir("isapnp", proc_bus);
protocol_for_each_dev(&isapnp_protocol, dev) {
isapnp_proc_attach_device(dev);
@@ -167,4 +166,4 @@ int __exit isapnp_proc_done(void)
remove_proc_entry("isapnp", proc_bus);
return 0;
}
-#endif /* MODULE */
+#endif /* MODULE */
OpenPOWER on IntegriCloud