From patchwork Sat Mar 29 10:50:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 3908271 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 C41049F2B6 for ; Sat, 29 Mar 2014 10:50:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D663E20274 for ; Sat, 29 Mar 2014 10:50:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D1A2120272 for ; Sat, 29 Mar 2014 10:50:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751400AbaC2KuT (ORCPT ); Sat, 29 Mar 2014 06:50:19 -0400 Received: from mail-pb0-f44.google.com ([209.85.160.44]:65020 "EHLO mail-pb0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751289AbaC2KuS (ORCPT ); Sat, 29 Mar 2014 06:50:18 -0400 Received: by mail-pb0-f44.google.com with SMTP id rp16so6105968pbb.17 for ; Sat, 29 Mar 2014 03:50:17 -0700 (PDT) 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=4vGQP2/stTuaa65yipaWCbIEPHXXPtsoIs+ZduaIWdM=; b=CjVlB/2c1TjMiLBd/RtemH7PKOAx5Uw06RHsglaYOHmRhIrSsyknO/fw+Gx/0g1R1c /GBjqBcFMxSY5hjhYL7k3d7ZFBYx1nxGgaLg3IbOedwBZyIpVNCxsuDgDH+3fLhZePat E+9oTXPQROIoUWBFOHox00YL0bDdCH5a64nj/MuvBFYG0p9iS8fESnsCPx3oTQ+wrCKo WjIWf2zCMF9IBgyE0LRf8XLdhSdfUS7rMcspozjCnxun6lQKuyIW8CzI+wvIB2ZfoVMN TZJnJwTp2mAMLcZ+qUS71ES2P22AEq/s81IOndc9cjF+r5WqIb7FgUmnzED/WRy0GwYW MR7A== X-Gm-Message-State: ALoCoQns22FwHdu44Z57pmJdLRa1zHoiJqwfHgVvzyIuG4DlTuNlCQymlywwfNJVmlIeKHkHYmT0 X-Received: by 10.68.171.193 with SMTP id aw1mr13722825pbc.117.1396090217783; Sat, 29 Mar 2014 03:50:17 -0700 (PDT) Received: from [192.168.0.119] (59-115-21-222.dynamic.hinet.net. [59.115.21.222]) by mx.google.com with ESMTPSA id y4sm30668438pbk.76.2014.03.29.03.50.15 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Sat, 29 Mar 2014 03:50:17 -0700 (PDT) Message-ID: <1396090212.3823.1.camel@phoenix> Subject: [PATCH v2] spi: bitbang: Make spi_bitbang_stop() return void From: Axel Lin To: Mark Brown Cc: linux-spi@vger.kernel.org Date: Sat, 29 Mar 2014 18:50:12 +0800 X-Mailer: Evolution 3.8.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.3 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 spi_bitbang_stop() never fails, so make it return void. Signed-off-by: Axel Lin --- v2: also update the code for drivers/spi/spi-butterfly.c. Note, spi-sh-msiof.c does use bitbang now. drivers/spi/spi-bitbang.c | 4 +--- drivers/spi/spi-butterfly.c | 3 +-- drivers/spi/spi-gpio.c | 5 ++--- drivers/spi/spi-omap-uwire.c | 5 ++--- include/linux/spi/spi_bitbang.h | 2 +- 5 files changed, 7 insertions(+), 12 deletions(-) diff --git a/drivers/spi/spi-bitbang.c b/drivers/spi/spi-bitbang.c index 3bfdb85..dc7d2c2 100644 --- a/drivers/spi/spi-bitbang.c +++ b/drivers/spi/spi-bitbang.c @@ -466,11 +466,9 @@ EXPORT_SYMBOL_GPL(spi_bitbang_start); /** * spi_bitbang_stop - stops the task providing spi communication */ -int spi_bitbang_stop(struct spi_bitbang *bitbang) +void spi_bitbang_stop(struct spi_bitbang *bitbang) { spi_unregister_master(bitbang->master); - - return 0; } EXPORT_SYMBOL_GPL(spi_bitbang_stop); diff --git a/drivers/spi/spi-butterfly.c b/drivers/spi/spi-butterfly.c index 8081f96..ee4f91c 100644 --- a/drivers/spi/spi-butterfly.c +++ b/drivers/spi/spi-butterfly.c @@ -309,7 +309,6 @@ done: static void butterfly_detach(struct parport *p) { struct butterfly *pp; - int status; /* FIXME this global is ugly ... but, how to quickly get from * the parport to the "struct butterfly" associated with it? @@ -321,7 +320,7 @@ static void butterfly_detach(struct parport *p) butterfly = NULL; /* stop() unregisters child devices too */ - status = spi_bitbang_stop(&pp->bitbang); + spi_bitbang_stop(&pp->bitbang); /* turn off VCC */ parport_write_data(pp->port, 0); diff --git a/drivers/spi/spi-gpio.c b/drivers/spi/spi-gpio.c index 406bbd7..0982307 100644 --- a/drivers/spi/spi-gpio.c +++ b/drivers/spi/spi-gpio.c @@ -502,13 +502,12 @@ static int spi_gpio_remove(struct platform_device *pdev) { struct spi_gpio *spi_gpio; struct spi_gpio_platform_data *pdata; - int status; spi_gpio = platform_get_drvdata(pdev); pdata = dev_get_platdata(&pdev->dev); /* stop() unregisters child devices too */ - status = spi_bitbang_stop(&spi_gpio->bitbang); + spi_bitbang_stop(&spi_gpio->bitbang); if (SPI_MISO_GPIO != SPI_GPIO_NO_MISO) gpio_free(SPI_MISO_GPIO); @@ -517,7 +516,7 @@ static int spi_gpio_remove(struct platform_device *pdev) gpio_free(SPI_SCK_GPIO); spi_master_put(spi_gpio->bitbang.master); - return status; + return 0; } MODULE_ALIAS("platform:" DRIVER_NAME); diff --git a/drivers/spi/spi-omap-uwire.c b/drivers/spi/spi-omap-uwire.c index 31ce92f..be2a2e1 100644 --- a/drivers/spi/spi-omap-uwire.c +++ b/drivers/spi/spi-omap-uwire.c @@ -516,14 +516,13 @@ static int uwire_probe(struct platform_device *pdev) static int uwire_remove(struct platform_device *pdev) { struct uwire_spi *uwire = platform_get_drvdata(pdev); - int status; // FIXME remove all child devices, somewhere ... - status = spi_bitbang_stop(&uwire->bitbang); + spi_bitbang_stop(&uwire->bitbang); uwire_off(uwire); iounmap(uwire_base); - return status; + return 0; } /* work with hotplug and coldplug */ diff --git a/include/linux/spi/spi_bitbang.h b/include/linux/spi/spi_bitbang.h index daebaba..85578d4 100644 --- a/include/linux/spi/spi_bitbang.h +++ b/include/linux/spi/spi_bitbang.h @@ -42,6 +42,6 @@ extern int spi_bitbang_setup_transfer(struct spi_device *spi, /* start or stop queue processing */ extern int spi_bitbang_start(struct spi_bitbang *spi); -extern int spi_bitbang_stop(struct spi_bitbang *spi); +extern void spi_bitbang_stop(struct spi_bitbang *spi); #endif /* __SPI_BITBANG_H */