From patchwork Fri May 6 17:19:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 9034861 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 9F13F9F6CD for ; Fri, 6 May 2016 17:19:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AF754200CC for ; Fri, 6 May 2016 17:19:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3E79E203A1 for ; Fri, 6 May 2016 17:19:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758570AbcEFRTZ (ORCPT ); Fri, 6 May 2016 13:19:25 -0400 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:58828 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758573AbcEFRTW (ORCPT ); Fri, 6 May 2016 13:19:22 -0400 Received: from debutante.sirena.org.uk ([2a01:348:6:8808:fab::3] helo=debutante) by mezzanine.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1ayjPE-0005gO-IE; Fri, 06 May 2016 17:19:16 +0000 Received: from broonie by debutante with local (Exim 4.87) (envelope-from ) id 1ayjPB-0006z2-Mc; Fri, 06 May 2016 18:19:09 +0100 From: Mark Brown To: Axel Lin Cc: Mark Brown , Mark Brown , Purna Chandra Mandal , linux-spi@vger.kernel.org In-Reply-To: <1461481160.19798.1.camel@ingics.com> Message-Id: Date: Fri, 06 May 2016 18:19:09 +0100 X-SA-Exim-Connect-IP: 2a01:348:6:8808:fab::3 X-SA-Exim-Mail-From: broonie@sirena.org.uk X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Subject: Applied "spi: pic32-sqi: Remove pic32_sqi_setup and pic32_sqi_cleanup" to the spi tree X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on mezzanine.sirena.org.uk) Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The patch spi: pic32-sqi: Remove pic32_sqi_setup and pic32_sqi_cleanup has been applied to the spi tree at git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark From 191ec113487e7e7adc4b890c290f63e9155264ad Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Sun, 24 Apr 2016 14:59:20 +0800 Subject: [PATCH] spi: pic32-sqi: Remove pic32_sqi_setup and pic32_sqi_cleanup Current code does not use ctldata at all, so remove spi_set_ctldata call. spi_setup() will set spi->bits_per_word = 8 if it was not set, so remove !spi->max_speed_hz checking. The spi core allows absent of spi->max_speed_hz setting, if it was not set spi_setup() assigns spi->master->max_speed_hz to it. spi core allows spi->max_speed_hz > spi->master->max_speed_hz, in this case spi core will limit the transfer speed to ensure xfer->speed_hz won't greater than spi->master->max_speed_hz so remove checking if spi->max_speed_hz is higher than spi->master->max_speed_hz. As a result, both pic32_sqi_setup() and pic32_sqi_cleanup() can be removed. Signed-off-by: Axel Lin Signed-off-by: Mark Brown --- drivers/spi/spi-pic32-sqi.c | 41 ----------------------------------------- 1 file changed, 41 deletions(-) diff --git a/drivers/spi/spi-pic32-sqi.c b/drivers/spi/spi-pic32-sqi.c index 74b9e684b10d..ca3c8d94b290 100644 --- a/drivers/spi/spi-pic32-sqi.c +++ b/drivers/spi/spi-pic32-sqi.c @@ -460,45 +460,6 @@ static int pic32_sqi_unprepare_hardware(struct spi_master *master) return 0; } -/* This may be called twice for each spi dev */ -static int pic32_sqi_setup(struct spi_device *spi) -{ - struct pic32_sqi *sqi; - - if (spi_get_ctldata(spi)) { - dev_err(&spi->dev, "is already associated\n"); - return -EBUSY; - } - - /* check word size */ - if (!spi->bits_per_word) { - dev_err(&spi->dev, "No bits_per_word defined\n"); - return -EINVAL; - } - - /* check maximum SPI clk rate */ - if (!spi->max_speed_hz) { - dev_err(&spi->dev, "No max speed HZ parameter\n"); - return -EINVAL; - } - - if (spi->master->max_speed_hz < spi->max_speed_hz) { - dev_err(&spi->dev, "max speed %u HZ is too high\n", - spi->max_speed_hz); - return -EINVAL; - } - - sqi = spi_master_get_devdata(spi->master); - spi_set_ctldata(spi, (void *)sqi); - - return 0; -} - -static void pic32_sqi_cleanup(struct spi_device *spi) -{ - spi_set_ctldata(spi, (void *)NULL); -} - static int ring_desc_ring_alloc(struct pic32_sqi *sqi) { struct ring_desc *rdesc; @@ -700,8 +661,6 @@ static int pic32_sqi_probe(struct platform_device *pdev) master->mode_bits = SPI_MODE_3 | SPI_MODE_0 | SPI_TX_DUAL | SPI_RX_DUAL | SPI_TX_QUAD | SPI_RX_QUAD; master->flags = SPI_MASTER_HALF_DUPLEX; - master->setup = pic32_sqi_setup; - master->cleanup = pic32_sqi_cleanup; master->can_dma = pic32_sqi_can_dma; master->bits_per_word_mask = SPI_BPW_RANGE_MASK(8, 32); master->transfer_one_message = pic32_sqi_one_message;