Commit cfe963fa authored by Dominik Brodowski's avatar Dominik Brodowski Committed by Linus Torvalds

[PATCH] pcmcia: remove dev_info from client

Remove the dev_info - contained name from struct client_t
Signed-off-by: default avatarDominik Brodowski <linux@brodo.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 6c2034db
...@@ -1530,6 +1530,7 @@ int pcmcia_request_irq(client_handle_t handle, irq_req_t *req) ...@@ -1530,6 +1530,7 @@ int pcmcia_request_irq(client_handle_t handle, irq_req_t *req)
struct pcmcia_socket *s; struct pcmcia_socket *s;
config_t *c; config_t *c;
int ret = CS_IN_USE, irq = 0; int ret = CS_IN_USE, irq = 0;
struct pcmcia_device *p_dev = handle_to_pdev(handle);
if (CHECK_HANDLE(handle)) if (CHECK_HANDLE(handle))
return CS_BAD_HANDLE; return CS_BAD_HANDLE;
...@@ -1579,7 +1580,7 @@ int pcmcia_request_irq(client_handle_t handle, irq_req_t *req) ...@@ -1579,7 +1580,7 @@ int pcmcia_request_irq(client_handle_t handle, irq_req_t *req)
((req->Attributes & IRQ_TYPE_DYNAMIC_SHARING) || ((req->Attributes & IRQ_TYPE_DYNAMIC_SHARING) ||
(s->functions > 1) || (s->functions > 1) ||
(irq == s->pci_irq)) ? SA_SHIRQ : 0, (irq == s->pci_irq)) ? SA_SHIRQ : 0,
handle->dev_info, req->Instance)) p_dev->dev.bus_id, req->Instance))
return CS_IN_USE; return CS_IN_USE;
} }
......
...@@ -221,8 +221,10 @@ int pcmcia_report_error(client_handle_t handle, error_info_t *err) ...@@ -221,8 +221,10 @@ int pcmcia_report_error(client_handle_t handle, error_info_t *err)
if (CHECK_HANDLE(handle)) if (CHECK_HANDLE(handle))
printk(KERN_NOTICE); printk(KERN_NOTICE);
else else {
printk(KERN_NOTICE "%s: ", handle->dev_info); struct pcmcia_device *p_dev = handle_to_pdev(handle);
printk(KERN_NOTICE "%s: ", p_dev->dev.bus_id);
}
for (i = 0; i < ARRAY_SIZE(service_table); i++) for (i = 0; i < ARRAY_SIZE(service_table); i++)
if (service_table[i].key == err->func) if (service_table[i].key == err->func)
...@@ -608,7 +610,6 @@ static int bind_request(struct pcmcia_bus_socket *s, bind_info_t *bind_info) ...@@ -608,7 +610,6 @@ static int bind_request(struct pcmcia_bus_socket *s, bind_info_t *bind_info)
p_dev->client.Socket = s->parent; p_dev->client.Socket = s->parent;
p_dev->client.Function = bind_info->function; p_dev->client.Function = bind_info->function;
p_dev->client.state = CLIENT_UNBOUND; p_dev->client.state = CLIENT_UNBOUND;
strlcpy(p_dev->client.dev_info, p_drv->drv.name, DEV_NAME_LEN);
ret = device_register(&p_dev->dev); ret = device_register(&p_dev->dev);
if (ret) { if (ret) {
...@@ -683,14 +684,22 @@ int pcmcia_register_client(client_handle_t *handle, client_reg_t *req) ...@@ -683,14 +684,22 @@ int pcmcia_register_client(client_handle_t *handle, client_reg_t *req)
continue; continue;
spin_lock_irqsave(&pcmcia_dev_list_lock, flags); spin_lock_irqsave(&pcmcia_dev_list_lock, flags);
list_for_each_entry(p_dev, &skt->devices_list, socket_device_list) { list_for_each_entry(p_dev, &skt->devices_list, socket_device_list) {
if ((p_dev->client.state & CLIENT_UNBOUND) && struct pcmcia_driver *p_drv;
(!strcmp(p_dev->client.dev_info, (char *)req->dev_info))) {
p_dev = pcmcia_get_dev(p_dev); p_dev = pcmcia_get_dev(p_dev);
if (p_dev) if (!p_dev)
continue;
if ((!p_dev->client.state & CLIENT_UNBOUND) ||
(!p_dev->dev.driver)) {
pcmcia_put_dev(p_dev);
continue;
}
p_drv = to_pcmcia_drv(p_dev->dev.driver);
if (!strncmp(p_drv->drv.name, (char *)req->dev_info, DEV_NAME_LEN)) {
client = &p_dev->client; client = &p_dev->client;
spin_unlock_irqrestore(&pcmcia_dev_list_lock, flags); spin_unlock_irqrestore(&pcmcia_dev_list_lock, flags);
goto found; goto found;
} }
pcmcia_put_dev(p_dev);
} }
spin_unlock_irqrestore(&pcmcia_dev_list_lock, flags); spin_unlock_irqrestore(&pcmcia_dev_list_lock, flags);
pcmcia_put_bus_socket(skt); pcmcia_put_bus_socket(skt);
...@@ -733,7 +742,7 @@ int pcmcia_register_client(client_handle_t *handle, client_reg_t *req) ...@@ -733,7 +742,7 @@ int pcmcia_register_client(client_handle_t *handle, client_reg_t *req)
} }
ds_dbg(1, "register_client(): client 0x%p, dev %s\n", ds_dbg(1, "register_client(): client 0x%p, dev %s\n",
client, client->dev_info); client, p_dev->dev.bus_id);
if (client->EventMask & CS_EVENT_REGISTRATION_COMPLETE) if (client->EventMask & CS_EVENT_REGISTRATION_COMPLETE)
EVENT(client, CS_EVENT_REGISTRATION_COMPLETE, CS_EVENT_PRI_LOW); EVENT(client, CS_EVENT_REGISTRATION_COMPLETE, CS_EVENT_PRI_LOW);
......
...@@ -162,7 +162,6 @@ struct pcmcia_device { ...@@ -162,7 +162,6 @@ struct pcmcia_device {
u_short client_magic; u_short client_magic;
struct pcmcia_socket *Socket; struct pcmcia_socket *Socket;
u_char Function; u_char Function;
dev_info_t dev_info;
u_int state; u_int state;
event_t EventMask; event_t EventMask;
int (*event_handler) (event_t event, int priority, int (*event_handler) (event_t event, int priority,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment