From patchwork Fri Apr 22 20:11:22 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 727911 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p3MK59wc025952 for ; Fri, 22 Apr 2011 20:05:09 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753773Ab1DVUE2 (ORCPT ); Fri, 22 Apr 2011 16:04:28 -0400 Received: from mgw2.diku.dk ([130.225.96.92]:55181 "EHLO mgw2.diku.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753042Ab1DVUE0 (ORCPT ); Fri, 22 Apr 2011 16:04:26 -0400 Received: from localhost (localhost [127.0.0.1]) by mgw2.diku.dk (Postfix) with ESMTP id 63E3B19BCC3; Fri, 22 Apr 2011 22:04:24 +0200 (CEST) Received: from mgw2.diku.dk ([127.0.0.1]) by localhost (mgw2.diku.dk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 30642-11; Fri, 22 Apr 2011 22:04:20 +0200 (CEST) Received: from palace.topps.diku.dk (palace.ekstranet.diku.dk [192.38.115.202]) by mgw2.diku.dk (Postfix) with ESMTP id C3C4419BCBE; Fri, 22 Apr 2011 22:04:20 +0200 (CEST) From: Julia Lawall To: Paul Mundt Cc: kernel-janitors@vger.kernel.org, Grant Likely , linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree-discuss@lists.ozlabs.org Subject: [PATCH 2/3] drivers/video/sm501fb.c: Convert release_resource to release_mem_region Date: Fri, 22 Apr 2011 22:11:22 +0200 Message-Id: <1303503083-26170-2-git-send-email-julia@diku.dk> X-Mailer: git-send-email 1.7.1 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 22 Apr 2011 20:05:09 +0000 (UTC) Request_mem_region should be used with release_mem_region, not release_resource. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @s exists@ expression e1,e2,e3,e4,e; @@ *e4 = request_mem_region(e1,e2,e3) ... when != e4 = e *release_resource(e4); // Signed-off-by: Julia Lawall --- drivers/video/sm501fb.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/video/sm501fb.c b/drivers/video/sm501fb.c index 56ef6b3..87f0be1 100644 --- a/drivers/video/sm501fb.c +++ b/drivers/video/sm501fb.c @@ -1625,22 +1625,22 @@ static int sm501fb_start(struct sm501fb_info *info, return 0; /* everything is setup */ err_mem_res: - release_resource(info->fbmem_res); - kfree(info->fbmem_res); + release_mem_region(info->fbmem_res->start, + resource_size(info->fbmem_res)); err_regs2d_map: iounmap(info->regs2d); err_regs2d_res: - release_resource(info->regs2d_res); - kfree(info->regs2d_res); + release_mem_region(info->regs2d_res->start, + resource_size(info->regs2d_res)); err_regs_map: iounmap(info->regs); err_regs_res: - release_resource(info->regs_res); - kfree(info->regs_res); + release_mem_region(info->regs_res->start, + resource_size(info->regs_res)); err_release: return ret; @@ -1652,16 +1652,16 @@ static void sm501fb_stop(struct sm501fb_info *info) sm501_unit_power(info->dev->parent, SM501_GATE_DISPLAY, 0); iounmap(info->fbmem); - release_resource(info->fbmem_res); - kfree(info->fbmem_res); + release_mem_region(info->fbmem_res->start, + resource_size(info->fbmem_res)); iounmap(info->regs2d); - release_resource(info->regs2d_res); - kfree(info->regs2d_res); + release_mem_region(info->regs2d_res->start, + resource_size(info->regs2d_res)); iounmap(info->regs); - release_resource(info->regs_res); - kfree(info->regs_res); + release_mem_region(info->regs_res->start, + resource_size(info->regs_res)); } static int sm501fb_init_fb(struct fb_info *fb,