lkml.org 
[lkml]   [2003]   [Feb]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH, updated] Re: stuff-up in pcmcia/cardbus stuff
On Tue, Feb 18, 2003 at 04:23:45AM -0500, Jeff Garzik wrote:
> Dominik Brodowski wrote:
> >Indeed. socket->pcmcia_socket (old) == socket->cls_d.s_info[0] (new)
>
> If this is true...
<snip>
>
> 2) why are multiple s_info records allocated, when you hardcode use of
> record #0 ?

Indeed, the allocation of MAX_SOCK_PER_DEV s_info[] pointers is pointless.

Dominik

diff -ruN linux-original/drivers/pcmcia/cs.c linux-pcmcia/drivers/pcmcia/cs.c
--- linux-original/drivers/pcmcia/cs.c 2003-02-18 09:08:00.000000000 +0100
+++ linux-pcmcia/drivers/pcmcia/cs.c 2003-02-18 23:10:56.000000000 +0100
@@ -330,11 +330,12 @@
return -ENOMEM;
memset(s_info, 0, cls_d->nsock * sizeof(socket_info_t));

+ cls_d->s_info = s_info;
+
/* socket initialization */
for (i = 0; i < cls_d->nsock; i++) {
socket_info_t *s = &s_info[i];

- cls_d->s_info[i] = s;
s->ss_entry = cls_d->ops;
s->sock = i;

diff -ruN linux-original/drivers/pcmcia/pci_socket.c linux-pcmcia/drivers/pcmcia/pci_socket.c
--- linux-original/drivers/pcmcia/pci_socket.c 2003-02-18 22:54:34.000000000 +0100
+++ linux-pcmcia/drivers/pcmcia/pci_socket.c 2003-02-18 23:10:10.000000000 +0100
@@ -230,14 +230,16 @@
static int cardbus_suspend (struct pci_dev *dev, u32 state)
{
pci_socket_t *socket = pci_get_drvdata(dev);
- pcmcia_suspend_socket (socket->pcmcia_socket);
+ if (socket && socket->cls_d.s_info)
+ pcmcia_suspend_socket (socket->cls_d.s_info);
return 0;
}

static int cardbus_resume (struct pci_dev *dev)
{
pci_socket_t *socket = pci_get_drvdata(dev);
- pcmcia_resume_socket (socket->pcmcia_socket);
+ if (socket && socket->cls_d.s_info)
+ pcmcia_resume_socket (socket->cls_d.s_info);
return 0;
}

diff -ruN linux-original/drivers/pcmcia/pci_socket.h linux-pcmcia/drivers/pcmcia/pci_socket.h
--- linux-original/drivers/pcmcia/pci_socket.h 2003-02-18 22:54:34.000000000 +0100
+++ linux-pcmcia/drivers/pcmcia/pci_socket.h 2003-02-18 23:10:42.000000000 +0100
@@ -20,7 +20,6 @@
socket_cap_t cap;
spinlock_t event_lock;
unsigned int events;
- struct socket_info_t *pcmcia_socket;
struct work_struct tq_task;
struct timer_list poll_timer;

diff -ruN linux-original/include/pcmcia/ss.h linux-pcmcia/include/pcmcia/ss.h
--- linux-original/include/pcmcia/ss.h 2003-02-18 09:08:02.000000000 +0100
+++ linux-pcmcia/include/pcmcia/ss.h 2003-02-18 23:09:55.000000000 +0100
@@ -144,12 +144,10 @@
* Calls to set up low-level "Socket Services" drivers
*/

-#define MAX_SOCKETS_PER_DEV 8
-
struct pcmcia_socket_class_data {
unsigned int nsock; /* number of sockets */
struct pccard_operations *ops; /* see above */
- void *s_info[MAX_SOCKETS_PER_DEV]; /* socket_info_t */
+ void *s_info; /* socket_info_t */
unsigned int use_bus_pm;
};

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 13:33    [W:0.037 / U:25.668 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site