From patchwork Mon Feb 10 15:55:58 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Russell King X-Patchwork-Id: 3619361 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 17767C02E3 for ; Mon, 10 Feb 2014 15:56:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 50B5D200EC for ; Mon, 10 Feb 2014 15:56:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 71A53201D3 for ; Mon, 10 Feb 2014 15:56:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752284AbaBJP4B (ORCPT ); Mon, 10 Feb 2014 10:56:01 -0500 Received: from gw-1.arm.linux.org.uk ([78.32.30.217]:59990 "EHLO pandora.arm.linux.org.uk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752074AbaBJP4A (ORCPT ); Mon, 10 Feb 2014 10:56:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=arm.linux.org.uk; s=pandora; h=Date:Sender:Message-Id:Subject:Cc:To:From:References:In-Reply-To; bh=ALp1wROnVfEEuLCCzOnMTnSPH+3w+cr2cup/8c4DCOU=; b=a6/vz6uCTPPiesNJGEMdxdWBuPFVKDMbEp+Ser2HZh/u4OiX2xYmbsmXtxgpWQeSohuJGbmiJq6UbqXyU4smH1NXh+EnoJECEDCDzeu2r4khiR1GAPmU0/Hpeq7jUjceGCVtxSdBOqpL8uKt/dq3vd+Zhl5HCpYHPKbixbke4LY=; Received: from e0022681537dd.dyn.arm.linux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:49369 helo=rmk-PC.arm.linux.org.uk) by pandora.arm.linux.org.uk with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1WCtDC-00052R-Sh; Mon, 10 Feb 2014 15:55:58 +0000 Received: from rmk by rmk-PC.arm.linux.org.uk with local (Exim 4.76) (envelope-from ) id 1WCtDC-0006W6-Bu; Mon, 10 Feb 2014 15:55:58 +0000 In-Reply-To: <20140210155531.GB26684@n2100.arm.linux.org.uk> References: <20140210155531.GB26684@n2100.arm.linux.org.uk> From: Russell King To: dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org Cc: Dan Williams , Vinod Koul Subject: [PATCH 01/26] dmaengine: omap-dma: use devm_kzalloc() to allocate omap_dmadev. Message-Id: Date: Mon, 10 Feb 2014 15:55:58 +0000 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use devm_kzalloc() to allocate omap_dmadev() so that we don't need complex error cleanup paths. Signed-off-by: Russell King --- drivers/dma/omap-dma.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/dma/omap-dma.c b/drivers/dma/omap-dma.c index 362e7c49f2e1..98034e8c558f 100644 --- a/drivers/dma/omap-dma.c +++ b/drivers/dma/omap-dma.c @@ -594,7 +594,6 @@ static void omap_dma_free(struct omap_dmadev *od) tasklet_kill(&c->vc.task); kfree(c); } - kfree(od); } static int omap_dma_probe(struct platform_device *pdev) @@ -602,7 +601,7 @@ static int omap_dma_probe(struct platform_device *pdev) struct omap_dmadev *od; int rc, i; - od = kzalloc(sizeof(*od), GFP_KERNEL); + od = devm_kzalloc(&pdev->dev, sizeof(*od), GFP_KERNEL); if (!od) return -ENOMEM;