From patchwork Thu Jan 2 15:07:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Russell King X-Patchwork-Id: 3425401 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 D9708C02DC for ; Thu, 2 Jan 2014 15:15:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D6B502015E for ; Thu, 2 Jan 2014 15:15:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B77232013A for ; Thu, 2 Jan 2014 15:15:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752067AbaABPPG (ORCPT ); Thu, 2 Jan 2014 10:15:06 -0500 Received: from gw-1.arm.linux.org.uk ([78.32.30.217]:54168 "EHLO pandora.arm.linux.org.uk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751959AbaABPPD (ORCPT ); Thu, 2 Jan 2014 10:15:03 -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=DkRRdtoOLF/ItlkchOLxxcU4bd7amKrHRdM/0i73lDc=; b=kCOBq9yk1VMN8+pSUIg781zOAqExlWzNt2MVmQyHg0B5Q9Qwapl9MALDYkgLWQ+yaM0UGxhjjXQKiXclXkb2AbjTT3j8WeoJ0MaJl8fE34hWFQewCJRMAmgzhkHI0b5YARNgcnHrQuRybCeuokt0NRARA8A35vj7pgPEJ+Nbc5o=; Received: from [2001:4d48:ad52:3201:222:68ff:fe15:37dd] (port=56275 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 1VyjrS-0003ZP-EG; Thu, 02 Jan 2014 15:07:02 +0000 Received: from rmk by rmk-PC.arm.linux.org.uk with local (Exim 4.76) (envelope-from ) id 1VyjrR-0004zN-P4; Thu, 02 Jan 2014 15:07:01 +0000 In-Reply-To: <20140102150621.GJ16456@n2100.arm.linux.org.uk> References: <20140102150621.GJ16456@n2100.arm.linux.org.uk> From: Russell King To: dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead, org@arm.linux.org.uk, linux-omap@vger.kernel.org Cc: Vinod Koul , Dan Williams Subject: [PATCH RFC 01/26] dmaengine: omap-dma: use devm_kzalloc() to allocate omap_dmadev. Message-Id: Date: Thu, 02 Jan 2014 15:07:01 +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.3 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 files changed, 1 insertions(+), 2 deletions(-) diff --git a/drivers/dma/omap-dma.c b/drivers/dma/omap-dma.c index 2f66cf4e54fe..d9349be33bdf 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;