From patchwork Tue Dec 24 09:49:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 3401431 Return-Path: X-Original-To: patchwork-linux-spi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 824FBC0D4A for ; Tue, 24 Dec 2013 09:49:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8B3C4205F9 for ; Tue, 24 Dec 2013 09:49:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9A4DF205F2 for ; Tue, 24 Dec 2013 09:49:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751770Ab3LXJtw (ORCPT ); Tue, 24 Dec 2013 04:49:52 -0500 Received: from juliette.telenet-ops.be ([195.130.137.74]:42340 "EHLO juliette.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751744Ab3LXJtu (ORCPT ); Tue, 24 Dec 2013 04:49:50 -0500 Received: from ayla.of.borg ([84.193.72.141]) by juliette.telenet-ops.be with bizsmtp id 5Mpl1n00R32ts5g06Mplvb; Tue, 24 Dec 2013 10:49:45 +0100 Received: from geert by ayla.of.borg with local (Exim 4.76) (envelope-from ) id 1VvOcT-0005ar-0m; Tue, 24 Dec 2013 10:49:45 +0100 From: Geert Uytterhoeven To: Mark Brown Cc: linux-spi@vger.kernel.org, linux-sh@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 3/5] spi: rspi: Make more pointers const Date: Tue, 24 Dec 2013 10:49:32 +0100 Message-Id: <1387878574-21445-4-git-send-email-geert+renesas@linux-m68k.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1387878574-21445-1-git-send-email-geert+renesas@linux-m68k.org> References: <1387878574-21445-1-git-send-email-geert+renesas@linux-m68k.org> 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.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 Signed-off-by: Geert Uytterhoeven --- drivers/spi/spi-rspi.c | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c index a0038687a8fd..4e376db1ca4f 100644 --- a/drivers/spi/spi-rspi.c +++ b/drivers/spi/spi-rspi.c @@ -170,34 +170,35 @@ struct rspi_data { unsigned dma_callbacked:1; }; -static void rspi_write8(struct rspi_data *rspi, u8 data, u16 offset) +static void rspi_write8(const struct rspi_data *rspi, u8 data, u16 offset) { iowrite8(data, rspi->addr + offset); } -static void rspi_write16(struct rspi_data *rspi, u16 data, u16 offset) +static void rspi_write16(const struct rspi_data *rspi, u16 data, u16 offset) { iowrite16(data, rspi->addr + offset); } -static void rspi_write32(struct rspi_data *rspi, u32 data, u16 offset) +static void rspi_write32(const struct rspi_data *rspi, u32 data, u16 offset) { iowrite32(data, rspi->addr + offset); } -static u8 rspi_read8(struct rspi_data *rspi, u16 offset) +static u8 rspi_read8(const struct rspi_data *rspi, u16 offset) { return ioread8(rspi->addr + offset); } -static u16 rspi_read16(struct rspi_data *rspi, u16 offset) +static u16 rspi_read16(const struct rspi_data *rspi, u16 offset) { return ioread16(rspi->addr + offset); } /* optional functions */ struct spi_ops { - int (*set_config_register)(struct rspi_data *rspi, int access_size); + int (*set_config_register)(const struct rspi_data *rspi, + int access_size); int (*send_pio)(struct rspi_data *rspi, struct spi_message *mesg, struct spi_transfer *t); int (*receive_pio)(struct rspi_data *rspi, struct spi_message *mesg, @@ -208,7 +209,8 @@ struct spi_ops { /* * functions for RSPI */ -static int rspi_set_config_register(struct rspi_data *rspi, int access_size) +static int rspi_set_config_register(const struct rspi_data *rspi, + int access_size) { int spbr; @@ -243,7 +245,8 @@ static int rspi_set_config_register(struct rspi_data *rspi, int access_size) /* * functions for QSPI */ -static int qspi_set_config_register(struct rspi_data *rspi, int access_size) +static int qspi_set_config_register(const struct rspi_data *rspi, + int access_size) { u16 spcmd; int spbr; @@ -292,12 +295,12 @@ static int qspi_set_config_register(struct rspi_data *rspi, int access_size) #define set_config_register(spi, n) spi->ops->set_config_register(spi, n) -static void rspi_enable_irq(struct rspi_data *rspi, u8 enable) +static void rspi_enable_irq(const struct rspi_data *rspi, u8 enable) { rspi_write8(rspi, rspi_read8(rspi, RSPI_SPCR) | enable, RSPI_SPCR); } -static void rspi_disable_irq(struct rspi_data *rspi, u8 disable) +static void rspi_disable_irq(const struct rspi_data *rspi, u8 disable) { rspi_write8(rspi, rspi_read8(rspi, RSPI_SPCR) & ~disable, RSPI_SPCR); } @@ -316,12 +319,12 @@ static int rspi_wait_for_interrupt(struct rspi_data *rspi, u8 wait_mask, return 0; } -static void rspi_assert_ssl(struct rspi_data *rspi) +static void rspi_assert_ssl(const struct rspi_data *rspi) { rspi_write8(rspi, rspi_read8(rspi, RSPI_SPCR) | SPCR_SPE, RSPI_SPCR); } -static void rspi_negate_ssl(struct rspi_data *rspi) +static void rspi_negate_ssl(const struct rspi_data *rspi) { rspi_write8(rspi, rspi_read8(rspi, RSPI_SPCR) & ~SPCR_SPE, RSPI_SPCR); } @@ -507,7 +510,7 @@ end_nomap: return ret; } -static void rspi_receive_init(struct rspi_data *rspi) +static void rspi_receive_init(const struct rspi_data *rspi) { unsigned char spsr; @@ -555,7 +558,7 @@ static int rspi_receive_pio(struct rspi_data *rspi, struct spi_message *mesg, return 0; } -static void qspi_receive_init(struct rspi_data *rspi) +static void qspi_receive_init(const struct rspi_data *rspi) { unsigned char spsr; @@ -703,7 +706,7 @@ end_nomap: return ret; } -static int rspi_is_dma(struct rspi_data *rspi, struct spi_transfer *t) +static int rspi_is_dma(const struct rspi_data *rspi, struct spi_transfer *t) { if (t->tx_buf && rspi->chan_tx) return 1; @@ -824,7 +827,7 @@ static irqreturn_t rspi_irq(int irq, void *_sr) static int rspi_request_dma(struct rspi_data *rspi, struct platform_device *pdev) { - struct rspi_plat_data *rspi_pd = dev_get_platdata(&pdev->dev); + const struct rspi_plat_data *rspi_pd = dev_get_platdata(&pdev->dev); struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); dma_cap_mask_t mask; struct dma_slave_config cfg; @@ -898,7 +901,7 @@ static int rspi_probe(struct platform_device *pdev) struct rspi_data *rspi; int ret, irq; char clk_name[16]; - struct rspi_plat_data *rspi_pd = dev_get_platdata(&pdev->dev); + const struct rspi_plat_data *rspi_pd = dev_get_platdata(&pdev->dev); const struct spi_ops *ops; const struct platform_device_id *id_entry = pdev->id_entry;