From patchwork Thu Nov 22 06:42:10 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tushar Behera X-Patchwork-Id: 13064 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 CCF2C23FC6 for ; Thu, 22 Nov 2012 06:48:47 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id 819DFA188F2 for ; Thu, 22 Nov 2012 06:48:47 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id c10so171152ieb.11 for ; Wed, 21 Nov 2012 22:48:47 -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=L+ar55pO2fQN+TvGw7xb6Tr68aK/kD1qzSvWdVJmswI=; b=l7o2nQ+53P2gra9CfCSksRExwCif4S1sBfTuJbID3+ADOQDZ8soTc6j95tDMDNbk8w jAqID/J5xqI0Z3apkCMn5D0kw1ctr1SyAj5T1N1YqtwuhLZAVsmQGehOn/4/lGyfK73Y NE/kQPPzY6H04uTJzysG4bsIam2M53Oel0DzrDDjxxfh0HwfpYPC29FCiYSXyuSNCZgg MF1IRYNUAIcF5vf45rdoVTZvIYjgyCu1alykKqCbNkyS4uGqckMdDCm3L+phU3T/RK8k ZmbV0qVH3ucfoCspOr64K1uiARqH2PIjMlescOd32uFZpB70AmVadjDjoRBO9zi61F5v fujg== Received: by 10.43.125.133 with SMTP id gs5mr19735906icc.54.1353566927253; Wed, 21 Nov 2012 22:48:47 -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 n20csp164716igt; Wed, 21 Nov 2012 22:48:46 -0800 (PST) Received: by 10.68.204.103 with SMTP id kx7mr2101093pbc.33.1353566926651; Wed, 21 Nov 2012 22:48:46 -0800 (PST) Received: from mail-da0-f54.google.com (mail-da0-f54.google.com [209.85.210.54]) by mx.google.com with ESMTPS id t9si3342638paz.55.2012.11.21.22.48.46 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Nov 2012 22:48:46 -0800 (PST) Received-SPF: neutral (google.com: 209.85.210.54 is neither permitted nor denied by best guess record for domain of tushar.behera@linaro.org) client-ip=209.85.210.54; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.210.54 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-da0-f54.google.com with SMTP id n2so1678200dad.27 for ; Wed, 21 Nov 2012 22:48:46 -0800 (PST) Received: by 10.68.218.97 with SMTP id pf1mr1936632pbc.96.1353566926340; Wed, 21 Nov 2012 22:48:46 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id vn2sm1558688pbc.31.2012.11.21.22.48.38 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Nov 2012 22:48:44 -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 3/4] video: vt8500: Convert to use devm_request_mem_region() Date: Thu, 22 Nov 2012 12:12:10 +0530 Message-Id: <1353566531-31251-4-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: ALoCoQntZBHAGP+S34bP2sxf4IdowrnbT5f7UzGO+HCDIZD1HkADhUatA8iDT+7in+NjooJ7L/Mr While at it, fix the return statements. Signed-off-by: Tushar Behera --- drivers/video/vt8500lcdfb.c | 12 +++--------- 1 files changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/video/vt8500lcdfb.c b/drivers/video/vt8500lcdfb.c index 2438368..c42f15d 100644 --- a/drivers/video/vt8500lcdfb.c +++ b/drivers/video/vt8500lcdfb.c @@ -330,7 +330,8 @@ static int __devinit vt8500lcd_probe(struct platform_device *pdev) return -ENODEV; } - res = request_mem_region(res->start, resource_size(res), "vt8500lcd"); + res = devm_request_mem_region(&pdev->dev, res->start, + resource_size(res), "vt8500lcd"); if (res == NULL) { dev_err(&pdev->dev, "failed to request I/O memory\n"); return -EBUSY; @@ -339,8 +340,7 @@ static int __devinit vt8500lcd_probe(struct platform_device *pdev) fbi->regbase = ioremap(res->start, resource_size(res)); if (fbi->regbase == NULL) { dev_err(&pdev->dev, "failed to map I/O memory\n"); - ret = -EBUSY; - goto failed_free_res; + return -EBUSY; } np = of_parse_phandle(pdev->dev.of_node, "default-mode", 0); @@ -461,15 +461,12 @@ failed_free_fbmem: fbi->fb.screen_base, fbi->fb.fix.smem_start); failed_free_io: iounmap(fbi->regbase); -failed_free_res: - release_mem_region(res->start, resource_size(res)); return ret; } static int __devexit vt8500lcd_remove(struct platform_device *pdev) { struct vt8500lcd_info *fbi = platform_get_drvdata(pdev); - struct resource *res; int irq; unregister_framebuffer(&fbi->fb); @@ -491,9 +488,6 @@ static int __devexit vt8500lcd_remove(struct platform_device *pdev) iounmap(fbi->regbase); - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - release_mem_region(res->start, resource_size(res)); - return 0; }