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: 1788401 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 2EC45DF24C for ; Thu, 22 Nov 2012 20:45:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756541Ab2KVUpw (ORCPT ); Thu, 22 Nov 2012 15:45:52 -0500 Received: from mail-pa0-f46.google.com ([209.85.220.46]:58263 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756207Ab2KVUpt (ORCPT ); Thu, 22 Nov 2012 15:45:49 -0500 Received: by mail-pa0-f46.google.com with SMTP id bh2so3085741pad.19 for ; Thu, 22 Nov 2012 12:45:49 -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=L+ar55pO2fQN+TvGw7xb6Tr68aK/kD1qzSvWdVJmswI=; b=Bnxl97oKjKpI9dF/sq8lrwcy6MxC65G3QyS1fePjs6FmrxzjasnT7YVeRAYNg2xeIp rjK9i5AJ3uGAYc1Fbz6EpHwGgMt01XUCXCYmt6NSIze/Ve1tRsUEgaaLWylKGIMKO0ol Y2f1SHSW8hicyOydTMUwBZHBNmEW0pCSFCBWh9fg+HWQCijyrJsFrPuUKH2wwCkD9MoZ Ck3swiLm5RT/xFs1h27djkwqVyvznqaVNQBR3eMGP64e8z4OMDA/vuoUFCGSoAHDSOVL 4IACin/vtDNKtTjCrOnTYW4s+r4igguerSLS+m4qFO9U882BzwHYEsbx00ReIbSuI00b bxxA== 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: ALoCoQkgFEaLmLImhIhxIxA13wvhXkDs7QKXHd8J+0saFXz1+nP9pcZm/QZvHrbn7JsjCmfE6G7q 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 | 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; }