aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/tifm_7xx1.c
diff options
context:
space:
mode:
authorAlex Dubov <oakad@yahoo.com>2007-04-12 02:59:14 -0400
committerPierre Ossman <drzeus@drzeus.cx>2007-05-01 07:04:13 -0400
commite23f2b8a1a52c00f0150659eb0bfde3a73976ffe (patch)
treecd12f24c3b414e01929c323d23dd86e8bc5384f0 /drivers/misc/tifm_7xx1.c
parent8dc4a61eca31dd45a9d45f9bc9c67d959f0f6cbd (diff)
tifm: simplify bus match and uevent handlers
Remove code duplicating the kernel functionality and clean up data structures involved in driver matching. Signed-off-by: Alex Dubov <oakad@yahoo.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Diffstat (limited to 'drivers/misc/tifm_7xx1.c')
-rw-r--r--drivers/misc/tifm_7xx1.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/misc/tifm_7xx1.c b/drivers/misc/tifm_7xx1.c
index d6652b3301dc..fd7b8dadc821 100644
--- a/drivers/misc/tifm_7xx1.c
+++ b/drivers/misc/tifm_7xx1.c
@@ -73,7 +73,7 @@ static irqreturn_t tifm_7xx1_isr(int irq, void *dev_id)
73 return IRQ_HANDLED; 73 return IRQ_HANDLED;
74} 74}
75 75
76static tifm_media_id tifm_7xx1_toggle_sock_power(char __iomem *sock_addr, 76static unsigned char tifm_7xx1_toggle_sock_power(char __iomem *sock_addr,
77 int is_x2) 77 int is_x2)
78{ 78{
79 unsigned int s_state; 79 unsigned int s_state;
@@ -90,7 +90,7 @@ static tifm_media_id tifm_7xx1_toggle_sock_power(char __iomem *sock_addr,
90 90
91 s_state = readl(sock_addr + SOCK_PRESENT_STATE); 91 s_state = readl(sock_addr + SOCK_PRESENT_STATE);
92 if (!(TIFM_SOCK_STATE_OCCUPIED & s_state)) 92 if (!(TIFM_SOCK_STATE_OCCUPIED & s_state))
93 return FM_NULL; 93 return 0;
94 94
95 if (is_x2) { 95 if (is_x2) {
96 writel((s_state & 7) | 0x0c00, sock_addr + SOCK_CONTROL); 96 writel((s_state & 7) | 0x0c00, sock_addr + SOCK_CONTROL);
@@ -129,7 +129,7 @@ static int tifm_7xx1_switch_media(void *data)
129{ 129{
130 struct tifm_adapter *fm = data; 130 struct tifm_adapter *fm = data;
131 unsigned long flags; 131 unsigned long flags;
132 tifm_media_id media_id; 132 unsigned char media_id;
133 char *card_name = "xx"; 133 char *card_name = "xx";
134 int cnt, rc; 134 int cnt, rc;
135 struct tifm_dev *sock; 135 struct tifm_dev *sock;
@@ -184,7 +184,7 @@ static int tifm_7xx1_switch_media(void *data)
184 if (sock) { 184 if (sock) {
185 sock->addr = tifm_7xx1_sock_addr(fm->addr, 185 sock->addr = tifm_7xx1_sock_addr(fm->addr,
186 cnt); 186 cnt);
187 sock->media_id = media_id; 187 sock->type = media_id;
188 sock->socket_id = cnt; 188 sock->socket_id = cnt;
189 switch (media_id) { 189 switch (media_id) {
190 case 1: 190 case 1:
@@ -266,7 +266,7 @@ static int tifm_7xx1_resume(struct pci_dev *dev)
266 struct tifm_adapter *fm = pci_get_drvdata(dev); 266 struct tifm_adapter *fm = pci_get_drvdata(dev);
267 int cnt, rc; 267 int cnt, rc;
268 unsigned long flags; 268 unsigned long flags;
269 tifm_media_id new_ids[fm->num_sockets]; 269 unsigned char new_ids[fm->num_sockets];
270 270
271 pci_set_power_state(dev, PCI_D0); 271 pci_set_power_state(dev, PCI_D0);
272 pci_restore_state(dev); 272 pci_restore_state(dev);
@@ -285,10 +285,10 @@ static int tifm_7xx1_resume(struct pci_dev *dev)
285 fm->socket_change_set = 0; 285 fm->socket_change_set = 0;
286 for (cnt = 0; cnt < fm->num_sockets; cnt++) { 286 for (cnt = 0; cnt < fm->num_sockets; cnt++) {
287 if (fm->sockets[cnt]) { 287 if (fm->sockets[cnt]) {
288 if (fm->sockets[cnt]->media_id == new_ids[cnt]) 288 if (fm->sockets[cnt]->type == new_ids[cnt])
289 fm->socket_change_set |= 1 << cnt; 289 fm->socket_change_set |= 1 << cnt;
290 290
291 fm->sockets[cnt]->media_id = new_ids[cnt]; 291 fm->sockets[cnt]->type = new_ids[cnt];
292 } 292 }
293 } 293 }
294 294