diff options
author | Patrick Boettcher <pb@linuxtv.org> | 2006-05-14 12:29:48 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-06-25 01:00:33 -0400 |
commit | 976e3483799ce5f718753d67454378d46500f0da (patch) | |
tree | 5cea343af1ad3fb802bfef632422c82ac06c09a1 | |
parent | 9bbe076f364aa7ba8c2e49e417a76d628ffb164c (diff) |
V4L/DVB (4030): Minor code cleanup on the genpix-module
Minor code cleanup on the genpix-module.
Signed-off-by: Patrick Boettcher <pb@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r-- | drivers/media/dvb/dvb-usb/gp8psk.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/drivers/media/dvb/dvb-usb/gp8psk.c b/drivers/media/dvb/dvb-usb/gp8psk.c index d6771cbd262d..9a98f3fdae31 100644 --- a/drivers/media/dvb/dvb-usb/gp8psk.c +++ b/drivers/media/dvb/dvb-usb/gp8psk.c | |||
@@ -92,36 +92,38 @@ static int gp8psk_load_bcm4500fw(struct dvb_usb_device *d) | |||
92 | return ret; | 92 | return ret; |
93 | } | 93 | } |
94 | 94 | ||
95 | if (gp8psk_usb_out_op(d, LOAD_BCM4500,1,0,NULL, 0)) { | 95 | ret = -EINVAL; |
96 | release_firmware(fw); | 96 | |
97 | return -EINVAL; | 97 | if (gp8psk_usb_out_op(d, LOAD_BCM4500,1,0,NULL, 0)) |
98 | } | 98 | goto out_rel_fw; |
99 | 99 | ||
100 | info("downloaidng bcm4500 firmware from file '%s'",bcm4500_firmware); | 100 | info("downloaidng bcm4500 firmware from file '%s'",bcm4500_firmware); |
101 | 101 | ||
102 | ptr = fw->data; | 102 | ptr = fw->data; |
103 | buf = (u8 *) kmalloc(512, GFP_KERNEL | GFP_DMA); | 103 | buf = kmalloc(512, GFP_KERNEL | GFP_DMA); |
104 | 104 | ||
105 | while (ptr[0] != 0xff) { | 105 | while (ptr[0] != 0xff) { |
106 | u16 buflen = ptr[0] + 4; | 106 | u16 buflen = ptr[0] + 4; |
107 | if (ptr + buflen >= fw->data + fw->size) { | 107 | if (ptr + buflen >= fw->data + fw->size) { |
108 | err("failed to load bcm4500 firmware."); | 108 | err("failed to load bcm4500 firmware."); |
109 | release_firmware(fw); | 109 | goto out_free; |
110 | kfree(buf); | ||
111 | return -EINVAL; | ||
112 | } | 110 | } |
113 | memcpy(buf, ptr, buflen); | 111 | memcpy(buf, ptr, buflen); |
114 | if (dvb_usb_generic_write(d, buf, buflen)) { | 112 | if (dvb_usb_generic_write(d, buf, buflen)) { |
115 | err("failed to load bcm4500 firmware."); | 113 | err("failed to load bcm4500 firmware."); |
116 | release_firmware(fw); | 114 | goto out_free; |
117 | kfree(buf); | ||
118 | return -EIO; | ||
119 | } | 115 | } |
120 | ptr += buflen; | 116 | ptr += buflen; |
121 | } | 117 | } |
122 | release_firmware(fw); | 118 | |
119 | ret = 0; | ||
120 | |||
121 | out_free: | ||
123 | kfree(buf); | 122 | kfree(buf); |
124 | return 0; | 123 | out_rel_fw: |
124 | release_firmware(fw); | ||
125 | |||
126 | return ret; | ||
125 | } | 127 | } |
126 | 128 | ||
127 | static int gp8psk_power_ctrl(struct dvb_usb_device *d, int onoff) | 129 | static int gp8psk_power_ctrl(struct dvb_usb_device *d, int onoff) |