From patchwork Sun Nov 13 13:38:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 9424831 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 73E2060484 for ; Sun, 13 Nov 2016 13:54:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 665A627FAC for ; Sun, 13 Nov 2016 13:54:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5B7DF28584; Sun, 13 Nov 2016 13:54:31 +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.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, 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 0A7DD27FAC for ; Sun, 13 Nov 2016 13:54:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933904AbcKMNya (ORCPT ); Sun, 13 Nov 2016 08:54:30 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:35311 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933365AbcKMNy3 (ORCPT ); Sun, 13 Nov 2016 08:54:29 -0500 Received: by mail-wm0-f66.google.com with SMTP id a20so8389614wme.2 for ; Sun, 13 Nov 2016 05:54:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:subject:to:references:cc:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=YuxnjqrOTXYVQFzvHVRIoo7lom+iMXN7UxT7vJSY15w=; b=b1TybJKArmVDcCkDD00mFXIANbK0Z+lH4TGB82xTzlP5Bz0IB1VH6zlgWH22Qls0ma fr1PISv4UgxHT4cubmf4IX94oPiWFr89X024QRK0W5EwwtShc7kKAzXOd7gA91iP73a+ LoUYsimPz6M79G8Jc2jlZJef8pobycdJuD+STLWSGprFlQa6PnimsWKj4Wkyiuftt5NS 91mdHTLOcT3Szf75FNKgyUQg8i7Nrg98+ywc7pPANBAdbmtcGYSouHKxpwhryd2lM1qY W8uB058fhcBrEwr7ALIm3Z3lMxUUVFpPDSaD+ggBugQFRn3E63kvhCPEqKgICCdAYDub eMKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:subject:to:references:cc:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=YuxnjqrOTXYVQFzvHVRIoo7lom+iMXN7UxT7vJSY15w=; b=Co9Dbs2ceUz5uYRV+HQUOmPDVxRvHuO5bPofWWdZg73UNtMmpTQy+xE1VPw15MMSyi QNYHEluXqeQGO6cz+3k4820aiyf6v7ZswfdMMPT3yNYyFav2jK3v9WhkTmrEOc0lthB4 3xLobxwj+oHdNElbXq8ITcI0t/TxgDqW/bdyO0dOFZCs2jYmxwRrCHXzFziQAlIp9+dw LNjphXtpsYciWiLlnL9wHVB2MmyoMkXAb8WDjEhZVin4DjrysSMepv6zWTDB1xiiiTND /VyWr8LYIY+Upy2rujg3gApqyzqUNMmTRGPsYfaop+Q2iRze2d8887KNq4HNBI2jVIqq oSlA== X-Gm-Message-State: ABUngvcClf482KxtTIV0xv3IE7SZH9rLbEHNCgcjROhMW/OazYwkbT4nS7fGf6IJK46Itg== X-Received: by 10.194.187.103 with SMTP id fr7mr15129513wjc.99.1479044483051; Sun, 13 Nov 2016 05:41:23 -0800 (PST) Received: from ?IPv6:2003:62:5f58:9d00:45b5:f382:329:d09c? (p200300625F589D0045B5F3820329D09C.dip0.t-ipconnect.de. [2003:62:5f58:9d00:45b5:f382:329:d09c]) by smtp.googlemail.com with ESMTPSA id d85sm30060038wmd.17.2016.11.13.05.41.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 13 Nov 2016 05:41:22 -0800 (PST) From: Heiner Kallweit Subject: [PATCH 07/10] spi: fsl-espi: introduce struct fsl_espi_cs To: Mark Brown References: Cc: "linux-spi@vger.kernel.org" Message-ID: Date: Sun, 13 Nov 2016 14:38:05 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: 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 Very little from struct spi_mpc8xxx_cs is relevant for fsl-espi. Therefore replace it with struct fsl_espi_cs. Signed-off-by: Heiner Kallweit --- drivers/spi/spi-fsl-espi.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-fsl-espi.c b/drivers/spi/spi-fsl-espi.c index 58314d7..5d84694 100644 --- a/drivers/spi/spi-fsl-espi.c +++ b/drivers/spi/spi-fsl-espi.c @@ -93,6 +93,10 @@ #define AUTOSUSPEND_TIMEOUT 2000 +struct fsl_espi_cs { + u32 hw_mode; +}; + static inline u32 fsl_espi_read_reg(struct mpc8xxx_spi *mspi, int offset) { return ioread32be(mspi->reg_base + offset); @@ -280,7 +284,7 @@ static void fsl_espi_setup_transfer(struct spi_device *spi, struct mpc8xxx_spi *mpc8xxx_spi = spi_master_get_devdata(spi->master); int bits_per_word = t ? t->bits_per_word : spi->bits_per_word; u32 pm, hz = t ? t->speed_hz : spi->max_speed_hz; - struct spi_mpc8xxx_cs *cs = spi->controller_state; + struct fsl_espi_cs *cs = spi_get_ctldata(spi); u32 hw_mode_old = cs->hw_mode; /* mask out bits we are going to set */ @@ -437,7 +441,7 @@ static int fsl_espi_setup(struct spi_device *spi) { struct mpc8xxx_spi *mpc8xxx_spi; u32 loop_mode; - struct spi_mpc8xxx_cs *cs = spi_get_ctldata(spi); + struct fsl_espi_cs *cs = spi_get_ctldata(spi); if (!spi->max_speed_hz) return -EINVAL; @@ -483,7 +487,7 @@ static int fsl_espi_setup(struct spi_device *spi) static void fsl_espi_cleanup(struct spi_device *spi) { - struct spi_mpc8xxx_cs *cs = spi_get_ctldata(spi); + struct fsl_espi_cs *cs = spi_get_ctldata(spi); kfree(cs); spi_set_ctldata(spi, NULL);