ChangeSet 1.2231.1.167, 2005/03/28 20:02:53-08:00, [EMAIL PROTECTED]
[PATCH] pcmcia: clean up suspend
Where suspend is implemented, all socket drivers set their socket state
to
"dead_socket" as the first thing in their suspend ops method. Factor
this
out to the core PCMCIA code.
This allows us to kill some suspend methods, and reduce the references
to
"dead_socket". Note that the suspend ops method is now optional.
Signed-off-by: Russell King <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
au1000_generic.c | 7 ++-----
cs.c | 4 +++-
hd64465_ss.c | 15 ---------------
i82092.c | 10 ----------
i82092aa.h | 1 -
i82365.c | 6 ------
m32r_cfc.c | 7 -------
m32r_pcc.c | 6 ------
pd6729.c | 6 ------
soc_common.c | 7 ++-----
tcic.c | 6 ------
vrc4171_card.c | 6 ------
vrc4173_cardu.c | 6 ------
yenta_socket.c | 2 --
14 files changed, 7 insertions(+), 82 deletions(-)
diff -Nru a/drivers/pcmcia/au1000_generic.c b/drivers/pcmcia/au1000_generic.c
--- a/drivers/pcmcia/au1000_generic.c 2005-03-28 21:43:21 -08:00
+++ b/drivers/pcmcia/au1000_generic.c 2005-03-28 21:43:21 -08:00
@@ -156,15 +156,12 @@
static int au1x00_pcmcia_suspend(struct pcmcia_socket *sock)
{
struct au1000_pcmcia_socket *skt = to_au1000_socket(sock);
- int ret;
debug("suspending socket %u\n", skt->nr);
- ret = au1x00_pcmcia_config_skt(skt, &dead_socket);
- if (ret == 0)
- skt->ops->socket_suspend(skt);
+ skt->ops->socket_suspend(skt);
- return ret;
+ return 0;
}
static DEFINE_SPINLOCK(status_lock);
diff -Nru a/drivers/pcmcia/cs.c b/drivers/pcmcia/cs.c
--- a/drivers/pcmcia/cs.c 2005-03-28 21:43:21 -08:00
+++ b/drivers/pcmcia/cs.c 2005-03-28 21:43:21 -08:00
@@ -565,7 +565,9 @@
send_event(skt, CS_EVENT_PM_SUSPEND, CS_EVENT_PRI_LOW);
skt->socket = dead_socket;
- skt->ops->suspend(skt);
+ skt->ops->set_socket(skt, &skt->socket);
+ if (skt->ops->suspend)
+ skt->ops->suspend(skt);
skt->state |= SOCKET_SUSPEND;
return CS_SUCCESS;
diff -Nru a/drivers/pcmcia/hd64465_ss.c b/drivers/pcmcia/hd64465_ss.c
--- a/drivers/pcmcia/hd64465_ss.c 2005-03-28 21:43:21 -08:00
+++ b/drivers/pcmcia/hd64465_ss.c 2005-03-28 21:43:21 -08:00
@@ -353,20 +353,6 @@
/*============================================================*/
-static int hs_suspend(struct pcmcia_socket *s)
-{
-#ifdef HD64465_DEBUG
- hs_socket_t *sp = container_of(s, struct hs_socket_t, socket);
- DPRINTK("hs_suspend(%d)\n", sp->number);
-#endif
-
- /* TODO */
-
- return 0;
-}
-
-/*============================================================*/
-
static int hs_get_status(struct pcmcia_socket *s, u_int *value)
{
@@ -763,7 +749,6 @@
static struct pccard_operations hs_operations = {
.init = hs_init,
- .suspend = hs_suspend,
.get_status = hs_get_status,
.get_socket = hs_get_socket,
.set_socket = hs_set_socket,
diff -Nru a/drivers/pcmcia/i82092.c b/drivers/pcmcia/i82092.c
--- a/drivers/pcmcia/i82092.c 2005-03-28 21:43:21 -08:00
+++ b/drivers/pcmcia/i82092.c 2005-03-28 21:43:21 -08:00
@@ -65,7 +65,6 @@
/* the pccard structure and its functions */
static struct pccard_operations i82092aa_operations = {
.init = i82092aa_init,
- .suspend = i82092aa_suspend,
.get_status = i82092aa_get_status,
.get_socket = i82092aa_get_socket,
.set_socket = i82092aa_set_socket,
@@ -440,15 +439,6 @@
return 0;
}
-static int i82092aa_suspend(struct pcmcia_socket *sock)
-{
- int retval;
- enter("i82092aa_suspend");
- retval = i82092aa_set_socket(sock, &dead_socket);
- leave("i82092aa_suspend");
- return retval;
-}
-
static int i82092aa_get_status(struct pcmcia_socket *socket, u_int *value)
{
unsigned int sock = container_of(socket, struct socket_info,
socket)->number;
diff -Nru a/drivers/pcmcia/i82092aa.h b/drivers/pcmcia/i82092aa.h
--- a/drivers/pcmcia/i82092aa.h 2005-03-28 21:43:21 -08:00
+++ b/drivers/pcmcia/i82092aa.h 2005-03-28 21:43:21 -08:00
@@ -34,7 +34,6 @@
static int i82092aa_set_io_map(struct pcmcia_socket *socket, struct
pccard_io_map *io);
static int i82092aa_set_mem_map(struct pcmcia_socket *socket, struct
pccard_mem_map *mem);
static int i82092aa_init(struct pcmcia_socket *socket);
-static int i82092aa_suspend(struct pcmcia_socket *socket);
#endif
diff -Nru a/drivers/pcmcia/i82365.c b/drivers/pcmcia/i82365.c
--- a/drivers/pcmcia/i82365.c 2005-03-28 21:43:21 -08:00
+++ b/drivers/pcmcia/i82365.c 2005-03-28 21:43:21 -08:00
@@ -1322,14 +1322,8 @@
return 0;
}
-static int pcic_suspend(struct pcmcia_socket *sock)
-{
- return pcic_set_socket(sock, &dead_socket);
-}
-
static struct pccard_operations pcic_operations = {
.init = pcic_init,
- .suspend = pcic_suspend,
.get_status = pcic_get_status,
.get_socket = pcic_get_socket,
.set_socket = pcic_set_socket,
diff -Nru a/drivers/pcmcia/m32r_cfc.c b/drivers/pcmcia/m32r_cfc.c
--- a/drivers/pcmcia/m32r_cfc.c 2005-03-28 21:43:21 -08:00
+++ b/drivers/pcmcia/m32r_cfc.c 2005-03-28 21:43:21 -08:00
@@ -732,15 +732,8 @@
return 0;
}
-static int pcc_suspend(struct pcmcia_socket *sock)
-{
- debug(3, "m32r_cfc: pcc_suspend()\n");
- return pcc_set_socket(sock, &dead_socket);
-}
-
static struct pccard_operations pcc_operations = {
.init = pcc_init,
- .suspend = pcc_suspend,
.get_status = pcc_get_status,
.get_socket = pcc_get_socket,
.set_socket = pcc_set_socket,
diff -Nru a/drivers/pcmcia/m32r_pcc.c b/drivers/pcmcia/m32r_pcc.c
--- a/drivers/pcmcia/m32r_pcc.c 2005-03-28 21:43:21 -08:00
+++ b/drivers/pcmcia/m32r_pcc.c 2005-03-28 21:43:21 -08:00
@@ -685,14 +685,8 @@
return 0;
}
-static int pcc_suspend(struct pcmcia_socket *sock)
-{
- return pcc_set_socket(sock, &dead_socket);
-}
-
static struct pccard_operations pcc_operations = {
.init = pcc_init,
- .suspend = pcc_suspend,
.get_status = pcc_get_status,
.get_socket = pcc_get_socket,
.set_socket = pcc_set_socket,
diff -Nru a/drivers/pcmcia/pd6729.c b/drivers/pcmcia/pd6729.c
--- a/drivers/pcmcia/pd6729.c 2005-03-28 21:43:21 -08:00
+++ b/drivers/pcmcia/pd6729.c 2005-03-28 21:43:21 -08:00
@@ -615,11 +615,6 @@
return 0;
}
-static int pd6729_suspend(struct pcmcia_socket *sock)
-{
- return pd6729_set_socket(sock, &dead_socket);
-}
-
static int pd6729_init(struct pcmcia_socket *sock)
{
int i;
@@ -644,7 +639,6 @@
/* the pccard structure and its functions */
static struct pccard_operations pd6729_operations = {
.init = pd6729_init,
- .suspend = pd6729_suspend,
.get_status = pd6729_get_status,
.get_socket = pd6729_get_socket,
.set_socket = pd6729_set_socket,
diff -Nru a/drivers/pcmcia/soc_common.c b/drivers/pcmcia/soc_common.c
--- a/drivers/pcmcia/soc_common.c 2005-03-28 21:43:21 -08:00
+++ b/drivers/pcmcia/soc_common.c 2005-03-28 21:43:21 -08:00
@@ -197,15 +197,12 @@
static int soc_common_pcmcia_suspend(struct pcmcia_socket *sock)
{
struct soc_pcmcia_socket *skt = to_soc_pcmcia_socket(sock);
- int ret;
debug(skt, 2, "suspending socket\n");
- ret = soc_common_pcmcia_config_skt(skt, &dead_socket);
- if (ret == 0)
- skt->ops->socket_suspend(skt);
+ skt->ops->socket_suspend(skt);
- return ret;
+ return 0;
}
static DEFINE_SPINLOCK(status_lock);
diff -Nru a/drivers/pcmcia/tcic.c b/drivers/pcmcia/tcic.c
--- a/drivers/pcmcia/tcic.c 2005-03-28 21:43:21 -08:00
+++ b/drivers/pcmcia/tcic.c 2005-03-28 21:43:21 -08:00
@@ -888,14 +888,8 @@
return 0;
}
-static int tcic_suspend(struct pcmcia_socket *sock)
-{
- return tcic_set_socket(sock, &dead_socket);
-}
-
static struct pccard_operations tcic_operations = {
.init = tcic_init,
- .suspend = tcic_suspend,
.get_status = tcic_get_status,
.get_socket = tcic_get_socket,
.set_socket = tcic_set_socket,
diff -Nru a/drivers/pcmcia/vrc4171_card.c b/drivers/pcmcia/vrc4171_card.c
--- a/drivers/pcmcia/vrc4171_card.c 2005-03-28 21:43:21 -08:00
+++ b/drivers/pcmcia/vrc4171_card.c 2005-03-28 21:43:21 -08:00
@@ -249,11 +249,6 @@
return 0;
}
-static int pccard_suspend(struct pcmcia_socket *sock)
-{
- return -EINVAL;
-}
-
static int pccard_get_status(struct pcmcia_socket *sock, u_int *value)
{
unsigned int slot;
@@ -554,7 +549,6 @@
static struct pccard_operations vrc4171_pccard_operations = {
.init = pccard_init,
- .suspend = pccard_suspend,
.get_status = pccard_get_status,
.get_socket = pccard_get_socket,
.set_socket = pccard_set_socket,
diff -Nru a/drivers/pcmcia/vrc4173_cardu.c b/drivers/pcmcia/vrc4173_cardu.c
--- a/drivers/pcmcia/vrc4173_cardu.c 2005-03-28 21:43:21 -08:00
+++ b/drivers/pcmcia/vrc4173_cardu.c 2005-03-28 21:43:21 -08:00
@@ -141,11 +141,6 @@
return 0;
}
-static int cardu_suspend(unsigned int slot)
-{
- return -EINVAL;
-}
-
static int cardu_register_callback(unsigned int sock,
void (*handler)(void *, unsigned
int),
void * info)
@@ -433,7 +428,6 @@
static struct pccard_operations cardu_operations = {
.init = cardu_init,
- .suspend = cardu_suspend,
.register_callback = cardu_register_callback,
.inquire_socket = cardu_inquire_socket,
.get_status = cardu_get_status,
diff -Nru a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c
--- a/drivers/pcmcia/yenta_socket.c 2005-03-28 21:43:21 -08:00
+++ b/drivers/pcmcia/yenta_socket.c 2005-03-28 21:43:21 -08:00
@@ -506,8 +506,6 @@
{
struct yenta_socket *socket = container_of(sock, struct yenta_socket,
socket);
- yenta_set_socket(sock, &dead_socket);
-
/* Disable CSC interrupts */
cb_writel(socket, CB_SOCKET_MASK, 0x0);
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html