From patchwork Thu Sep 10 14:11:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Gorski X-Patchwork-Id: 7154561 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 2C3479F314 for ; Thu, 10 Sep 2015 14:13:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 51B4B20628 for ; Thu, 10 Sep 2015 14:13:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C139820632 for ; Thu, 10 Sep 2015 14:12:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753370AbbIJOMz (ORCPT ); Thu, 10 Sep 2015 10:12:55 -0400 Received: from arrakis.dune.hu ([78.24.191.176]:53101 "EHLO arrakis.dune.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752521AbbIJOMz (ORCPT ); Thu, 10 Sep 2015 10:12:55 -0400 Received: from localhost (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 8C95F2873ED; Thu, 10 Sep 2015 16:11:43 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Virus-Scanned: at arrakis.dune.hu Received: from localhost.localdomain (dslb-088-073-016-160.088.073.pools.vodafone-ip.de [88.73.16.160]) by arrakis.dune.hu (Postfix) with ESMTPSA id 2BF9828C1B1; Thu, 10 Sep 2015 16:11:36 +0200 (CEST) From: Jonas Gorski To: linux-spi@vger.kernel.org Cc: Mark Brown , Florian Fainelli Subject: [PATCH 4/6] spi/bcm63xx: replace custom io accessors with standard ones Date: Thu, 10 Sep 2015 16:11:42 +0200 Message-Id: <1441894304-22316-5-git-send-email-jogo@openwrt.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1441894304-22316-1-git-send-email-jogo@openwrt.org> References: <1441894304-22316-1-git-send-email-jogo@openwrt.org> 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 Replace all bcm_read* with (io)read. Due to this block following system endianness, make sure we match that. Signed-off-by: Jonas Gorski --- drivers/spi/spi-bcm63xx.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-bcm63xx.c b/drivers/spi/spi-bcm63xx.c index c1364a8..ef05387 100644 --- a/drivers/spi/spi-bcm63xx.c +++ b/drivers/spi/spi-bcm63xx.c @@ -56,25 +56,33 @@ struct bcm63xx_spi { static inline u8 bcm_spi_readb(struct bcm63xx_spi *bs, unsigned int offset) { - return bcm_readb(bs->regs + bcm63xx_spireg(offset)); + return readb(bs->regs + bcm63xx_spireg(offset)); } static inline u16 bcm_spi_readw(struct bcm63xx_spi *bs, unsigned int offset) { - return bcm_readw(bs->regs + bcm63xx_spireg(offset)); +#ifdef CONFIG_BIG_ENDIAN + return ioread16(bs->regs + bcm63xx_spireg(offset)); +#else + return readw(bs->regs + bcm63xx_spireg(offset)); +#endif } static inline void bcm_spi_writeb(struct bcm63xx_spi *bs, u8 value, unsigned int offset) { - bcm_writeb(value, bs->regs + bcm63xx_spireg(offset)); + writeb(value, bs->regs + bcm63xx_spireg(offset)); } static inline void bcm_spi_writew(struct bcm63xx_spi *bs, u16 value, unsigned int offset) { - bcm_writew(value, bs->regs + bcm63xx_spireg(offset)); +#ifdef CONFIG_BIG_ENDIAN + iowrite16(value, bs->regs + bcm63xx_spireg(offset)); +#else + writew(value, bs->regs + bcm63xx_spireg(offset)); +#endif } static const unsigned bcm63xx_spi_freq_table[SPI_CLK_MASK][2] = {