From: Tushar Behera <tushar.behera@linaro.org>
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 06:54:10 +0000 [thread overview]
Message-ID: <1353566531-31251-4-git-send-email-tushar.behera@linaro.org> (raw)
In-Reply-To: <1353566531-31251-1-git-send-email-tushar.behera@linaro.org>
While at it, fix the return statements.
Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
---
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;
}
--
1.7.4.1
next prev parent reply other threads:[~2012-11-22 6:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-22 6:54 [PATCH 0/4] video: vt8500: cleanup and use of devm_ apis Tushar Behera
2012-11-22 6:54 ` [PATCH 1/4] video: vt8500: Fix memory leak in probe function Tushar Behera
2012-11-22 6:54 ` [PATCH 2/4] video: vt8500: Fix invalid free of devm_ allocated data Tushar Behera
2012-11-22 6:54 ` Tushar Behera [this message]
2012-11-22 6:54 ` [PATCH 4/4] video: vt8500: Convert to use devm_ioremap() Tushar Behera
2012-11-22 18:07 ` [PATCH 0/4] video: vt8500: cleanup and use of devm_ apis Tony Prisk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1353566531-31251-4-git-send-email-tushar.behera@linaro.org \
--to=tushar.behera@linaro.org \
--cc=FlorianSchandinat@gmx.de \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@prisktech.co.nz \
--cc=patches@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).