From patchwork Mon Apr 16 19:15:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Liu X-Patchwork-Id: 10343717 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 ABE83601D7 for ; Mon, 16 Apr 2018 19:15:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9DB16288C9 for ; Mon, 16 Apr 2018 19:15:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 926DC288CB; Mon, 16 Apr 2018 19:15:15 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, 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 C3040288C9 for ; Mon, 16 Apr 2018 19:15:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753277AbeDPTPM (ORCPT ); Mon, 16 Apr 2018 15:15:12 -0400 Received: from lelnx194.ext.ti.com ([198.47.27.80]:20226 "EHLO lelnx194.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751164AbeDPTPM (ORCPT ); Mon, 16 Apr 2018 15:15:12 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by lelnx194.ext.ti.com (8.15.1/8.15.1) with ESMTP id w3GJFBZY013262 for ; Mon, 16 Apr 2018 14:15:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1523906111; bh=BhKa/tC+gJqqJst/ZmxN1WS+v0J5/Myb5tHctasVr9A=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=iQZcNL/ZDA3O9PDoRjDf0gJtG2Smihhdjd2Cyzqe0BdL3NLXECm2Rp6AjS0Lsikys NI2o572H4oBjLC+XQzQFIWMcamsTBPG03Agf8umA7hwi+qaa4kdZDWOcRDvVa1qrxB pvSzDsAN2Uee4IhoLwtav3cePYlWe8lbKI+yVr3k= Received: from DFLE106.ent.ti.com (dfle106.ent.ti.com [10.64.6.27]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w3GJFBTM024516 for ; Mon, 16 Apr 2018 14:15:11 -0500 Received: from DFLE110.ent.ti.com (10.64.6.31) by DFLE106.ent.ti.com (10.64.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.35; Mon, 16 Apr 2018 14:15:11 -0500 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE110.ent.ti.com (10.64.6.31) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1261.35 via Frontend Transport; Mon, 16 Apr 2018 14:15:11 -0500 Received: from uda0271908.am.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id w3GJFBR9022795; Mon, 16 Apr 2018 14:15:11 -0500 From: Bin Liu To: CC: Bin Liu Subject: [PATCH 02/11] usb: musb: remove readl/writel from struct musb_platform_ops Date: Mon, 16 Apr 2018 14:15:02 -0500 Message-ID: <1523906111-2328-3-git-send-email-b-liu@ti.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1523906111-2328-1-git-send-email-b-liu@ti.com> References: <1523906111-2328-1-git-send-email-b-liu@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Now Blackfin support is removed, we no longer need function pointers for musb_readl() and musb_writel(). Signed-off-by: Bin Liu --- drivers/usb/musb/musb_core.c | 34 ++++++++++++---------------------- drivers/usb/musb/musb_core.h | 4 ---- drivers/usb/musb/musb_io.h | 4 ++-- 3 files changed, 14 insertions(+), 28 deletions(-) diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index fb5e4523dc28..4ff6da1aa775 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c @@ -274,20 +274,6 @@ static void musb_default_writew(void __iomem *addr, unsigned offset, u16 data) __raw_writew(data, addr + offset); } -static u32 musb_default_readl(const void __iomem *addr, unsigned offset) -{ - u32 data = __raw_readl(addr + offset); - - trace_musb_readl(__builtin_return_address(0), addr, offset, data); - return data; -} - -static void musb_default_writel(void __iomem *addr, unsigned offset, u32 data) -{ - trace_musb_writel(__builtin_return_address(0), addr, offset, data); - __raw_writel(data, addr + offset); -} - /* * Load an endpoint's FIFO */ @@ -390,10 +376,20 @@ static void musb_default_read_fifo(struct musb_hw_ep *hw_ep, u16 len, u8 *dst) void (*musb_writew)(void __iomem *addr, unsigned offset, u16 data); EXPORT_SYMBOL_GPL(musb_writew); -u32 (*musb_readl)(const void __iomem *addr, unsigned offset); +u32 musb_readl(const void __iomem *addr, unsigned offset) +{ + u32 data = __raw_readl(addr + offset); + + trace_musb_readl(__builtin_return_address(0), addr, offset, data); + return data; +} EXPORT_SYMBOL_GPL(musb_readl); -void (*musb_writel)(void __iomem *addr, unsigned offset, u32 data); +void musb_writel(void __iomem *addr, unsigned offset, u32 data) +{ + trace_musb_writel(__builtin_return_address(0), addr, offset, data); + __raw_writel(data, addr + offset); +} EXPORT_SYMBOL_GPL(musb_writel); #ifndef CONFIG_MUSB_PIO_ONLY @@ -2158,8 +2154,6 @@ static void musb_deassert_reset(struct work_struct *work) musb_writeb = musb_default_writeb; musb_readw = musb_default_readw; musb_writew = musb_default_writew; - musb_readl = musb_default_readl; - musb_writel = musb_default_writel; /* The musb_platform_init() call: * - adjusts musb->mregs @@ -2226,10 +2220,6 @@ static void musb_deassert_reset(struct work_struct *work) musb_readw = musb->ops->readw; if (musb->ops->writew) musb_writew = musb->ops->writew; - if (musb->ops->readl) - musb_readl = musb->ops->readl; - if (musb->ops->writel) - musb_writel = musb->ops->writel; #ifndef CONFIG_MUSB_PIO_ONLY if (!musb->ops->dma_init || !musb->ops->dma_exit) { diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h index 8a74cb2907f8..a4bf1e9e2d2c 100644 --- a/drivers/usb/musb/musb_core.h +++ b/drivers/usb/musb/musb_core.h @@ -127,8 +127,6 @@ enum musb_g_ep0_state { * @writeb: write 8 bits * @readw: read 16 bits * @writew: write 16 bits - * @readl: read 32 bits - * @writel: write 32 bits * @read_fifo: reads the fifo * @write_fifo: writes to fifo * @dma_init: platform specific dma init function @@ -174,8 +172,6 @@ struct musb_platform_ops { void (*writeb)(void __iomem *addr, unsigned offset, u8 data); u16 (*readw)(const void __iomem *addr, unsigned offset); void (*writew)(void __iomem *addr, unsigned offset, u16 data); - u32 (*readl)(const void __iomem *addr, unsigned offset); - void (*writel)(void __iomem *addr, unsigned offset, u32 data); void (*read_fifo)(struct musb_hw_ep *hw_ep, u16 len, u8 *buf); void (*write_fifo)(struct musb_hw_ep *hw_ep, u16 len, const u8 *buf); struct dma_controller * diff --git a/drivers/usb/musb/musb_io.h b/drivers/usb/musb/musb_io.h index b7025b2e6e00..b4d870b836aa 100644 --- a/drivers/usb/musb/musb_io.h +++ b/drivers/usb/musb/musb_io.h @@ -39,7 +39,7 @@ struct musb_io { extern void (*musb_writeb)(void __iomem *addr, unsigned offset, u8 data); extern u16 (*musb_readw)(const void __iomem *addr, unsigned offset); extern void (*musb_writew)(void __iomem *addr, unsigned offset, u16 data); -extern u32 (*musb_readl)(const void __iomem *addr, unsigned offset); -extern void (*musb_writel)(void __iomem *addr, unsigned offset, u32 data); +extern u32 musb_readl(const void __iomem *addr, unsigned offset); +extern void musb_writel(void __iomem *addr, unsigned offset, u32 data); #endif