drm/radeon/kms/pm: move pm state update to crtc functions
[safe/jmp/linux-2.6] / drivers / gpu / drm / radeon / radeon_bios.c
index 5572404..fbba938 100644 (file)
@@ -31,6 +31,7 @@
 #include "atom.h"
 
 #include <linux/vga_switcheroo.h>
+#include <linux/slab.h>
 /*
  * BIOS.
  */
@@ -84,12 +85,11 @@ static bool radeon_read_bios(struct radeon_device *rdev)
                pci_unmap_rom(rdev->pdev, bios);
                return false;
        }
-       rdev->bios = kmalloc(size, GFP_KERNEL);
+       rdev->bios = kmemdup(bios, size, GFP_KERNEL);
        if (rdev->bios == NULL) {
                pci_unmap_rom(rdev->pdev, bios);
                return false;
        }
-       memcpy(rdev->bios, bios, size);
        pci_unmap_rom(rdev->pdev, bios);
        return true;
 }