From patchwork Wed Jun 8 17:02:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Shiyan X-Patchwork-Id: 9165357 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E173860572 for ; Wed, 8 Jun 2016 17:27:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CC05E28047 for ; Wed, 8 Jun 2016 17:27:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BE90728303; Wed, 8 Jun 2016 17:27:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9796828047 for ; Wed, 8 Jun 2016 17:27:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754059AbcFHR1J (ORCPT ); Wed, 8 Jun 2016 13:27:09 -0400 Received: from fallback3.mail.ru ([94.100.181.189]:46973 "EHLO fallback3.mail.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932492AbcFHRY6 (ORCPT ); Wed, 8 Jun 2016 13:24:58 -0400 Received: from smtp23.mail.ru (smtp23.mail.ru [94.100.181.178]) by fallback3.mail.ru (mPOP.Fallback_MX) with ESMTP id 7BE0317B85787 for ; Wed, 8 Jun 2016 20:02:21 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.ru; s=mail2; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=R0Iksh5taT5ghwG5+zJ5+P/ghbAlND4e1Bl37VevdzY=; b=Y4lDXYaU3MlTH/USA6dWKTBsPFu9UQVuidJbm8Mg9rrvLzgbtCyKdELuglQx+7VpG+4zCikODwAswLVB3PUumHXHZLSx/aLp9DkqBOubZ8weca0bT4GZPuSafM9nAPb8dK3ADtSSIRhHPEw/zx4tGD+zgC0TzIazxYXwKXYQAPo=; Received: from [5.18.96.7] (port=62313 helo=shc.zet) by smtp23.mail.ru with esmtpa (envelope-from ) id 1bAgry-00072O-3Y; Wed, 08 Jun 2016 20:02:18 +0300 From: Alexander Shiyan To: linux-spi@vger.kernel.org Cc: Mark Brown , Alexander Shiyan Subject: [PATCH 2/4] SPI: imx: Remove unnecessary field "mode" from struct spi_imx_config Date: Wed, 8 Jun 2016 20:02:07 +0300 Message-Id: <1465405329-5153-2-git-send-email-shc_work@mail.ru> X-Mailer: git-send-email 2.4.9 In-Reply-To: <1465405329-5153-1-git-send-email-shc_work@mail.ru> References: <1465405329-5153-1-git-send-email-shc_work@mail.ru> X-Mras: OK 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 SPI mode can be obtained directly from spi-device, there is no need to keep a copy. Signed-off-by: Alexander Shiyan --- drivers/spi/spi-imx.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c index cbcfb8b..0aa38c2 100644 --- a/drivers/spi/spi-imx.c +++ b/drivers/spi/spi-imx.c @@ -59,7 +59,6 @@ struct spi_imx_config { unsigned int speed_hz; unsigned int bpw; - unsigned int mode; }; enum spi_imx_devtype { @@ -360,19 +359,19 @@ static int __maybe_unused mx51_ecspi_config(struct spi_device *spi, cfg |= MX51_ECSPI_CONFIG_SBBCTRL(spi->chip_select); - if (config->mode & SPI_CPHA) + if (spi->mode & SPI_CPHA) cfg |= MX51_ECSPI_CONFIG_SCLKPHA(spi->chip_select); else cfg &= ~MX51_ECSPI_CONFIG_SCLKPHA(spi->chip_select); - if (config->mode & SPI_CPOL) { + if (spi->mode & SPI_CPOL) { cfg |= MX51_ECSPI_CONFIG_SCLKPOL(spi->chip_select); cfg |= MX51_ECSPI_CONFIG_SCLKCTL(spi->chip_select); } else { cfg &= ~MX51_ECSPI_CONFIG_SCLKPOL(spi->chip_select); cfg &= ~MX51_ECSPI_CONFIG_SCLKCTL(spi->chip_select); } - if (config->mode & SPI_CS_HIGH) + if (spi->mode & SPI_CS_HIGH) cfg |= MX51_ECSPI_CONFIG_SSBPOL(spi->chip_select); else cfg &= ~MX51_ECSPI_CONFIG_SSBPOL(spi->chip_select); @@ -384,7 +383,7 @@ static int __maybe_unused mx51_ecspi_config(struct spi_device *spi, writel(ctrl, spi_imx->base + MX51_ECSPI_CTRL); reg = readl(spi_imx->base + MX51_ECSPI_TESTREG); - if (config->mode & SPI_LOOP) + if (spi->mode & SPI_LOOP) reg |= MX51_ECSPI_TESTREG_LBC; else reg &= ~MX51_ECSPI_TESTREG_LBC; @@ -495,11 +494,11 @@ static int __maybe_unused mx31_config(struct spi_device *spi, reg |= (config->bpw - 1) << MX31_CSPICTRL_BC_SHIFT; } - if (config->mode & SPI_CPHA) + if (spi->mode & SPI_CPHA) reg |= MX31_CSPICTRL_PHA; - if (config->mode & SPI_CPOL) + if (spi->mode & SPI_CPOL) reg |= MX31_CSPICTRL_POL; - if (config->mode & SPI_CS_HIGH) + if (spi->mode & SPI_CS_HIGH) reg |= MX31_CSPICTRL_SSPOL; if (spi->cs_gpio < 0) reg |= (spi->cs_gpio + 32) << @@ -568,11 +567,11 @@ static int __maybe_unused mx21_config(struct spi_device *spi, MX21_CSPICTRL_DR_SHIFT; reg |= config->bpw - 1; - if (config->mode & SPI_CPHA) + if (spi->mode & SPI_CPHA) reg |= MX21_CSPICTRL_PHA; - if (config->mode & SPI_CPOL) + if (spi->mode & SPI_CPOL) reg |= MX21_CSPICTRL_POL; - if (config->mode & SPI_CS_HIGH) + if (spi->mode & SPI_CS_HIGH) reg |= MX21_CSPICTRL_SSPOL; if (spi->cs_gpio < 0) reg |= (spi->cs_gpio + 32) << MX21_CSPICTRL_CS_SHIFT; @@ -634,9 +633,9 @@ static int __maybe_unused mx1_config(struct spi_device *spi, MX1_CSPICTRL_DR_SHIFT; reg |= config->bpw - 1; - if (config->mode & SPI_CPHA) + if (spi->mode & SPI_CPHA) reg |= MX1_CSPICTRL_PHA; - if (config->mode & SPI_CPOL) + if (spi->mode & SPI_CPOL) reg |= MX1_CSPICTRL_POL; writel(reg, spi_imx->base + MXC_CSPICTRL); @@ -857,7 +856,6 @@ static int spi_imx_setupxfer(struct spi_device *spi, config.bpw = t ? t->bits_per_word : spi->bits_per_word; config.speed_hz = t ? t->speed_hz : spi->max_speed_hz; - config.mode = spi->mode; if (!config.speed_hz) config.speed_hz = spi->max_speed_hz;