diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2008-07-28 13:44:05 -0400 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2008-08-02 12:56:49 -0400 |
commit | 53efec9513cfb1acff602c7ebdd945d677808e9e (patch) | |
tree | 6bf9d0475d0be0829348096442d505001c027017 /drivers/pcmcia/socket_sysfs.c | |
parent | 6e86841d05f371b5b9b86ce76c02aaee83352298 (diff) |
pcmcia: only copy CIS override data once
Instead of copying CIS override data in socket_sysfs.c or ds.c, and then again
in cistpl.c, only do so once. Also, cisdump_t is now only used by the
deprecated ioctl.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/pcmcia/socket_sysfs.c')
-rw-r--r-- | drivers/pcmcia/socket_sysfs.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/pcmcia/socket_sysfs.c b/drivers/pcmcia/socket_sysfs.c index 006a29e91d83..ff9a3bb3c88d 100644 --- a/drivers/pcmcia/socket_sysfs.c +++ b/drivers/pcmcia/socket_sysfs.c | |||
@@ -316,27 +316,18 @@ static ssize_t pccard_store_cis(struct kobject *kobj, | |||
316 | char *buf, loff_t off, size_t count) | 316 | char *buf, loff_t off, size_t count) |
317 | { | 317 | { |
318 | struct pcmcia_socket *s = to_socket(container_of(kobj, struct device, kobj)); | 318 | struct pcmcia_socket *s = to_socket(container_of(kobj, struct device, kobj)); |
319 | cisdump_t *cis; | ||
320 | int error; | 319 | int error; |
321 | 320 | ||
322 | if (off) | 321 | if (off) |
323 | return -EINVAL; | 322 | return -EINVAL; |
324 | 323 | ||
325 | if (count >= 0x200) | 324 | if (count >= CISTPL_MAX_CIS_SIZE) |
326 | return -EINVAL; | 325 | return -EINVAL; |
327 | 326 | ||
328 | if (!(s->state & SOCKET_PRESENT)) | 327 | if (!(s->state & SOCKET_PRESENT)) |
329 | return -ENODEV; | 328 | return -ENODEV; |
330 | 329 | ||
331 | cis = kzalloc(sizeof(cisdump_t), GFP_KERNEL); | 330 | error = pcmcia_replace_cis(s, buf, count); |
332 | if (!cis) | ||
333 | return -ENOMEM; | ||
334 | |||
335 | cis->Length = count + 1; | ||
336 | memcpy(cis->Data, buf, count); | ||
337 | |||
338 | error = pcmcia_replace_cis(s, cis); | ||
339 | kfree(cis); | ||
340 | if (error) | 331 | if (error) |
341 | return -EIO; | 332 | return -EIO; |
342 | 333 | ||