From patchwork Thu Nov 22 06:42:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tushar Behera X-Patchwork-Id: 13065 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 8996523FC6 for ; Thu, 22 Nov 2012 06:48:51 +0000 (UTC) Received: from mail-ia0-f180.google.com (mail-ia0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 3F409A188F2 for ; Thu, 22 Nov 2012 06:48:51 +0000 (UTC) Received: by mail-ia0-f180.google.com with SMTP id t4so3000258iag.11 for ; Wed, 21 Nov 2012 22:48:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=tvaXXhjTl6hRF/vkjVNkgfpiFvhW9/EtuDxrz3vNhMo=; b=XXeqh1P6MjSXLzDVBZGY0sYyZ1wIE0HZUKUYpuD2PI2LzEhAWsFmcZcVzEcDPPyCQo 6GzjkIYbJRfVzj7W0QsUziThr8qlu41DVWtkD0Gmq+8iGqxIO3ahd+tpQ0wJfwylbfhS ahzrcsxVVSjWdIHwSQo1+NEzoeKd7fXUwvmdC7aaVGKylirbci/JHXIOd182X6pTcKnt 4yRFU22SbnJbUqkXIkEF6DwvSLex3aIZVSN/IfD9Afu2wJirCk1+fQ9gp7hKza/i7LBQ t7HOZztRFPbzo5F+0KwLSChxLgk1u4uLl9hHAYJP3K4/ZOlTMwggHKbdLeecl188zsIS m90A== Received: by 10.50.42.168 with SMTP id p8mr2131003igl.57.1353566930946; Wed, 21 Nov 2012 22:48:50 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp164728igt; Wed, 21 Nov 2012 22:48:50 -0800 (PST) Received: by 10.68.138.137 with SMTP id qq9mr2019676pbb.74.1353566930341; Wed, 21 Nov 2012 22:48:50 -0800 (PST) Received: from mail-pa0-f52.google.com (mail-pa0-f52.google.com [209.85.220.52]) by mx.google.com with ESMTPS id xg10si3815459pbc.147.2012.11.21.22.48.50 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Nov 2012 22:48:50 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.52 is neither permitted nor denied by best guess record for domain of tushar.behera@linaro.org) client-ip=209.85.220.52; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.52 is neither permitted nor denied by best guess record for domain of tushar.behera@linaro.org) smtp.mail=tushar.behera@linaro.org Received: by mail-pa0-f52.google.com with SMTP id fb1so2426527pad.39 for ; Wed, 21 Nov 2012 22:48:50 -0800 (PST) Received: by 10.68.232.195 with SMTP id tq3mr2005776pbc.70.1353566930001; Wed, 21 Nov 2012 22:48:50 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id vn2sm1558688pbc.31.2012.11.21.22.48.46 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Nov 2012 22:48:49 -0800 (PST) From: Tushar Behera To: linux-kernel@vger.kernel.org, linux-fbdev@vger.kernel.org Cc: FlorianSchandinat@gmx.de, linux@prisktech.co.nz, patches@linaro.org Subject: [PATCH 4/4] video: vt8500: Convert to use devm_ioremap() Date: Thu, 22 Nov 2012 12:12:11 +0530 Message-Id: <1353566531-31251-5-git-send-email-tushar.behera@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1353566531-31251-1-git-send-email-tushar.behera@linaro.org> References: <1353566531-31251-1-git-send-email-tushar.behera@linaro.org> X-Gm-Message-State: ALoCoQmxH381yq0onUBq0lds1ZlkkgPo8nQ1rEUOl4r/BFg51gmypwx4hJCk3rYGlKqfODYnR9t1 While at it, fix the return statements. Signed-off-by: Tushar Behera --- drivers/video/vt8500lcdfb.c | 14 ++++---------- 1 files changed, 4 insertions(+), 10 deletions(-) diff --git a/drivers/video/vt8500lcdfb.c b/drivers/video/vt8500lcdfb.c index c42f15d..96a955e 100644 --- a/drivers/video/vt8500lcdfb.c +++ b/drivers/video/vt8500lcdfb.c @@ -337,7 +337,7 @@ static int __devinit vt8500lcd_probe(struct platform_device *pdev) return -EBUSY; } - fbi->regbase = ioremap(res->start, resource_size(res)); + fbi->regbase = devm_ioremap(&pdev->dev, res->start, resource_size(res)); if (fbi->regbase == NULL) { dev_err(&pdev->dev, "failed to map I/O memory\n"); return -EBUSY; @@ -346,8 +346,7 @@ static int __devinit vt8500lcd_probe(struct platform_device *pdev) np = of_parse_phandle(pdev->dev.of_node, "default-mode", 0); if (!np) { pr_err("%s: No display description in Device Tree\n", __func__); - ret = -EINVAL; - goto failed_free_io; + return -EINVAL; } /* @@ -366,7 +365,7 @@ static int __devinit vt8500lcd_probe(struct platform_device *pdev) ret |= of_property_read_u32(np, "bpp", &bpp); if (ret) { pr_err("%s: Unable to read display properties\n", __func__); - goto failed_free_io; + return ret; } of_mode.vmode = FB_VMODE_NONINTERLACED; @@ -376,8 +375,7 @@ static int __devinit vt8500lcd_probe(struct platform_device *pdev) GFP_KERNEL); if (!fb_mem_virt) { pr_err("%s: Failed to allocate framebuffer\n", __func__); - ret = -ENOMEM; - goto failed_free_io; + return -ENOMEM; }; fbi->fb.fix.smem_start = fb_mem_phys; @@ -459,8 +457,6 @@ failed_free_palette: failed_free_fbmem: dma_free_coherent(&pdev->dev, fbi->fb.fix.smem_len, fbi->fb.screen_base, fbi->fb.fix.smem_start); -failed_free_io: - iounmap(fbi->regbase); return ret; } @@ -486,8 +482,6 @@ static int __devexit vt8500lcd_remove(struct platform_device *pdev) dma_free_coherent(&pdev->dev, fbi->palette_size, fbi->palette_cpu, fbi->palette_phys); - iounmap(fbi->regbase); - return 0; }