From patchwork Tue May 26 05:21:01 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: 6477821 Return-Path: X-Original-To: patchwork-linux-spi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B12C59F38C for ; Tue, 26 May 2015 05:18:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C4BF820439 for ; Tue, 26 May 2015 05:18:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D245F200ED for ; Tue, 26 May 2015 05:18:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751071AbbEZFRm (ORCPT ); Tue, 26 May 2015 01:17:42 -0400 Received: from [209.85.192.171] ([209.85.192.171]:35484 "EHLO mail-pd0-f171.google.com" rhost-flags-FAIL-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1751065AbbEZFRl (ORCPT ); Tue, 26 May 2015 01:17:41 -0400 Received: by pdea3 with SMTP id a3so82378184pde.2 for ; Mon, 25 May 2015 22:16:46 -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=ptLXX8s4Q7XBmF7kWCFW+Cbto3xdLuRYOvzgYKQRHA0=; b=IvOHSX+rOtFpKTDXN8TJoPnOivQWLbCPl6lpdp602TSCYNBFHfyjhZmIPiTSO+8K4n Uj65lsVcWk5Kxfm7FQ8bNiJyWiPPsSvopQEdMoIuMgCk5cLzANvSx7hkQUuP/eZELKv8 01+K6HXEMJbnImZqqfuOBEIlbxlWuc53gSk0AyGdAx2ZNxLBZaTOM1+aaucp10vy84LD +Z5SaHHz04nfvkTExRmIDmD2otsIUUDg8anQ2Jo2f67krZq2vdgiAETIjafWbnUNIGCx s50TWw7ZhKCvHf57hWs0v5QMz2czIU8DOd2xZXszJkWGbhFUUXRurJ+FXthi1MrvUsQJ fDIA== X-Received: by 10.68.180.131 with SMTP id do3mr45412964pbc.42.1432617406534; Mon, 25 May 2015 22:16:46 -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 lb1sm11694480pab.39.2015.05.25.22.16.44 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 25 May 2015 22:16:45 -0700 (PDT) From: Barry Song <21cnbao@gmail.com> To: broonie@kernel.org, linux-spi@vger.kernel.org Cc: workgroup.linux@csr.com, Qipan Li , Geert Uytterhoeven , Barry Song Subject: [PATCH 1/2] spi: sirf: remove the allocation of dummypage Date: Tue, 26 May 2015 05:21:01 +0000 Message-Id: <1432617661-15901-1-git-send-email-21cnbao@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, 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 From: Qipan Li this job has been done by spi core. Cc: Geert Uytterhoeven Signed-off-by: Qipan Li Signed-off-by: Barry Song Acked-by: Geert Uytterhoeven --- drivers/spi/spi-sirf.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/spi/spi-sirf.c b/drivers/spi/spi-sirf.c index dd87ba6f..f9b864f 100644 --- a/drivers/spi/spi-sirf.c +++ b/drivers/spi/spi-sirf.c @@ -303,7 +303,6 @@ struct sirfsoc_spi { struct dma_chan *tx_chan; dma_addr_t src_start; dma_addr_t dst_start; - void *dummypage; int word_width; /* in bytes */ /* @@ -719,8 +718,8 @@ static int spi_sirfsoc_transfer(struct spi_device *spi, struct spi_transfer *t) struct sirfsoc_spi *sspi; sspi = spi_master_get_devdata(spi->master); - sspi->tx = t->tx_buf ? t->tx_buf : sspi->dummypage; - sspi->rx = t->rx_buf ? t->rx_buf : sspi->dummypage; + sspi->tx = t->tx_buf; + sspi->rx = t->rx_buf; sspi->left_tx_word = sspi->left_rx_word = t->len / sspi->word_width; reinit_completion(&sspi->rx_done); reinit_completion(&sspi->tx_done); @@ -1114,6 +1113,7 @@ static int spi_sirfsoc_probe(struct platform_device *pdev) master->bits_per_word_mask = SPI_BPW_MASK(8) | SPI_BPW_MASK(12) | SPI_BPW_MASK(16) | SPI_BPW_MASK(32); master->max_speed_hz = SIRFSOC_SPI_DEFAULT_FRQ; + master->flags = SPI_MASTER_MUST_RX | SPI_MASTER_MUST_TX; sspi->bitbang.master->dev.of_node = pdev->dev.of_node; /* request DMA channels */ @@ -1141,12 +1141,6 @@ static int spi_sirfsoc_probe(struct platform_device *pdev) init_completion(&sspi->rx_done); init_completion(&sspi->tx_done); - sspi->dummypage = devm_kzalloc(&pdev->dev, 2 * PAGE_SIZE, GFP_KERNEL); - if (!sspi->dummypage) { - ret = -ENOMEM; - goto free_clk; - } - ret = spi_bitbang_start(&sspi->bitbang); if (ret) goto free_clk;