From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754207AbdJLRGz (ORCPT ); Thu, 12 Oct 2017 13:06:55 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:49790 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752982AbdJLRGw (ORCPT ); Thu, 12 Oct 2017 13:06:52 -0400 Subject: Re: [PATCH 4/9] arm64: dma-mapping: export symbol arch_setup_dma_ops To: Jim Quinlan , linux-kernel@vger.kernel.org Cc: Mark Rutland , linux-mips@linux-mips.org, Florian Fainelli , devicetree@vger.kernel.org, linux-pci@vger.kernel.org, Kevin Cernekee , Will Deacon , Ralf Baechle , Rob Herring , bcm-kernel-feedback-list@broadcom.com, Gregory Fong , Catalin Marinas , Bjorn Helgaas , Brian Norris , linux-arm-kernel@lists.infradead.org References: <1507761269-7017-1-git-send-email-jim2101024@gmail.com> <1507761269-7017-5-git-send-email-jim2101024@gmail.com> From: Robin Murphy Message-ID: Date: Thu, 12 Oct 2017 18:06:48 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <1507761269-7017-5-git-send-email-jim2101024@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/10/17 23:34, Jim Quinlan wrote: > The BrcmSTB driver needs to get ahold of a pointer to swiotlb_dma_ops. > However, that variable is defined as static. Instead, we use > arch_setup_dma_ops() to get the pointer to swiotlb_dma_ops. Since > we also want our driver to be a separate module, we need to > export this function. NAK. Retrieve the platform-assigned ops from the device via get_dma_ops() and stash them in your drvdata or wherever before you replace them. Don't go poking around arch code internals directly from a driver. Robin. > Signed-off-by: Jim Quinlan > --- > arch/arm64/mm/dma-mapping.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c > index 614af88..dae572f 100644 > --- a/arch/arm64/mm/dma-mapping.c > +++ b/arch/arm64/mm/dma-mapping.c > @@ -936,3 +936,4 @@ void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size, > } > #endif > } > +EXPORT_SYMBOL(arch_setup_dma_ops); >