From patchwork Thu May 7 07:13:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Barry Song <21cnbao@gmail.com> X-Patchwork-Id: 6354291 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1AA65BEEE1 for ; Thu, 7 May 2015 07:12:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1AF80203AD for ; Thu, 7 May 2015 07:12:40 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 50DEB203AC for ; Thu, 7 May 2015 07:12:39 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YqFwW-0007MA-GD; Thu, 07 May 2015 07:10:00 +0000 Received: from mail-pd0-x233.google.com ([2607:f8b0:400e:c02::233]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YqFwQ-0007EA-0n for linux-arm-kernel@lists.infradead.org; Thu, 07 May 2015 07:09:54 +0000 Received: by pdbqa5 with SMTP id qa5so33298505pdb.1 for ; Thu, 07 May 2015 00:09:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=inukjO/qxX3JJDjVYr1lA03mSxht1P+XOgA+xNffcSM=; b=vfOOHPdBBijn5yPUhzvEHcvDQ932Hl1GmyfR8AFgEqY0crrnSMJQ+Wmij7eR87FhwW BT6roaRYmJocSL7OG6rffrISf7iYHM0dGlirbcypeYAGgHez7sw1tM3KRAsva3fJdOgO OKnaigN72iXp9Xqrnxj6ne7Fc0OxnK4fq21edhb4JEeluhBzsJ4aHOODEKwqcPSc8PwQ Es86vl43lPLz3OCJdWBN9G9dKmoULvVPwUkiovs7wed/1zGHuGE9utQTZZ9D+LMV/SO1 fORogqIC7FjdZodXtdjdvD450g28F7e0eMb5YseyttfYvyZB7fTAkdPHC5JxfPJNUvu+ v/BA== X-Received: by 10.66.120.69 with SMTP id la5mr4594318pab.66.1430982573045; Thu, 07 May 2015 00:09:33 -0700 (PDT) Received: from ip-172-31-29-47.ap-northeast-1.compute.internal (ec2-54-65-106-64.ap-northeast-1.compute.amazonaws.com. [54.65.106.64]) by mx.google.com with ESMTPSA id v7sm1078677pde.81.2015.05.07.00.09.30 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 07 May 2015 00:09:32 -0700 (PDT) From: Barry Song <21cnbao@gmail.com> To: broonie@kernel.org, linux-spi@vger.kernel.org Subject: [PATCH 1/2] spi: sirf: replace kmalloc by devm_kzalloc Date: Thu, 7 May 2015 07:13:10 +0000 Message-Id: <1430982791-8681-1-git-send-email-21cnbao@gmail.com> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150507_000954_159082_9DCD16D9 X-CRM114-Status: UNSURE ( 8.78 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.8 (/) Cc: Qipan Li , workgroup.linux@csr.com, linux-arm-kernel@lists.infradead.org, Barry Song X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 From: Qipan Li Signed-off-by: Qipan Li Signed-off-by: Barry Song --- drivers/spi/spi-sirf.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/spi/spi-sirf.c b/drivers/spi/spi-sirf.c index a69ccb7..ae4bd11 100644 --- a/drivers/spi/spi-sirf.c +++ b/drivers/spi/spi-sirf.c @@ -758,7 +758,7 @@ static int spi_sirfsoc_probe(struct platform_device *pdev) /* We are not using dummy delay between command and data */ writel(0, sspi->base + SIRFSOC_SPI_DUMMY_DELAY_CTL); - sspi->dummypage = kmalloc(2 * PAGE_SIZE, GFP_KERNEL); + sspi->dummypage = devm_kzalloc(&pdev->dev, 2 * PAGE_SIZE, GFP_KERNEL); if (!sspi->dummypage) { ret = -ENOMEM; goto free_clk; @@ -766,12 +766,10 @@ static int spi_sirfsoc_probe(struct platform_device *pdev) ret = spi_bitbang_start(&sspi->bitbang); if (ret) - goto free_dummypage; + goto free_clk; dev_info(&pdev->dev, "registerred, bus number = %d\n", master->bus_num); return 0; -free_dummypage: - kfree(sspi->dummypage); free_clk: clk_disable_unprepare(sspi->clk); clk_put(sspi->clk); @@ -794,7 +792,6 @@ static int spi_sirfsoc_remove(struct platform_device *pdev) sspi = spi_master_get_devdata(master); spi_bitbang_stop(&sspi->bitbang); - kfree(sspi->dummypage); clk_disable_unprepare(sspi->clk); clk_put(sspi->clk); dma_release_channel(sspi->rx_chan);