From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A02CC433E0 for ; Mon, 29 Jun 2020 15:10:36 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1AB5623E54 for ; Mon, 29 Jun 2020 15:10:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="p3Q2iddb" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1AB5623E54 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arndb.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=c9t9IC41vJKfeXs2FjQjmRD2OptTx5ofSfnpLU7QIxs=; b=p3Q2iddbmii1qTCGfA4ydomQw 45uoTRUq1zseHrAjG1VBqoB7rfbVbspHIYw838POk5d7BX4SZgoAA6iHyN70Y+lf/gpV6R4PKzqG8 ZTjtFdH6lRZeHkYfDANilJs1MKawgaIMo7FeNTVYR3hyi5UJ1gOzaf4vakTQi7Taa5gDO0Li5xhGK qf78+giwfTwJRljnIhkCI4Ewpuv90ZG0QGXucC8K/+yYwVsfBAh9TcNrTuW3rsmdj5lgXY7CdQD+H 1dCF3kiHZHSBvBufx4SMEd2YDqCtjlQ0f+XUphME+J5ee+KOTzCFgCQhBJal8oVTxFi6hxEf2x6hM zr6zB8uJw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jpvOf-0002A4-Tm; Mon, 29 Jun 2020 15:08:37 +0000 Received: from mout.kundenserver.de ([212.227.126.187]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jpvOc-00028V-D5 for linux-arm-kernel@lists.infradead.org; Mon, 29 Jun 2020 15:08:35 +0000 Received: from mail-qt1-f181.google.com ([209.85.160.181]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.129]) with ESMTPSA (Nemesis) id 1My6xz-1itaNc3lgF-00zT1x for ; Mon, 29 Jun 2020 17:08:32 +0200 Received: by mail-qt1-f181.google.com with SMTP id d27so13075585qtg.4 for ; Mon, 29 Jun 2020 08:08:27 -0700 (PDT) X-Gm-Message-State: AOAM533W0Vq4FgAfa2DdMvRWj5iFOSDT2geUobQcUWFmbyZQ/TRKAs+0 YKJAJV/fxYT+HFqVwDvhDKafrIDdUa98EoKjueY= X-Google-Smtp-Source: ABdhPJyQuqwhfm5xEtb+Xwa0xEiKtz926rq5DKPRj0B3De279sqAWoVcj6OMbI8F3yDTfe5Hmp0EzLxdKp04XA+X8n0= X-Received: by 2002:ac8:7587:: with SMTP id s7mr16233441qtq.304.1593443306252; Mon, 29 Jun 2020 08:08:26 -0700 (PDT) MIME-Version: 1.0 References: <1593410042-10598-1-git-send-email-Anson.Huang@nxp.com> <1593410042-10598-5-git-send-email-Anson.Huang@nxp.com> In-Reply-To: From: Arnd Bergmann Date: Mon, 29 Jun 2020 17:08:10 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH V3 04/10] clk: imx: Support building SCU clock driver as module To: Anson Huang X-Provags-ID: V03:K1:xYAJZFbtjCIatQTGRHwB9E1kFm6227fpVIFr0op3Ec0arlMpVCF kqgfacaOuSzgkV9F0hn3LPD8pWhfwVTG9IhnBcSHrmOo/WR6QiPceUuvT/QnGQR2XaUKv/5 76+mqaPE8o6SiNVA5ttIGf6AI9IkVR2pN7S5VMo/0fCimWePVPKQ35oUQYi8lBRy18vp1dk 2jioF0wUt+O4tfhAIGXpA== X-UI-Out-Filterresults: notjunk:1;V03:K0:ZBtNKKTUujM=:yo6uBm6Jx5BfXvlZecQbt9 B7CWqRTbx/IVLHdClCmSdElZ/6rtB4HQYX5WaciBo1zgmcwIWYMXPUf77XAlsUeSgu6uT0nFh ro3JWdhwVue+1ugUc7Kv9oegKpI2f5a/Zh7HPUOTUMRGCJ3ZsTMpd7tRIrCDgLTYSQiUAKITk KqfJUOdwkRCcHXSvyXloBuEAEt3HQuJ5bE0ZGgt/LclC8qIkb36BKBUDH6bp9iDw6Nkjh2oT5 i6TMoc0adGH4bbYOyjlWCHBvAqrSV27V4+9QWeY79+fv8p03PoVzzew2ckZm96Ncj8INy8VST ivd8Q9K+L7Eigxzm6eEbrF9DrDvr16Y4cU0OZMKxR5gLwYeyJTBPSARI7UvV9at7ClaJItABV pmuwgfOscMb50rpAjfOjKuB7plxjDfBhAt/q/dkt8i9Iy9zISqMuxQM6mbEaif10w1NFwEs9K yEjcOB3TwQ6WesGoKKPQFbP3h06T2gpgCxLELulVDuT69A/D/EkJuwpUYiKxU1vLRQ/GL7ma2 4mLdtxqqRkTgbygzqUiqaxd6MA/R//ynr/fHLvuaEj8ONqCuruOFxXM7M5dE9CKOYWN96z/2S 33ibdLxjed6yvFgUBN3ht23ejqL0A2lKtY3RhFHbtt9rz+BhuZRCtHQoP0PIWHCZ+gWiUApDv o8cYW2DBBXxkpopFc9unukL29VxM1nOu9CuEmwphVUAHEzjvQ/d1BZd1uemnuIWAlQlbzqB4f 4UF/xI3Gi1aJWjLMTOpOgQ/NG6+UTXX+pCZUQZDho56hFKq5F0kufuU5yv7uphGZaBHgGfNEs 1kMmnD5AVfdt3UkcGA9kWvvDpzISTmaj7H6+cHDi/uP5ptt9Ko= X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Aisheng Dong , Stephen Rothwell , Peng Fan , linux-clk , Andy Duan , Abel Vesa , Stefan Agner , Stephen Boyd , Shawn Guo , Sascha Hauer , YueHaibing , Russell King - ARM Linux , Daniel Baluta , "linux-kernel@vger.kernel.org" , "oleksandr.suvorov@toradex.com" , Al Viro , Sascha Hauer , Fabio Estevam , Michael Turquette , Linux ARM , dl-linux-imx Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Jun 29, 2020 at 4:52 PM Anson Huang wrote: > > Subject: Re: [PATCH V3 04/10] clk: imx: Support building SCU clock driver as module > > On Mon, Jun 29, 2020 at 2:53 PM Anson Huang wrote: > > > > Sorry, I misread the patch in multiple ways. First of all, you already put > > clk-scu.o and clk-lpcg-scu.o files into a combined loadable module, and I had > > only looked at clk-scu.c. > > > > What I actually meant here was to link clk-scu.o together with clk-imx8qxp.o > > (and possibly future chip-specific files) into a loadable module and drop the > > export. > > Sorry, could you please advise more details about how to do it in Makefile? > I tried below but it looks like NOT working. multiple definition of module_init() error reported. > > obj-$(CONFIG_MXC_CLK_SCU) := clk-imx.o > clk-imx-y += clk-scu.o clk-lpcg-scu.o > clk-imx-$(CONFIG_CLK_IMX8QXP) += clk-imx8qxp.o clk-imx8qxp-lpcg.o Right, you can't have multiple module_init() in a module, so what I suggested earlier won't work any more as soon as you add a second chip that uses the clk-scu driver, and then you have to use separate modules, or some hack that calls the init functions one at a time, which is probably worse. If it's only imx8qxp, you can do it like this: obj-$(CONFIG_MXC_CLK_SCU) := clk-imx-scu.o clk-imx-lpcg.o clk-imx-scu-y += clk-scu.o clk-imx8qxp.o clk-imx-lpcq-scu-y += clk-lpcg-scu.o clk-imx8qxp-lpcg.o If you already know that the scu driver is going to be used in future chips, then just stay with what you have now, using a separate module per file, exporting the symbols as needed. Arnd _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel