From 5728cf16b1e66a00674d6bce81b15573880a45ec Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Wed, 20 Feb 2013 13:13:37 +1100 Subject: [PATCH] goldfish-framebuffer-driver-fix MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit fix (silly) sparse warnings Cc: Alan Cox Cc: Arve Hjønnevåg Cc: Bruce Beare Cc: Florian Tobias Schandinat Cc: Jun Nakajima Cc: Mike A. Chan Cc: Sheng Yang Cc: Tom Keel Cc: Tomi Valkeinen Cc: Xiaohui Xin Cc: Yunhong Jiang Signed-off-by: Andrew Morton --- drivers/video/goldfishfb.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/video/goldfishfb.c b/drivers/video/goldfishfb.c index f7f5c296e104..489abb32fc04 100644 --- a/drivers/video/goldfishfb.c +++ b/drivers/video/goldfishfb.c @@ -244,11 +244,12 @@ static int goldfish_fb_probe(struct platform_device *pdev) fb->fb.var.blue.length = 5; framesize = width * height * 2 * 2; - fb->fb.screen_base = dma_alloc_coherent(&pdev->dev, framesize, + fb->fb.screen_base = (char __force __iomem *)dma_alloc_coherent( + &pdev->dev, framesize, &fbpaddr, GFP_KERNEL); pr_debug("allocating frame buffer %d * %d, got %p\n", width, height, fb->fb.screen_base); - if (fb->fb.screen_base == 0) { + if (fb->fb.screen_base == NULL) { ret = -ENOMEM; goto err_alloc_screen_base_failed; } @@ -277,7 +278,8 @@ err_register_framebuffer_failed: err_request_irq_failed: err_fb_set_var_failed: dma_free_coherent(&pdev->dev, framesize, - fb->fb.screen_base, fb->fb.fix.smem_start); + (void *)fb->fb.screen_base, + fb->fb.fix.smem_start); err_alloc_screen_base_failed: err_no_irq: iounmap(fb->reg_base); @@ -296,7 +298,7 @@ static int goldfish_fb_remove(struct platform_device *pdev) unregister_framebuffer(&fb->fb); free_irq(fb->irq, fb); - dma_free_coherent(&pdev->dev, framesize, fb->fb.screen_base, + dma_free_coherent(&pdev->dev, framesize, (void *)fb->fb.screen_base, fb->fb.fix.smem_start); iounmap(fb->reg_base); return 0; -- 2.39.5