From patchwork Sat Nov 3 00:31:43 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Neri X-Patchwork-Id: 1691071 Return-Path: X-Original-To: patchwork-linux-omap@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 A71613FCDE for ; Fri, 2 Nov 2012 23:34:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754958Ab2KBXeP (ORCPT ); Fri, 2 Nov 2012 19:34:15 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:44981 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752468Ab2KBXeN (ORCPT ); Fri, 2 Nov 2012 19:34:13 -0400 Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id qA2NYCBo022251 for ; Fri, 2 Nov 2012 18:34:12 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id qA2NYC04013377 for ; Fri, 2 Nov 2012 18:34:12 -0500 Received: from dlelxv22.itg.ti.com (172.17.1.197) by dfle73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.1.323.3; Fri, 2 Nov 2012 18:34:12 -0500 Received: from localhost (dexx0075479.dextra-mty.naucm.ext.ti.com [10.87.228.135]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id qA2NYCVx002738; Fri, 2 Nov 2012 18:34:12 -0500 From: Ricardo Neri To: CC: , , , , Ricardo Neri Subject: [PATCH v2 2/7] OMAPDSS: HDMI: Convert to devm_request_and_ioremap Date: Fri, 2 Nov 2012 18:31:43 -0600 Message-ID: <1351902708-866-3-git-send-email-ricardo.neri@ti.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1351902708-866-1-git-send-email-ricardo.neri@ti.com> References: <1351902708-866-1-git-send-email-ricardo.neri@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Using devm_request_and_ioremap provides better memory handling and improves readability. Signed-off-by: Ricardo Neri --- drivers/video/omap2/dss/hdmi.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c index cdb043d..51ee0a6 100644 --- a/drivers/video/omap2/dss/hdmi.c +++ b/drivers/video/omap2/dss/hdmi.c @@ -1012,7 +1012,7 @@ static int __init omapdss_hdmihw_probe(struct platform_device *pdev) } /* Base address taken from platform */ - hdmi.ip_data.base_wp = ioremap(res->start, resource_size(res)); + hdmi.ip_data.base_wp = devm_request_and_ioremap(&pdev->dev, res); if (!hdmi.ip_data.base_wp) { DSSERR("can't ioremap WP\n"); return -ENOMEM; @@ -1020,7 +1020,7 @@ static int __init omapdss_hdmihw_probe(struct platform_device *pdev) r = hdmi_get_clocks(pdev); if (r) { - iounmap(hdmi.ip_data.base_wp); + DSSERR("can't get clocks\n"); return r; } @@ -1065,8 +1065,6 @@ static int __exit omapdss_hdmihw_remove(struct platform_device *pdev) hdmi_put_clocks(); - iounmap(hdmi.ip_data.base_wp); - return 0; }