aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/au1100fb.c
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2012-04-08 15:48:52 -0400
committerJiri Kosina <jkosina@suse.cz>2012-04-08 15:48:52 -0400
commite75d660672ddd11704b7f0fdb8ff21968587b266 (patch)
treeccb9c107744c10b553c0373e450bee3971d16c00 /drivers/video/au1100fb.c
parent61282f37927143e45b03153f3e7b48d6b702147a (diff)
parent0034102808e0dbbf3a2394b82b1bb40b5778de9e (diff)
Merge branch 'master' into for-next
Merge with latest Linus' tree, as I have incoming patches that fix code that is newer than current HEAD of for-next. Conflicts: drivers/net/ethernet/realtek/r8169.c
Diffstat (limited to 'drivers/video/au1100fb.c')
-rw-r--r--drivers/video/au1100fb.c32
1 files changed, 12 insertions, 20 deletions
diff --git a/drivers/video/au1100fb.c b/drivers/video/au1100fb.c
index 4da189562a3..15a6749b98e 100644
--- a/drivers/video/au1100fb.c
+++ b/drivers/video/au1100fb.c
@@ -477,7 +477,8 @@ static int __devinit au1100fb_drv_probe(struct platform_device *dev)
477 u32 sys_clksrc; 477 u32 sys_clksrc;
478 478
479 /* Allocate new device private */ 479 /* Allocate new device private */
480 fbdev = kzalloc(sizeof(struct au1100fb_device), GFP_KERNEL); 480 fbdev = devm_kzalloc(&dev->dev, sizeof(struct au1100fb_device),
481 GFP_KERNEL);
481 if (!fbdev) { 482 if (!fbdev) {
482 print_err("fail to allocate device private record"); 483 print_err("fail to allocate device private record");
483 return -ENOMEM; 484 return -ENOMEM;
@@ -498,8 +499,9 @@ static int __devinit au1100fb_drv_probe(struct platform_device *dev)
498 au1100fb_fix.mmio_start = regs_res->start; 499 au1100fb_fix.mmio_start = regs_res->start;
499 au1100fb_fix.mmio_len = resource_size(regs_res); 500 au1100fb_fix.mmio_len = resource_size(regs_res);
500 501
501 if (!request_mem_region(au1100fb_fix.mmio_start, au1100fb_fix.mmio_len, 502 if (!devm_request_mem_region(au1100fb_fix.mmio_start,
502 DRIVER_NAME)) { 503 au1100fb_fix.mmio_len,
504 DRIVER_NAME)) {
503 print_err("fail to lock memory region at 0x%08lx", 505 print_err("fail to lock memory region at 0x%08lx",
504 au1100fb_fix.mmio_start); 506 au1100fb_fix.mmio_start);
505 return -EBUSY; 507 return -EBUSY;
@@ -514,8 +516,9 @@ static int __devinit au1100fb_drv_probe(struct platform_device *dev)
514 fbdev->fb_len = fbdev->panel->xres * fbdev->panel->yres * 516 fbdev->fb_len = fbdev->panel->xres * fbdev->panel->yres *
515 (fbdev->panel->bpp >> 3) * AU1100FB_NBR_VIDEO_BUFFERS; 517 (fbdev->panel->bpp >> 3) * AU1100FB_NBR_VIDEO_BUFFERS;
516 518
517 fbdev->fb_mem = dma_alloc_coherent(&dev->dev, PAGE_ALIGN(fbdev->fb_len), 519 fbdev->fb_mem = dmam_alloc_coherent(&dev->dev, &dev->dev,
518 &fbdev->fb_phys, GFP_KERNEL); 520 PAGE_ALIGN(fbdev->fb_len),
521 &fbdev->fb_phys, GFP_KERNEL);
519 if (!fbdev->fb_mem) { 522 if (!fbdev->fb_mem) {
520 print_err("fail to allocate frambuffer (size: %dK))", 523 print_err("fail to allocate frambuffer (size: %dK))",
521 fbdev->fb_len / 1024); 524 fbdev->fb_len / 1024);
@@ -557,14 +560,14 @@ static int __devinit au1100fb_drv_probe(struct platform_device *dev)
557 fbdev->info.fbops = &au1100fb_ops; 560 fbdev->info.fbops = &au1100fb_ops;
558 fbdev->info.fix = au1100fb_fix; 561 fbdev->info.fix = au1100fb_fix;
559 562
560 if (!(fbdev->info.pseudo_palette = kzalloc(sizeof(u32) * 16, GFP_KERNEL))) { 563 fbdev->info.pseudo_palette =
564 devm_kzalloc(&dev->dev, sizeof(u32) * 16, GFP_KERNEL);
565 if (!fbdev->info.pseudo_palette)
561 return -ENOMEM; 566 return -ENOMEM;
562 }
563 567
564 if (fb_alloc_cmap(&fbdev->info.cmap, AU1100_LCD_NBR_PALETTE_ENTRIES, 0) < 0) { 568 if (fb_alloc_cmap(&fbdev->info.cmap, AU1100_LCD_NBR_PALETTE_ENTRIES, 0) < 0) {
565 print_err("Fail to allocate colormap (%d entries)", 569 print_err("Fail to allocate colormap (%d entries)",
566 AU1100_LCD_NBR_PALETTE_ENTRIES); 570 AU1100_LCD_NBR_PALETTE_ENTRIES);
567 kfree(fbdev->info.pseudo_palette);
568 return -EFAULT; 571 return -EFAULT;
569 } 572 }
570 573
@@ -582,9 +585,6 @@ static int __devinit au1100fb_drv_probe(struct platform_device *dev)
582 return 0; 585 return 0;
583 586
584failed: 587failed:
585 if (fbdev->regs) {
586 release_mem_region(fbdev->regs_phys, fbdev->regs_len);
587 }
588 if (fbdev->fb_mem) { 588 if (fbdev->fb_mem) {
589 dma_free_noncoherent(&dev->dev, fbdev->fb_len, fbdev->fb_mem, 589 dma_free_noncoherent(&dev->dev, fbdev->fb_len, fbdev->fb_mem,
590 fbdev->fb_phys); 590 fbdev->fb_phys);
@@ -592,10 +592,9 @@ failed:
592 if (fbdev->info.cmap.len != 0) { 592 if (fbdev->info.cmap.len != 0) {
593 fb_dealloc_cmap(&fbdev->info.cmap); 593 fb_dealloc_cmap(&fbdev->info.cmap);
594 } 594 }
595 kfree(fbdev);
596 platform_set_drvdata(dev, NULL); 595 platform_set_drvdata(dev, NULL);
597 596
598 return 0; 597 return -ENODEV;
599} 598}
600 599
601int au1100fb_drv_remove(struct platform_device *dev) 600int au1100fb_drv_remove(struct platform_device *dev)
@@ -615,14 +614,7 @@ int au1100fb_drv_remove(struct platform_device *dev)
615 /* Clean up all probe data */ 614 /* Clean up all probe data */
616 unregister_framebuffer(&fbdev->info); 615 unregister_framebuffer(&fbdev->info);
617 616
618 release_mem_region(fbdev->regs_phys, fbdev->regs_len);
619
620 dma_free_coherent(&dev->dev, PAGE_ALIGN(fbdev->fb_len), fbdev->fb_mem,
621 fbdev->fb_phys);
622
623 fb_dealloc_cmap(&fbdev->info.cmap); 617 fb_dealloc_cmap(&fbdev->info.cmap);
624 kfree(fbdev->info.pseudo_palette);
625 kfree((void*)fbdev);
626 618
627 return 0; 619 return 0;
628} 620}