]> err.no Git - linux-2.6/blobdiff - drivers/video/metronomefb.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland...
[linux-2.6] / drivers / video / metronomefb.c
index 17066dd5a1901d521ce7e6e98dfb3da5e3742445..cc4c038a1b3f3c8c22821aab37a54f564ba41d8b 100644 (file)
@@ -206,8 +206,7 @@ static int load_waveform(u8 *mem, size_t size, u8 *metromem, int m, int t,
        }
 
        /* check waveform mode table address checksum */
-       wmta = le32_to_cpu(get_unaligned((__le32 *) wfm_hdr->wmta));
-       wmta &= 0x00FFFFFF;
+       wmta = get_unaligned_le32(wfm_hdr->wmta) & 0x00FFFFFF;
        cksum_idx = wmta + m*4 + 3;
        if (cksum_idx > size)
                return -EINVAL;
@@ -219,8 +218,7 @@ static int load_waveform(u8 *mem, size_t size, u8 *metromem, int m, int t,
        }
 
        /* check waveform temperature table address checksum */
-       tta = le32_to_cpu(get_unaligned((int *) (mem + wmta + m*4)));
-       tta &= 0x00FFFFFF;
+       tta = get_unaligned_le32(mem + wmta + m * 4) & 0x00FFFFFF;
        cksum_idx = tta + trn*4 + 3;
        if (cksum_idx > size)
                return -EINVAL;
@@ -233,8 +231,7 @@ static int load_waveform(u8 *mem, size_t size, u8 *metromem, int m, int t,
 
        /* here we do the real work of putting the waveform into the
        metromem buffer. this does runlength decoding of the waveform */
-       wfm_idx = le32_to_cpu(get_unaligned((__le32 *) (mem + tta + trn*4)));
-       wfm_idx &= 0x00FFFFFF;
+       wfm_idx = get_unaligned_le32(mem + tta + trn * 4) & 0x00FFFFFF;
        owfm_idx = wfm_idx;
        if (wfm_idx > size)
                return -EINVAL;
@@ -671,14 +668,14 @@ static int __devinit metronomefb_probe(struct platform_device *dev)
 
        retval = load_waveform((u8 *) fw_entry->data, fw_entry->size,
                                par->metromem_wfm, 3, 31, &par->frame_count);
+       release_firmware(fw_entry);
        if (retval < 0) {
                printk(KERN_ERR "metronomefb: couldn't process waveform\n");
-               goto err_ld_wfm;
+               goto err_dma_free;
        }
-       release_firmware(fw_entry);
 
        if (board->setup_irq(info))
-               goto err_ld_wfm;
+               goto err_dma_free;
 
        retval = metronome_init_regs(par);
        if (retval < 0)
@@ -719,8 +716,6 @@ err_fb_rel:
        framebuffer_release(info);
 err_free_irq:
        board->free_irq(info);
-err_ld_wfm:
-       release_firmware(fw_entry);
 err_dma_free:
        dma_free_writecombine(&dev->dev, par->metromemsize, par->metromem,
                                par->metromem_dma);