From patchwork Wed Jun 22 12:50:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 9192727 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 646FB60890 for ; Wed, 22 Jun 2016 12:58:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5531120072 for ; Wed, 22 Jun 2016 12:58:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4A14528406; Wed, 22 Jun 2016 12:58:38 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 BEE4B20072 for ; Wed, 22 Jun 2016 12:58:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751926AbcFVM6f (ORCPT ); Wed, 22 Jun 2016 08:58:35 -0400 Received: from newton.telenet-ops.be ([195.130.132.45]:49108 "EHLO newton.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751214AbcFVM6c (ORCPT ); Wed, 22 Jun 2016 08:58:32 -0400 X-Greylist: delayed 403 seconds by postgrey-1.27 at vger.kernel.org; Wed, 22 Jun 2016 08:58:28 EDT Received: from xavier.telenet-ops.be (xavier.telenet-ops.be [IPv6:2a02:1800:120:4::f00:14]) by newton.telenet-ops.be (Postfix) with ESMTP id 3rZPbc5fSYzMrVNH for ; Wed, 22 Jun 2016 14:51:08 +0200 (CEST) Received: from ayla.of.borg ([84.195.107.21]) by xavier.telenet-ops.be with bizsmtp id 9oq71t00B0TjorY01oq7pZ; Wed, 22 Jun 2016 14:50:07 +0200 Received: from ramsan.of.borg ([192.168.97.29] helo=ramsan) by ayla.of.borg with esmtp (Exim 4.82) (envelope-from ) id 1bFhbb-0005L2-7e; Wed, 22 Jun 2016 14:50:07 +0200 Received: from geert by ramsan with local (Exim 4.82) (envelope-from ) id 1bFhbb-0000mQ-TX; Wed, 22 Jun 2016 14:50:07 +0200 From: Geert Uytterhoeven To: Mark Brown Cc: linux-spi@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH] spi: sh-msiof: Remove sh_msiof_spi_priv.chipdata Date: Wed, 22 Jun 2016 14:50:03 +0200 Message-Id: <1466599803-2965-1-git-send-email-geert+renesas@glider.be> X-Mailer: git-send-email 1.9.1 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 After probe time, the pointer to the sh_msiof_chipdata structure in the sh_msiof_spi_priv structure is used only for checking the SPI master flags. As these are also available in the spi_master structure, convert the users to access those, and remove the pointer. Signed-off-by: Geert Uytterhoeven --- drivers/spi/spi-sh-msiof.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/spi/spi-sh-msiof.c b/drivers/spi/spi-sh-msiof.c index a7934ab00b96505f..0f83ad1d5a5858dd 100644 --- a/drivers/spi/spi-sh-msiof.c +++ b/drivers/spi/spi-sh-msiof.c @@ -45,7 +45,6 @@ struct sh_msiof_spi_priv { void __iomem *mapbase; struct clk *clk; struct platform_device *pdev; - const struct sh_msiof_chipdata *chipdata; struct sh_msiof_spi_info *info; struct completion done; unsigned int tx_fifo_size; @@ -271,7 +270,7 @@ static void sh_msiof_spi_set_clk_regs(struct sh_msiof_spi_priv *p, scr = sh_msiof_spi_div_table[k].brdv | SCR_BRPS(brps); sh_msiof_write(p, TSCR, scr); - if (!(p->chipdata->master_flags & SPI_MASTER_MUST_TX)) + if (!(p->master->flags & SPI_MASTER_MUST_TX)) sh_msiof_write(p, RSCR, scr); } @@ -336,7 +335,7 @@ static void sh_msiof_spi_set_pin_regs(struct sh_msiof_spi_priv *p, tmp |= lsb_first << MDR1_BITLSB_SHIFT; tmp |= sh_msiof_spi_get_dtdl_and_syncdl(p); sh_msiof_write(p, TMDR1, tmp | MDR1_TRMD | TMDR1_PCON); - if (p->chipdata->master_flags & SPI_MASTER_MUST_TX) { + if (p->master->flags & SPI_MASTER_MUST_TX) { /* These bits are reserved if RX needs TX */ tmp &= ~0x0000ffff; } @@ -360,7 +359,7 @@ static void sh_msiof_spi_set_mode_regs(struct sh_msiof_spi_priv *p, { u32 dr2 = MDR2_BITLEN1(bits) | MDR2_WDLEN1(words); - if (tx_buf || (p->chipdata->master_flags & SPI_MASTER_MUST_TX)) + if (tx_buf || (p->master->flags & SPI_MASTER_MUST_TX)) sh_msiof_write(p, TMDR2, dr2); else sh_msiof_write(p, TMDR2, dr2 | MDR2_GRPMASK1); @@ -1152,6 +1151,7 @@ static int sh_msiof_spi_probe(struct platform_device *pdev) { struct resource *r; struct spi_master *master; + const struct sh_msiof_chipdata *chipdata; const struct of_device_id *of_id; struct sh_msiof_spi_priv *p; int i; @@ -1170,10 +1170,10 @@ static int sh_msiof_spi_probe(struct platform_device *pdev) of_id = of_match_device(sh_msiof_match, &pdev->dev); if (of_id) { - p->chipdata = of_id->data; + chipdata = of_id->data; p->info = sh_msiof_spi_parse_dt(&pdev->dev); } else { - p->chipdata = (const void *)pdev->id_entry->driver_data; + chipdata = (const void *)pdev->id_entry->driver_data; p->info = dev_get_platdata(&pdev->dev); } @@ -1217,8 +1217,8 @@ static int sh_msiof_spi_probe(struct platform_device *pdev) pm_runtime_enable(&pdev->dev); /* Platform data may override FIFO sizes */ - p->tx_fifo_size = p->chipdata->tx_fifo_size; - p->rx_fifo_size = p->chipdata->rx_fifo_size; + p->tx_fifo_size = chipdata->tx_fifo_size; + p->rx_fifo_size = chipdata->rx_fifo_size; if (p->info->tx_fifo_override) p->tx_fifo_size = p->info->tx_fifo_override; if (p->info->rx_fifo_override) @@ -1227,7 +1227,7 @@ static int sh_msiof_spi_probe(struct platform_device *pdev) /* init master code */ master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH; master->mode_bits |= SPI_LSB_FIRST | SPI_3WIRE; - master->flags = p->chipdata->master_flags; + master->flags = chipdata->master_flags; master->bus_num = pdev->id; master->dev.of_node = pdev->dev.of_node; master->num_chipselect = p->info->num_chipselect;