From patchwork Sun Feb 9 03:06:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 3611601 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id DF4EE9F344 for ; Sun, 9 Feb 2014 03:06:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DC539201C7 for ; Sun, 9 Feb 2014 03:06:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0761F201BF for ; Sun, 9 Feb 2014 03:06:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751393AbaBIDGL (ORCPT ); Sat, 8 Feb 2014 22:06:11 -0500 Received: from mail-pa0-f54.google.com ([209.85.220.54]:39063 "EHLO mail-pa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751383AbaBIDGK (ORCPT ); Sat, 8 Feb 2014 22:06:10 -0500 Received: by mail-pa0-f54.google.com with SMTP id fa1so4780980pad.13 for ; Sat, 08 Feb 2014 19:06:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:subject:from:to:cc:date:content-type :mime-version:content-transfer-encoding; bh=iZ8VQKMUUhKIOwgBU5sXqaAJXbecnzy5kscxfOum9Ro=; b=N212PcB7eyH1pubjc55STYL8U4zPxW/UoYugqtaz13kI1P66GUHeDr2wLQZEvy6ied dgBzIWm5PbNdy++4UCkeVso7SwQGdwCqVqTkAxUXs7ktJjLvk9Z+dwQ/LpukVSBQmBcj LoPVgnfessj89onFyJ3mIazsqhluCNVMSAbKDmNDrL4hYptYQH3KbHTtp4SA/HCW9djb 7BzgG/V6GSu2p+JSEpTpgTnz82bo0d0ao/hoKEbVX0LlLLWYGJ6ryonwGYTKpFXbKY8U LuAZAvWINbxtc97gJ9x1UcUIu6rbdiqWPg+ejXAJtyIbmfPgwJHDLm1msqMD2W+nNM5s WSdA== X-Gm-Message-State: ALoCoQnvijiV69zad4aOhX8uivpxexmBCp9xFvkd9IbPNY85ZjzxsfH3axMsLn3t9jWwlof6ZclY X-Received: by 10.67.8.102 with SMTP id dj6mr17380067pad.10.1391915169817; Sat, 08 Feb 2014 19:06:09 -0800 (PST) Received: from [192.168.0.102] (218-164-136-128.dynamic.hinet.net. [218.164.136.128]) by mx.google.com with ESMTPSA id jk16sm28237560pbb.34.2014.02.08.19.06.06 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 08 Feb 2014 19:06:09 -0800 (PST) Message-ID: <1391915164.17493.5.camel@phoenix> Subject: [PATCH] spi: Use reinit_completion at appropriate places From: Axel Lin To: Mark Brown Cc: Uwe =?ISO-8859-1?Q?Kleine-K=F6nig?= , Sascha Hauer , Florian Fainelli , Tanguy Bouzeloc , Jonas Gorski , linux-spi@vger.kernel.org Date: Sun, 09 Feb 2014 11:06:04 +0800 X-Mailer: Evolution 3.6.4-0ubuntu1 Mime-Version: 1.0 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 Calling init_completion() once is enough. For the rest of the iterations, call reinit_completion() instead. Cc: Jonas Gorski Cc: Florian Fainelli Cc: Tanguy Bouzeloc Cc: Uwe Kleine-König Cc: Sascha Hauer Signed-off-by: Axel Lin --- drivers/spi/spi-bcm63xx-hsspi.c | 3 ++- drivers/spi/spi-bcm63xx.c | 3 ++- drivers/spi/spi-efm32.c | 3 ++- drivers/spi/spi-imx.c | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-bcm63xx-hsspi.c b/drivers/spi/spi-bcm63xx-hsspi.c index b528f9f..3ad3e0c 100644 --- a/drivers/spi/spi-bcm63xx-hsspi.c +++ b/drivers/spi/spi-bcm63xx-hsspi.c @@ -180,7 +180,7 @@ static int bcm63xx_hsspi_do_txrx(struct spi_device *spi, struct spi_transfer *t) while (pending > 0) { int curr_step = min_t(int, step_size, pending); - init_completion(&bs->done); + reinit_completion(&bs->done); if (tx) { memcpy_toio(bs->fifo + HSSPI_OPCODE_LEN, tx, curr_step); tx += curr_step; @@ -369,6 +369,7 @@ static int bcm63xx_hsspi_probe(struct platform_device *pdev) bs->fifo = (u8 __iomem *)(bs->regs + HSSPI_FIFO_REG(0)); mutex_init(&bs->bus_mutex); + init_completion(&bs->done); master->bus_num = HSSPI_BUS_NUM; master->num_chipselect = 8; diff --git a/drivers/spi/spi-bcm63xx.c b/drivers/spi/spi-bcm63xx.c index 6922935..9f57758 100644 --- a/drivers/spi/spi-bcm63xx.c +++ b/drivers/spi/spi-bcm63xx.c @@ -169,7 +169,7 @@ static int bcm63xx_txrx_bufs(struct spi_device *spi, struct spi_transfer *first, transfer_list); } - init_completion(&bs->done); + reinit_completion(&bs->done); /* Fill in the Message control register */ msg_ctl = (len << SPI_BYTE_CNT_SHIFT); @@ -353,6 +353,7 @@ static int bcm63xx_spi_probe(struct platform_device *pdev) } bs = spi_master_get_devdata(master); + init_completion(&bs->done); platform_set_drvdata(pdev, master); bs->pdev = pdev; diff --git a/drivers/spi/spi-efm32.c b/drivers/spi/spi-efm32.c index d4d3cc5..03cbb5e 100644 --- a/drivers/spi/spi-efm32.c +++ b/drivers/spi/spi-efm32.c @@ -198,7 +198,7 @@ static int efm32_spi_txrx_bufs(struct spi_device *spi, struct spi_transfer *t) efm32_spi_filltx(ddata); - init_completion(&ddata->done); + reinit_completion(&ddata->done); efm32_spi_write32(ddata, REG_IF_TXBL | REG_IF_RXDATAV, REG_IEN); @@ -349,6 +349,7 @@ static int efm32_spi_probe(struct platform_device *pdev) ddata->bitbang.txrx_bufs = efm32_spi_txrx_bufs; spin_lock_init(&ddata->lock); + init_completion(&ddata->done); ddata->clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(ddata->clk)) { diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c index 8a77b7b..2ccfde6 100644 --- a/drivers/spi/spi-imx.c +++ b/drivers/spi/spi-imx.c @@ -740,7 +740,7 @@ static int spi_imx_transfer(struct spi_device *spi, spi_imx->count = transfer->len; spi_imx->txfifo = 0; - init_completion(&spi_imx->xfer_done); + reinit_completion(&spi_imx->xfer_done); spi_imx_push(spi_imx);