From patchwork Fri Jan 20 21:04:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 9529461 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 BD6846020B for ; Fri, 20 Jan 2017 21:21:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AD840286CF for ; Fri, 20 Jan 2017 21:21:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A247D286D4; Fri, 20 Jan 2017 21:21:22 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable 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 6ACDA286CF for ; Fri, 20 Jan 2017 21:21:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752058AbdATVUy (ORCPT ); Fri, 20 Jan 2017 16:20:54 -0500 Received: from mail-bn3nam01on0065.outbound.protection.outlook.com ([104.47.33.65]:65152 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752000AbdATVUn (ORCPT ); Fri, 20 Jan 2017 16:20:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sandiskcorp.onmicrosoft.com; s=selector1-sandisk-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=zKU44O1FycMn1GJXX98wbbva15al3+8CXzorI5wPQno=; b=RbqvNVpalY7w8XmlHcNAGzLE2Ed/N7hUNDK3Ysw+ZYUqAlOVW0m0kUKyH9ENkaUi6TIUuA693fZVEmypOZMtXU8WjbzyADNPNn3KxoAF1gxqa9anPtmFKZYP5OIz/oh40BKDC1DhtxzsJXRJZEnjnap3Mezmn914KWJwONHo55I= Received: from BY2PR02CA0048.namprd02.prod.outlook.com (10.141.216.38) by DM2PR02MB1289.namprd02.prod.outlook.com (10.161.142.153) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.845.12; Fri, 20 Jan 2017 21:04:45 +0000 Received: from BY2FFO11FD045.protection.gbl (2a01:111:f400:7c0c::149) by BY2PR02CA0048.outlook.office365.com (2a01:111:e400:2c40::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.860.13 via Frontend Transport; Fri, 20 Jan 2017 21:04:45 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.21) smtp.mailfrom=sandisk.com; redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=bestguesspass action=none header.from=sandisk.com; Received-SPF: Pass (protection.outlook.com: domain of sandisk.com designates 63.163.107.21 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.21; helo=milsmgep15.sandisk.com; Received: from milsmgep15.sandisk.com (63.163.107.21) by BY2FFO11FD045.mail.protection.outlook.com (10.1.15.177) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.803.8 via Frontend Transport; Fri, 20 Jan 2017 21:04:44 +0000 Received: from MILHUBIP04.sdcorp.global.sandisk.com (Unknown_Domain [10.201.67.162]) (using TLS with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by (Symantec Messaging Gateway) with SMTP id 94.B8.65426.BA872885; Fri, 20 Jan 2017 12:52:59 -0800 (PST) Received: from milsmgip11.sandisk.com (10.177.9.6) by MILHUBIP04.sdcorp.global.sandisk.com (10.177.9.97) with Microsoft SMTP Server id 14.3.319.2; Fri, 20 Jan 2017 13:04:40 -0800 X-AuditID: 0ac94369-b62949800001ff92-20-588278ab3d4e Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id F6.33.16817.86B72885; Fri, 20 Jan 2017 13:04:40 -0800 (PST) From: Bart Van Assche To: Doug Ledford CC: , Bart Van Assche , Benjamin Herrenschmidt , Boris Ostrovsky , David Woodhouse , Juergen Gross , "H . Peter Anvin" , Ingo Molnar , , , Russell King , Subject: [PATCH v3 04/37] treewide: Consolidate get_dma_ops() implementations Date: Fri, 20 Jan 2017 13:04:04 -0800 Message-ID: <20170120210437.26389-5-bart.vanassche@sandisk.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170120210437.26389-1-bart.vanassche@sandisk.com> References: <20170120210437.26389-1-bart.vanassche@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprGIsWRmVeSWpSXmKPExsXCddJ5ke7qiqYIg5PdChYfmlqZLS5Ob2Wx eHn+A6vFxJWTmS2mbRS3mHPTyKJj11cWi8u75rBZPDvUy2JxaOpeRotLBxYwWfzY8JjVgcfj 8rWLzB6bV2h59LxpYfXYtKqTzePj01ssHu/3XWXzWL/lKovH501yHidavrAGcEZx2aSk5mSW pRbp2yVwZZyfdZKpYMY8xorLTzkaGDe1M3YxcnJICJhILFrVwwJiCwksZZK4v9Ohi5ELyN7G KPF/7ly4ounNt9kgEpsZJd69fMwEkmATMJL49n4mWLeIgJrEpleL2EGKmAX2MEvM2P0frEhY wFei70o/K4jNIqAq8XhqA9hUXgF7iZX7W9khNshL7Gq7CFbDKeAg8elyHyPESfYSxy8/BRsq IfCUVWL+re9MEM2CEidnPgHbzCwgIXHwxQtmiAZ1iZNL5jNNYBSahaRsFpKyBYxMqxjFcjNz inPTUwsMTfWKE/NSMouz9ZLzczcxQmIrcwfj3SfehxgFOBiVeHgVApoihFgTy4orcw8xSnAw K4nwvq4ECvGmJFZWpRblxxeV5qQWH2KU5mBREud1u/clTEggPbEkNTs1tSC1CCbLxMEp1cC4 esnZTdfbpx8KNL0te923OET8T2ngClGb6hLn3ZcZLilN+aPNWZP3oXqTu6SewpRntw7+ksra 8MeFt1EoM/b5R7v7AvP5vt2Yfa+h98EXdaFQU9a2P1siKv/EyV16dOrJ5oALSaYhgYqbItX1 StQ2PXzMrD/hWeQ9NRdb9zcv/PiYOExLeiYosRRnJBpqMRcVJwIAPMc0/akCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrGJMWRmVeSWpSXmKPExsXCtZEjRTejuinC4PFEKYuDP9sYLT40tTJb XJzeymLx8vwHVouJKyczW0zbKG4x56aRRceurywWl3fNYbN4dqiXxeLQ1L2MFpcOLGCy+LHh MasDr8flaxeZPTav0PLoedPC6rFpVSebx8ent1g83u+7yuYxbc15Jo/1W66yeHzeJOdxouUL awBXFJdNSmpOZllqkb5dAlfG+VknmQpmzGOsuPyUo4FxUztjFyMnh4SAicT05ttsXYxcHEIC GxklVt66AJZgEzCS+PZ+JguILSKgJrHp1SJ2kCJmgX3MEivbPjCDJIQFfCX6rvSzgtgsAqoS j6c2gDXzCthLXFu4lhlig7zErraLYDWcAg4Sny73gdUIAdUcv/yUfQIj9wJGhlWMYrmZOcW5 6ZkFhoZ6xYl5KZnF2XrJ+bmbGMEhyRm5g/HpRPNDjEwcnFINjE7ZE1o3t2dOUNXPOb6R+cTv 7Hq1nf47GcqtA/2FJY/x9zu1Ztsl/9999sL1Bz6J2a15K7Zna0+RObg2i+tWzlztRfENHmkc 9UKz9gbv45kyLTWQ12ba0Zk3jzxevkLRS3FZvceyrc8WuHy8KbPz9tPbRexSubPn7RK7MJHx 4ZZ8luZ5+4vXPlZiKc5INNRiLipOBAA5kuIp+QEAAA== MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:63.163.107.21; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(39410400002)(39450400003)(39840400002)(39850400002)(39860400002)(2980300002)(438002)(189002)(199003)(7416002)(2950100002)(77096006)(53936002)(6916009)(50466002)(8936002)(69596002)(356003)(33646002)(36756003)(1076002)(106466001)(626004)(48376002)(5003940100001)(50226002)(189998001)(54906002)(47776003)(110136003)(38730400001)(76176999)(86362001)(5660300001)(8676002)(575784001)(97736004)(92566002)(2906002)(81156014)(6666003)(81166006)(305945005)(2270400002)(50986999)(68736007)(4326007); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR02MB1289; H:milsmgep15.sandisk.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD045; 1:lkr+igfmQVjXDqO/KV2GFqHDPBA8HkbWBRzYairrAr+lpoimPaSDP6e5SvmtqxkVhi57KeGc65wJiytluuhZ4iemfGDaROIDCGd+OS5dHuZopWcALr22vhwAnLa5ROC0dTbl3/tnqYkexiAEogTGi+ABAw1HdjXkPtxfdLRpxibxTAxP1P1OOsdBl3KRPNkup2KUEPSvqMLrSiDA0n8+Q3LTOwXB43tvhJ9Ve5w5vyGa6XFzsgiuBKCWnufLr0dd6Sdu3Upi3yHdxG6T9PAje1J/lubZ1f8uIStXrVEXqd/f/ERbgT3N/PKsafmhq44vaava1b+A3PImnhY4DTxJ6NOwmtGvZsxxnpBTZd6KcB50GzhRhkZNPhoDdW7Pbh2J0XrrvoaK98VaRye9JRSxJlpsmL+P6iOYJGqaF4vLyEZ1sqQnvu8XWoYPSrlnMCwo9Bq/m8+nxdPaTf5yFtweDw== X-MS-Office365-Filtering-Correlation-Id: d2f32f14-e013-49c0-1e19-08d44177f5ca X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002); SRVR:DM2PR02MB1289; X-Microsoft-Exchange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LFcavx X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(9452136761055)(146099531331640)(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(13016025)(8121501046)(5005006)(13018025)(10201501046)(3002001)(6055026)(6041248)(20161123562025)(20161123558021)(20161123555025)(20161123560025)(20161123564025)(6072148); SRVR:DM2PR02MB1289; BCL:0; PCL:0; RULEID:; SRVR:DM2PR02MB1289; X-Microsoft-Exchange-Diagnostics: 1; DM2PR02MB1289; 4:1GFg+Y5oM4tV8H6a8fiXxQNcFh9eUqmYMsPy5u5AH6o6oFl4Y/nbxW00oBgKm86rFvXqVtraAH/OnIXYVEyHdrylQkRwZqfb2aJxel/VGuKcJHFOc2KEmFf8ltpHlfYOVI3DfPqI53iw5wPC4YOo7bZxCTSHqivQDZHU0H8/K7KH1gdEToHwPyKf1MPETebPydVfCMPr6TI9FMMVYQOdWrBXXNbuTNYFUehvvKEpBEj8H51Rw2cCzGdFJzV5uj2AAQ0Tp1C5IiT3HqNXEn+NbGQeDzxP3Jwd4q7C4A98CqObwP/16A9mn7M4YBg9+2ULLdgJKTrg+x/juyW7tWoM0GtSdB0AfJqT/T1v0fJIhz+XXdbf1i2Uqt2KyaLem8di/OzwTWm2geXgNve7yfsaix63qkinJ0aHVEdwWBdgGSLWQu+lw1Sdo/sW9niYzPEqEGYc/XGSeJ5kKqp91AWFhh76trW8m2RgdQoipxRGYPVYqpqOyO1MUzxJjGuLTOcaFrtl9yjLB0BE0GfFSHG1AQmCY4SMLNwLt+76Vv9YIV57sgeKqh46wyrM0qU+9aWg1qM5A1VG6YzF0w5zPRjTsKpPbHn9XxmhpnAkvsha0mNGd6866c9Bhm/5ETWu2osNQdBe1z7TjwP+MnjyDhDwTQqVcS/yj8Djgw5CYkvR4lUySLLQ1AomGwX8YH56o0NrBTDx2/ySfewHKEh+bTx8Oa3liukyPNe1j+Z+FZqWMFVE0INokRazh7S05eGkVx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ClzdQ/lcPGlS5We5PtQgaY6Fj5kz26BIW4U4541/kI9ZFeTejPq55/IsaKka1qbxcvYFQ/zjJt9L+vCHpRVIuegRKwWDvr6UW1MrjIfIwSFNk+py2YblGg==; 24:m3PIYkxAPbUYEVtBUXpbQdvzVv3+rRYpxZVeY7BVEfcctZMBfGinI0VQvwdJdEiI46S5VuiTRiH4y2wErHMXYHWLqvopY9ebqs2eDeDd4Go= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM2PR02MB1289; 7:3v6iPXHNiqvkgmUZ8MjsnBZFWzZAIxe7ym3vchBUXShAczCThP1AUpctOvZm3G+OzPpjjnD4/xPjuQasSMKiIy/C1E22ZpdvsMU7vF1aaZ96nNguAZyZQSdoZc+uOaaYH5OfjwNPfrcVpLqhLznNHGWeA21Xo/1T6IXA+MOzrrwxn0RjXl+KL7Ppe/gxzOn6yAcm+sybIAhaWVH3/fGItk6jNORD0DaQGHfpCkqqIsJovOyhRHkUIkm0i39VpgeLlQvwPpY0n6dvB68Jq34W8hSjOS+vdggKeHXoiNXWtOFTzoxu5UvUaHRqNOh7CR62C+hvjCcDFS+JpYkoxQnvT0ho2sIvUscZwyzIbHp4kOy/oxfN6tJi1TecbCHkMNPwFGBLHtZNRwdVD58yrVO75xbYFHpdmMWRurZqJ5gpOk9lSW94O5Rs0DPDCvp0SGDqFIjF5x9Gp4qAM6q1XFqmZA== X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jan 2017 21:04:44.5568 (UTC) X-MS-Exchange-CrossTenant-Id: fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d; Ip=[63.163.107.21]; Helo=[milsmgep15.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR02MB1289 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Introduce a new architecture-specific get_arch_dma_ops() function that takes a struct bus_type * argument. Add get_dma_ops() in . Signed-off-by: Bart Van Assche Cc: Benjamin Herrenschmidt Cc: Boris Ostrovsky Cc: David Woodhouse Cc: Juergen Gross Cc: H. Peter Anvin Cc: Ingo Molnar Cc: linux-arch@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: Russell King Cc: x86@kernel.org --- arch/alpha/include/asm/dma-mapping.h | 2 +- arch/arc/include/asm/dma-mapping.h | 2 +- arch/arm/include/asm/dma-mapping.h | 4 ++-- arch/arm64/include/asm/dma-mapping.h | 4 ++-- arch/avr32/include/asm/dma-mapping.h | 2 +- arch/blackfin/include/asm/dma-mapping.h | 2 +- arch/c6x/include/asm/dma-mapping.h | 2 +- arch/cris/include/asm/dma-mapping.h | 4 ++-- arch/frv/include/asm/dma-mapping.h | 2 +- arch/h8300/include/asm/dma-mapping.h | 2 +- arch/hexagon/include/asm/dma-mapping.h | 5 +---- arch/ia64/include/asm/dma-mapping.h | 5 ++++- arch/m32r/include/asm/dma-mapping.h | 4 +--- arch/m68k/include/asm/dma-mapping.h | 2 +- arch/metag/include/asm/dma-mapping.h | 2 +- arch/microblaze/include/asm/dma-mapping.h | 2 +- arch/mips/include/asm/dma-mapping.h | 7 ++----- arch/mn10300/include/asm/dma-mapping.h | 2 +- arch/nios2/include/asm/dma-mapping.h | 2 +- arch/openrisc/include/asm/dma-mapping.h | 2 +- arch/parisc/include/asm/dma-mapping.h | 2 +- arch/powerpc/include/asm/dma-mapping.h | 7 ++----- arch/powerpc/include/asm/ps3.h | 2 +- arch/s390/include/asm/dma-mapping.h | 4 +--- arch/sh/include/asm/dma-mapping.h | 2 +- arch/sparc/include/asm/dma-mapping.h | 4 ++-- arch/tile/include/asm/dma-mapping.h | 7 ++----- arch/unicore32/include/asm/dma-mapping.h | 2 +- arch/x86/include/asm/dma-mapping.h | 9 +-------- arch/xtensa/include/asm/dma-mapping.h | 7 ++----- include/linux/dma-mapping.h | 7 +++++++ 31 files changed, 48 insertions(+), 64 deletions(-) diff --git a/arch/alpha/include/asm/dma-mapping.h b/arch/alpha/include/asm/dma-mapping.h index d3480562411d..5d53666935e6 100644 --- a/arch/alpha/include/asm/dma-mapping.h +++ b/arch/alpha/include/asm/dma-mapping.h @@ -3,7 +3,7 @@ extern const struct dma_map_ops *dma_ops; -static inline const struct dma_map_ops *get_dma_ops(struct device *dev) +static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) { return dma_ops; } diff --git a/arch/arc/include/asm/dma-mapping.h b/arch/arc/include/asm/dma-mapping.h index fdff3aa60052..94285031c4fb 100644 --- a/arch/arc/include/asm/dma-mapping.h +++ b/arch/arc/include/asm/dma-mapping.h @@ -20,7 +20,7 @@ extern const struct dma_map_ops arc_dma_ops; -static inline const struct dma_map_ops *get_dma_ops(struct device *dev) +static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) { return &arc_dma_ops; } diff --git a/arch/arm/include/asm/dma-mapping.h b/arch/arm/include/asm/dma-mapping.h index c7432d647e53..716656925975 100644 --- a/arch/arm/include/asm/dma-mapping.h +++ b/arch/arm/include/asm/dma-mapping.h @@ -23,12 +23,12 @@ static inline const struct dma_map_ops *__generic_dma_ops(struct device *dev) return &arm_dma_ops; } -static inline const struct dma_map_ops *get_dma_ops(struct device *dev) +static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) { if (xen_initial_domain()) return xen_dma_ops; else - return __generic_dma_ops(dev); + return __generic_dma_ops(NULL); } #define HAVE_ARCH_DMA_SUPPORTED 1 diff --git a/arch/arm64/include/asm/dma-mapping.h b/arch/arm64/include/asm/dma-mapping.h index 58ae36cc3b60..505756cdc67a 100644 --- a/arch/arm64/include/asm/dma-mapping.h +++ b/arch/arm64/include/asm/dma-mapping.h @@ -39,12 +39,12 @@ static inline const struct dma_map_ops *__generic_dma_ops(struct device *dev) return &dummy_dma_ops; } -static inline const struct dma_map_ops *get_dma_ops(struct device *dev) +static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) { if (xen_initial_domain()) return xen_dma_ops; else - return __generic_dma_ops(dev); + return __generic_dma_ops(NULL); } void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size, diff --git a/arch/avr32/include/asm/dma-mapping.h b/arch/avr32/include/asm/dma-mapping.h index b2b43c0e0774..7388451f9905 100644 --- a/arch/avr32/include/asm/dma-mapping.h +++ b/arch/avr32/include/asm/dma-mapping.h @@ -6,7 +6,7 @@ extern void dma_cache_sync(struct device *dev, void *vaddr, size_t size, extern const struct dma_map_ops avr32_dma_ops; -static inline const struct dma_map_ops *get_dma_ops(struct device *dev) +static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) { return &avr32_dma_ops; } diff --git a/arch/blackfin/include/asm/dma-mapping.h b/arch/blackfin/include/asm/dma-mapping.h index 320fb50fbd41..04254ac36bed 100644 --- a/arch/blackfin/include/asm/dma-mapping.h +++ b/arch/blackfin/include/asm/dma-mapping.h @@ -38,7 +38,7 @@ _dma_sync(dma_addr_t addr, size_t size, enum dma_data_direction dir) extern const struct dma_map_ops bfin_dma_ops; -static inline const struct dma_map_ops *get_dma_ops(struct device *dev) +static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) { return &bfin_dma_ops; } diff --git a/arch/c6x/include/asm/dma-mapping.h b/arch/c6x/include/asm/dma-mapping.h index 88258b9ebc8e..aca9f755e4f8 100644 --- a/arch/c6x/include/asm/dma-mapping.h +++ b/arch/c6x/include/asm/dma-mapping.h @@ -19,7 +19,7 @@ extern const struct dma_map_ops c6x_dma_ops; -static inline const struct dma_map_ops *get_dma_ops(struct device *dev) +static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) { return &c6x_dma_ops; } diff --git a/arch/cris/include/asm/dma-mapping.h b/arch/cris/include/asm/dma-mapping.h index aae4fbc0a656..256169de3743 100644 --- a/arch/cris/include/asm/dma-mapping.h +++ b/arch/cris/include/asm/dma-mapping.h @@ -4,12 +4,12 @@ #ifdef CONFIG_PCI extern const struct dma_map_ops v32_dma_ops; -static inline const struct dma_map_ops *get_dma_ops(struct device *dev) +static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) { return &v32_dma_ops; } #else -static inline const struct dma_map_ops *get_dma_ops(struct device *dev) +static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) { BUG(); return NULL; diff --git a/arch/frv/include/asm/dma-mapping.h b/arch/frv/include/asm/dma-mapping.h index 150cc00544a8..354900917585 100644 --- a/arch/frv/include/asm/dma-mapping.h +++ b/arch/frv/include/asm/dma-mapping.h @@ -9,7 +9,7 @@ extern unsigned long __nongprelbss dma_coherent_mem_end; extern const struct dma_map_ops frv_dma_ops; -static inline const struct dma_map_ops *get_dma_ops(struct device *dev) +static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) { return &frv_dma_ops; } diff --git a/arch/h8300/include/asm/dma-mapping.h b/arch/h8300/include/asm/dma-mapping.h index f804bca4c13f..847c7562e046 100644 --- a/arch/h8300/include/asm/dma-mapping.h +++ b/arch/h8300/include/asm/dma-mapping.h @@ -3,7 +3,7 @@ extern const struct dma_map_ops h8300_dma_map_ops; -static inline const struct dma_map_ops *get_dma_ops(struct device *dev) +static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) { return &h8300_dma_map_ops; } diff --git a/arch/hexagon/include/asm/dma-mapping.h b/arch/hexagon/include/asm/dma-mapping.h index b812e917cd95..d3a87bd9b686 100644 --- a/arch/hexagon/include/asm/dma-mapping.h +++ b/arch/hexagon/include/asm/dma-mapping.h @@ -34,11 +34,8 @@ extern int bad_dma_address; extern const struct dma_map_ops *dma_ops; -static inline const struct dma_map_ops *get_dma_ops(struct device *dev) +static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) { - if (unlikely(dev == NULL)) - return NULL; - return dma_ops; } diff --git a/arch/ia64/include/asm/dma-mapping.h b/arch/ia64/include/asm/dma-mapping.h index 05e467d56d86..73ec3c6f4cfe 100644 --- a/arch/ia64/include/asm/dma-mapping.h +++ b/arch/ia64/include/asm/dma-mapping.h @@ -23,7 +23,10 @@ extern void machvec_dma_sync_single(struct device *, dma_addr_t, size_t, extern void machvec_dma_sync_sg(struct device *, struct scatterlist *, int, enum dma_data_direction); -#define get_dma_ops(dev) platform_dma_get_ops(dev) +static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) +{ + return platform_dma_get_ops(NULL); +} static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size) { diff --git a/arch/m32r/include/asm/dma-mapping.h b/arch/m32r/include/asm/dma-mapping.h index 27b1597ac563..c01d9f52d228 100644 --- a/arch/m32r/include/asm/dma-mapping.h +++ b/arch/m32r/include/asm/dma-mapping.h @@ -10,10 +10,8 @@ #define DMA_ERROR_CODE (~(dma_addr_t)0x0) -static inline const struct dma_map_ops *get_dma_ops(struct device *dev) +static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) { - if (dev && dev->dma_ops) - return dev->dma_ops; return &dma_noop_ops; } diff --git a/arch/m68k/include/asm/dma-mapping.h b/arch/m68k/include/asm/dma-mapping.h index 863509939d5a..9210e470771b 100644 --- a/arch/m68k/include/asm/dma-mapping.h +++ b/arch/m68k/include/asm/dma-mapping.h @@ -3,7 +3,7 @@ extern const struct dma_map_ops m68k_dma_ops; -static inline const struct dma_map_ops *get_dma_ops(struct device *dev) +static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) { return &m68k_dma_ops; } diff --git a/arch/metag/include/asm/dma-mapping.h b/arch/metag/include/asm/dma-mapping.h index c156a7ac732f..fad3dc3cb210 100644 --- a/arch/metag/include/asm/dma-mapping.h +++ b/arch/metag/include/asm/dma-mapping.h @@ -3,7 +3,7 @@ extern const struct dma_map_ops metag_dma_ops; -static inline const struct dma_map_ops *get_dma_ops(struct device *dev) +static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) { return &metag_dma_ops; } diff --git a/arch/microblaze/include/asm/dma-mapping.h b/arch/microblaze/include/asm/dma-mapping.h index c7faf2fb51d6..3fad5e722a66 100644 --- a/arch/microblaze/include/asm/dma-mapping.h +++ b/arch/microblaze/include/asm/dma-mapping.h @@ -38,7 +38,7 @@ */ extern const struct dma_map_ops dma_direct_ops; -static inline const struct dma_map_ops *get_dma_ops(struct device *dev) +static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) { return &dma_direct_ops; } diff --git a/arch/mips/include/asm/dma-mapping.h b/arch/mips/include/asm/dma-mapping.h index dad3b09fe993..aba71385f9d1 100644 --- a/arch/mips/include/asm/dma-mapping.h +++ b/arch/mips/include/asm/dma-mapping.h @@ -11,12 +11,9 @@ extern const struct dma_map_ops *mips_dma_map_ops; -static inline const struct dma_map_ops *get_dma_ops(struct device *dev) +static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) { - if (dev && dev->dma_ops) - return dev->dma_ops; - else - return mips_dma_map_ops; + return mips_dma_map_ops; } static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size) diff --git a/arch/mn10300/include/asm/dma-mapping.h b/arch/mn10300/include/asm/dma-mapping.h index 564e3927e005..737ef574b3ea 100644 --- a/arch/mn10300/include/asm/dma-mapping.h +++ b/arch/mn10300/include/asm/dma-mapping.h @@ -16,7 +16,7 @@ extern const struct dma_map_ops mn10300_dma_ops; -static inline const struct dma_map_ops *get_dma_ops(struct device *dev) +static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) { return &mn10300_dma_ops; } diff --git a/arch/nios2/include/asm/dma-mapping.h b/arch/nios2/include/asm/dma-mapping.h index aa00d839a64b..7b3c6f280293 100644 --- a/arch/nios2/include/asm/dma-mapping.h +++ b/arch/nios2/include/asm/dma-mapping.h @@ -12,7 +12,7 @@ extern const struct dma_map_ops nios2_dma_ops; -static inline const struct dma_map_ops *get_dma_ops(struct device *dev) +static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) { return &nios2_dma_ops; } diff --git a/arch/openrisc/include/asm/dma-mapping.h b/arch/openrisc/include/asm/dma-mapping.h index 88acbedb4947..0c0075f17145 100644 --- a/arch/openrisc/include/asm/dma-mapping.h +++ b/arch/openrisc/include/asm/dma-mapping.h @@ -30,7 +30,7 @@ extern const struct dma_map_ops or1k_dma_map_ops; -static inline const struct dma_map_ops *get_dma_ops(struct device *dev) +static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) { return &or1k_dma_map_ops; } diff --git a/arch/parisc/include/asm/dma-mapping.h b/arch/parisc/include/asm/dma-mapping.h index 1749073e44fc..5404c6a726b2 100644 --- a/arch/parisc/include/asm/dma-mapping.h +++ b/arch/parisc/include/asm/dma-mapping.h @@ -27,7 +27,7 @@ extern const struct dma_map_ops pcx_dma_ops; extern const struct dma_map_ops *hppa_dma_ops; -static inline const struct dma_map_ops *get_dma_ops(struct device *dev) +static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) { return hppa_dma_ops; } diff --git a/arch/powerpc/include/asm/dma-mapping.h b/arch/powerpc/include/asm/dma-mapping.h index 8275603ba4d5..181a095468e4 100644 --- a/arch/powerpc/include/asm/dma-mapping.h +++ b/arch/powerpc/include/asm/dma-mapping.h @@ -78,17 +78,14 @@ extern struct dma_map_ops dma_iommu_ops; #endif extern const struct dma_map_ops dma_direct_ops; -static inline const struct dma_map_ops *get_dma_ops(struct device *dev) +static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) { /* We don't handle the NULL dev case for ISA for now. We could * do it via an out of line call but it is not needed for now. The * only ISA DMA device we support is the floppy and we have a hack * in the floppy driver directly to get a device for us. */ - if (unlikely(dev == NULL)) - return NULL; - - return dev->dma_ops; + return NULL; } /* diff --git a/arch/powerpc/include/asm/ps3.h b/arch/powerpc/include/asm/ps3.h index a19f831a4cc9..17ee719e799f 100644 --- a/arch/powerpc/include/asm/ps3.h +++ b/arch/powerpc/include/asm/ps3.h @@ -435,7 +435,7 @@ static inline void *ps3_system_bus_get_drvdata( return dev_get_drvdata(&dev->core); } -/* These two need global scope for get_dma_ops(). */ +/* These two need global scope for get_arch_dma_ops(). */ extern struct bus_type ps3_system_bus_type; diff --git a/arch/s390/include/asm/dma-mapping.h b/arch/s390/include/asm/dma-mapping.h index a872027d0c1b..3108b8dbe266 100644 --- a/arch/s390/include/asm/dma-mapping.h +++ b/arch/s390/include/asm/dma-mapping.h @@ -12,10 +12,8 @@ extern const struct dma_map_ops s390_pci_dma_ops; -static inline const struct dma_map_ops *get_dma_ops(struct device *dev) +static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) { - if (dev && dev->dma_ops) - return dev->dma_ops; return &dma_noop_ops; } diff --git a/arch/sh/include/asm/dma-mapping.h b/arch/sh/include/asm/dma-mapping.h index a7382c34c241..d99008af5f73 100644 --- a/arch/sh/include/asm/dma-mapping.h +++ b/arch/sh/include/asm/dma-mapping.h @@ -4,7 +4,7 @@ extern const struct dma_map_ops *dma_ops; extern void no_iommu_init(void); -static inline const struct dma_map_ops *get_dma_ops(struct device *dev) +static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) { return dma_ops; } diff --git a/arch/sparc/include/asm/dma-mapping.h b/arch/sparc/include/asm/dma-mapping.h index 3d2babc0c4c6..69cc627779f2 100644 --- a/arch/sparc/include/asm/dma-mapping.h +++ b/arch/sparc/include/asm/dma-mapping.h @@ -24,14 +24,14 @@ extern const struct dma_map_ops pci32_dma_ops; extern struct bus_type pci_bus_type; -static inline const struct dma_map_ops *get_dma_ops(struct device *dev) +static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) { #ifdef CONFIG_SPARC_LEON if (sparc_cpu_model == sparc_leon) return leon_dma_ops; #endif #if defined(CONFIG_SPARC32) && defined(CONFIG_PCI) - if (dev->bus == &pci_bus_type) + if (bus == &pci_bus_type) return &pci32_dma_ops; #endif return dma_ops; diff --git a/arch/tile/include/asm/dma-mapping.h b/arch/tile/include/asm/dma-mapping.h index 2562995a6ac9..bbc71a29b2c6 100644 --- a/arch/tile/include/asm/dma-mapping.h +++ b/arch/tile/include/asm/dma-mapping.h @@ -29,12 +29,9 @@ extern const struct dma_map_ops *gx_pci_dma_map_ops; extern const struct dma_map_ops *gx_legacy_pci_dma_map_ops; extern const struct dma_map_ops *gx_hybrid_pci_dma_map_ops; -static inline const struct dma_map_ops *get_dma_ops(struct device *dev) +static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) { - if (dev && dev->dma_ops) - return dev->dma_ops; - else - return tile_dma_map_ops; + return tile_dma_map_ops; } static inline dma_addr_t get_dma_offset(struct device *dev) diff --git a/arch/unicore32/include/asm/dma-mapping.h b/arch/unicore32/include/asm/dma-mapping.h index 14d7729c7b73..518ba5848dd6 100644 --- a/arch/unicore32/include/asm/dma-mapping.h +++ b/arch/unicore32/include/asm/dma-mapping.h @@ -23,7 +23,7 @@ extern const struct dma_map_ops swiotlb_dma_map_ops; -static inline const struct dma_map_ops *get_dma_ops(struct device *dev) +static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) { return &swiotlb_dma_map_ops; } diff --git a/arch/x86/include/asm/dma-mapping.h b/arch/x86/include/asm/dma-mapping.h index 94b5b96966cb..08a0838b83fb 100644 --- a/arch/x86/include/asm/dma-mapping.h +++ b/arch/x86/include/asm/dma-mapping.h @@ -27,16 +27,9 @@ extern int panic_on_overflow; extern const struct dma_map_ops *dma_ops; -static inline const struct dma_map_ops *get_dma_ops(struct device *dev) +static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) { -#ifndef CONFIG_X86_DEV_DMA_OPS return dma_ops; -#else - if (unlikely(!dev) || !dev->dma_ops) - return dma_ops; - else - return dev->dma_ops; -#endif } bool arch_dma_alloc_attrs(struct device **dev, gfp_t *gfp); diff --git a/arch/xtensa/include/asm/dma-mapping.h b/arch/xtensa/include/asm/dma-mapping.h index 9eecfc3c5dc4..c6140fa8c0be 100644 --- a/arch/xtensa/include/asm/dma-mapping.h +++ b/arch/xtensa/include/asm/dma-mapping.h @@ -20,12 +20,9 @@ extern const struct dma_map_ops xtensa_dma_map_ops; -static inline const struct dma_map_ops *get_dma_ops(struct device *dev) +static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) { - if (dev && dev->dma_ops) - return dev->dma_ops; - else - return &xtensa_dma_map_ops; + return &xtensa_dma_map_ops; } void dma_cache_sync(struct device *dev, void *vaddr, size_t size, diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index e97f23e8b2d9..ab8710888ddf 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h @@ -164,6 +164,13 @@ int dma_mmap_from_coherent(struct device *dev, struct vm_area_struct *vma, #ifdef CONFIG_HAS_DMA #include +static inline const struct dma_map_ops *get_dma_ops(struct device *dev) +{ + if (dev && dev->dma_ops) + return dev->dma_ops; + return get_arch_dma_ops(dev ? dev->bus : NULL); +} + static inline void set_dma_ops(struct device *dev, const struct dma_map_ops *dma_ops) {