* [patch]small bug in PCMCIA on DB1x00 boards
@ 2005-02-21 15:09 Ulrich Eckhardt
2005-02-21 17:26 ` Pete Popov
0 siblings, 1 reply; 2+ messages in thread
From: Ulrich Eckhardt @ 2005-02-21 15:09 UTC (permalink / raw)
To: linux-mips; +Cc: ralf
Hello!
Another patch that fixes some small glitches in the PCMCIA code.
Note: I have not (yet) been able to get the compact-flash card to be
recognised on my board (it is supposed to appear as PCMCIA/IDE device,
right?) but this patch addresses three things that should be obvious without
testing. Yes, I know, those are famous last words, but look yourselves. ;)
BTW: I found that au1000_xxs1500.c and au1000_pb1x00.c can't compile due
changed PCMCIA interfaces, some functions (socket_state, configure_socket)
were changed from returning void to returning int and changed their
parameters. These two are also the last two files that use struct
pcmcia_configure. Maybe copying that struct to the .c files and adding an
#error with a proper comment would be a good idea?
Uli
Changes:
* removed struct pcmcia_irqs, which was unused
* added an explicit BUG() in a place marked with "should never happen"
* added a missing early return when the card-voltage could not be
detected, as a comment above already says.
---
Index: au1000_db1x00.c
===================================================================
RCS file: /home/cvs/linux/drivers/pcmcia/au1000_db1x00.c,v
retrieving revision 1.6
diff -u -r1.6 au1000_db1x00.c
--- au1000_db1x00.c 14 Oct 2004 06:24:25 -0000 1.6
+++ au1000_db1x00.c 21 Feb 2005 14:13:21 -0000
@@ -91,7 +91,9 @@
vs = (bcsr->status & 0xC)>>2;
inserted = !(bcsr->status & (1<<5));
break;
- default:/* should never happen */
+ default:
+ /* should never happen */
+ BUG();
return;
}
@@ -109,8 +111,8 @@
break;
default:
/* return without setting 'detect' */
- printk(KERN_ERR "db1x00 bad VS (%d)\n",
- vs);
+ printk(KERN_ERR "db1x00 bad VS (%d)\n", vs);
+ return;
}
state->detect = 1;
state->ready = 1;
Index: au1000_generic.h
===================================================================
RCS file: /home/cvs/linux/drivers/pcmcia/au1000_generic.h,v
retrieving revision 1.4
diff -u -r1.4 au1000_generic.h
--- au1000_generic.h 19 Oct 2004 07:26:37 -0000 1.4
+++ au1000_generic.h 21 Feb 2005 14:13:21 -0000
@@ -78,13 +78,6 @@
reset: 1;
};
-struct pcmcia_irqs {
- int sock;
- int irq;
- const char *str;
-};
-
-
struct au1000_pcmcia_socket {
struct pcmcia_socket socket;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [patch]small bug in PCMCIA on DB1x00 boards
2005-02-21 15:09 [patch]small bug in PCMCIA on DB1x00 boards Ulrich Eckhardt
@ 2005-02-21 17:26 ` Pete Popov
0 siblings, 0 replies; 2+ messages in thread
From: Pete Popov @ 2005-02-21 17:26 UTC (permalink / raw)
To: Ulrich Eckhardt; +Cc: linux-mips, ralf
Ulrich Eckhardt wrote:
> Hello!
>
> Another patch that fixes some small glitches in the PCMCIA code.
>
> Note: I have not (yet) been able to get the compact-flash card to be
> recognised on my board (it is supposed to appear as PCMCIA/IDE device,
> right?) but this patch addresses three things that should be obvious without
> testing. Yes, I know, those are famous last words, but look yourselves. ;)
>
> BTW: I found that au1000_xxs1500.c and au1000_pb1x00.c can't compile due
> changed PCMCIA interfaces,
I've updated the db1x00 driver only. It should be easy to update the
rest of the boards, using the db1x as an example.
Pete
some functions (socket_state, configure_socket)
> were changed from returning void to returning int and changed their
> parameters. These two are also the last two files that use struct
> pcmcia_configure. Maybe copying that struct to the .c files and adding an
> #error with a proper comment would be a good idea?
>
> Uli
>
>
> Changes:
> * removed struct pcmcia_irqs, which was unused
> * added an explicit BUG() in a place marked with "should never happen"
> * added a missing early return when the card-voltage could not be
> detected, as a comment above already says.
>
> ---
>
> Index: au1000_db1x00.c
> ===================================================================
> RCS file: /home/cvs/linux/drivers/pcmcia/au1000_db1x00.c,v
> retrieving revision 1.6
> diff -u -r1.6 au1000_db1x00.c
> --- au1000_db1x00.c 14 Oct 2004 06:24:25 -0000 1.6
> +++ au1000_db1x00.c 21 Feb 2005 14:13:21 -0000
> @@ -91,7 +91,9 @@
> vs = (bcsr->status & 0xC)>>2;
> inserted = !(bcsr->status & (1<<5));
> break;
> - default:/* should never happen */
> + default:
> + /* should never happen */
> + BUG();
> return;
> }
>
> @@ -109,8 +111,8 @@
> break;
> default:
> /* return without setting 'detect' */
> - printk(KERN_ERR "db1x00 bad VS (%d)\n",
> - vs);
> + printk(KERN_ERR "db1x00 bad VS (%d)\n", vs);
> + return;
> }
> state->detect = 1;
> state->ready = 1;
> Index: au1000_generic.h
> ===================================================================
> RCS file: /home/cvs/linux/drivers/pcmcia/au1000_generic.h,v
> retrieving revision 1.4
> diff -u -r1.4 au1000_generic.h
> --- au1000_generic.h 19 Oct 2004 07:26:37 -0000 1.4
> +++ au1000_generic.h 21 Feb 2005 14:13:21 -0000
> @@ -78,13 +78,6 @@
> reset: 1;
> };
>
> -struct pcmcia_irqs {
> - int sock;
> - int irq;
> - const char *str;
> -};
> -
> -
> struct au1000_pcmcia_socket {
> struct pcmcia_socket socket;
>
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-02-21 17:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-21 15:09 [patch]small bug in PCMCIA on DB1x00 boards Ulrich Eckhardt
2005-02-21 17:26 ` Pete Popov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox