From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1423452AbcFMOxP (ORCPT ); Mon, 13 Jun 2016 10:53:15 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:35982 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1423341AbcFMOxM (ORCPT ); Mon, 13 Jun 2016 10:53:12 -0400 Date: Mon, 13 Jun 2016 20:23:07 +0530 From: Amitoj Kaur Chawla To: linux@armlinux.org.uk, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: julia.lawall@lip6.fr Subject: [PATCH 1/2] ARM: pxa: ssp: Drop unnecessary freeing functions Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Drop clk_put, kfree, release_mem_region and iounmap for devm_ allocated data in the remove function of the driver. Some of these changes were made with the help of the following Coccinelle semantic patch: @r@ expression x; @@ ( x = devm_kzalloc(...) | x = devm_request_irq(...) | x = devm_ioremap(...) | x = devm_ioremap_nocache(...) ) @@ expression r.x; @@ ( * kfree(x) | * free_irq(x) | * iounmap(x) ) Signed-off-by: Amitoj Kaur Chawla --- arch/arm/plat-pxa/ssp.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/arch/arm/plat-pxa/ssp.c b/arch/arm/plat-pxa/ssp.c index ba13f79..97bd43c 100644 --- a/arch/arm/plat-pxa/ssp.c +++ b/arch/arm/plat-pxa/ssp.c @@ -230,25 +230,16 @@ static int pxa_ssp_probe(struct platform_device *pdev) static int pxa_ssp_remove(struct platform_device *pdev) { - struct resource *res; struct ssp_device *ssp; ssp = platform_get_drvdata(pdev); if (ssp == NULL) return -ENODEV; - iounmap(ssp->mmio_base); - - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - release_mem_region(res->start, resource_size(res)); - - clk_put(ssp->clk); - mutex_lock(&ssp_lock); list_del(&ssp->node); mutex_unlock(&ssp_lock); - kfree(ssp); return 0; } -- 1.9.1