aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia/ds.c
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2008-07-28 13:44:05 -0400
committerDominik Brodowski <linux@dominikbrodowski.net>2008-08-02 12:56:49 -0400
commit53efec9513cfb1acff602c7ebdd945d677808e9e (patch)
tree6bf9d0475d0be0829348096442d505001c027017 /drivers/pcmcia/ds.c
parent6e86841d05f371b5b9b86ce76c02aaee83352298 (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/ds.c')
-rw-r--r--drivers/pcmcia/ds.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index 4174d9656e35..2382341975e5 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -854,7 +854,6 @@ static int pcmcia_load_firmware(struct pcmcia_device *dev, char * filename)
854 int ret = -ENOMEM; 854 int ret = -ENOMEM;
855 int no_funcs; 855 int no_funcs;
856 int old_funcs; 856 int old_funcs;
857 cisdump_t *cis;
858 cistpl_longlink_mfc_t mfc; 857 cistpl_longlink_mfc_t mfc;
859 858
860 if (!filename) 859 if (!filename)
@@ -877,16 +876,7 @@ static int pcmcia_load_firmware(struct pcmcia_device *dev, char * filename)
877 goto release; 876 goto release;
878 } 877 }
879 878
880 cis = kzalloc(sizeof(cisdump_t), GFP_KERNEL); 879 if (!pcmcia_replace_cis(s, fw->data, fw->size))
881 if (!cis) {
882 ret = -ENOMEM;
883 goto release;
884 }
885
886 cis->Length = fw->size + 1;
887 memcpy(cis->Data, fw->data, fw->size);
888
889 if (!pcmcia_replace_cis(s, cis))
890 ret = 0; 880 ret = 0;
891 else { 881 else {
892 printk(KERN_ERR "pcmcia: CIS override failed\n"); 882 printk(KERN_ERR "pcmcia: CIS override failed\n");