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: 1787411 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id B4F733FC64 for ; Thu, 22 Nov 2012 20:04:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965113Ab2KVUEh (ORCPT ); Thu, 22 Nov 2012 15:04:37 -0500 Received: from mail-pa0-f46.google.com ([209.85.220.46]:51938 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965103Ab2KVUEg (ORCPT ); Thu, 22 Nov 2012 15:04:36 -0500 Received: by mail-pa0-f46.google.com with SMTP id bh2so3071224pad.19 for ; Thu, 22 Nov 2012 12:04:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=tvaXXhjTl6hRF/vkjVNkgfpiFvhW9/EtuDxrz3vNhMo=; b=J+7K4JTkEXqzNrqrC9GH7sxNuiaBbuSq4OYFasVYrvzpFjCokkJDfJOEyDFqT2910g g4vUYCgdTqaTRG1vicOGdEIG+hREOD0uwsCW+d8FmihbdYJl9hiT7bedj/e/yYEH+89i 7Jn8JNI8YTYzsQ/dufWfa5NOEP2lsfGcHqDxRcFaLjkg8tu5siK55wCj4TfVpFbMnEDG bKg7kxG5j08eC6f78pG2hjuTEFahTmkhwk7i0bJZm+soWjbewQ6jO8E9kMdylNFcU06q /0whVSTKZrHgiBIh/J0Qouf9D1AjwuK9UlkpR0rCExb/JRvh1noA7o0EjUkIrpwZPIw+ 9Q6A== 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: ALoCoQki2C6zMr0EUCcHhXRBE3bSFVj0Dd42Z22ygdu2R+bf0ALJF0O4H+q+lClDQpASUbK3O8GF Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org 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; }