Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2990231ybt; Mon, 29 Jun 2020 12:15:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJymmRURplIt1QMb/NY5lFUlsmQZ/sJOp6gPWy0KL06PaYoZSy4KGvIzJL0TFbLs7NE/9r14 X-Received: by 2002:a17:906:add3:: with SMTP id lb19mr8019261ejb.304.1593458146506; Mon, 29 Jun 2020 12:15:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593458146; cv=none; d=google.com; s=arc-20160816; b=OYehv5NbznF7Mm0E07zg7HcX2+akTtqssdvTBDRivN6msQecnITdFRQYRMoYXBl2S3 5iOAhtMURLU/Xu67oDwkvXNezejz3ge8FWiB2bPccKm9y6U8v3nIMZ4SQfzoEKYupcyd //2ctqYjtoQGIVtYsxrRFqOH+VKwcevgZgdH+r/IwqURFZk4s/NlxPHLtx9Dx0maXGc/ D6oGx6m0+bcJNThTuwJhy4J475aLOb6s87Oec/kYbkFFUR70mMQM5BD5hnwcv1JiGrYV BIDagsTJlRVeKt+ZsY95l2rxdkYYybG03D4mbyyfrTf2cA2u1iwHv7LTDmEaJNzQO+5N N2dA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=zLDuyqfAKxDyb96TQYENXoMdn0JNr/8NrkSGPE3USPI=; b=RNwAcStcQMcGKUckOJSDgCsPcDjCfrsC74ZlxnMFzm4e7iZ6kCfb9/HiGXuhKBHu59 InxfjzHdQKKTmYClotGCOfUGBiVCp7dFL+lyRBHivj2mW4N64wwSpLTc4xuVMA2lXHOP ENoj9tcHvOaTNnDr+p91ShXWUUihaE0fHUVUMjDUgzJ4r6h5eafs/mzgEItPReMqPsJg 0JuzEW2e74BOrmLE22lhriH1ahlyw7yG93O0yaC054Mj5XF9LKgZvuO+DHrse961xeu+ M76E67ujZ69S9wCCbHcs6JB2DQDSItUvJxAzM3brx3tlHtGFGM4tZ9IMzwJCmO+In2HM 5z/g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l2si324359ejd.191.2020.06.29.12.15.22; Mon, 29 Jun 2020 12:15:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729378AbgF2TPR (ORCPT + 99 others); Mon, 29 Jun 2020 15:15:17 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:47087 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729413AbgF2TPO (ORCPT ); Mon, 29 Jun 2020 15:15:14 -0400 Received: from mail-qt1-f176.google.com ([209.85.160.176]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.145]) with ESMTPSA (Nemesis) id 1MqJuP-1j3RDk2HQp-00nNSp; Mon, 29 Jun 2020 17:08:27 +0200 Received: by mail-qt1-f176.google.com with SMTP id e12so13043116qtr.9; Mon, 29 Jun 2020 08:08:27 -0700 (PDT) X-Gm-Message-State: AOAM532sAB5W/VPKTkLUR4AyavMWVsGao0RwMo+gteq4fYHPXPyfoutQ 665YQr8uXaKdWTyCPAVtHS4hP8llk1XsRXqz39Q= 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 Cc: Russell King - ARM Linux , Shawn Guo , Sascha Hauer , Sascha Hauer , Fabio Estevam , Michael Turquette , Stephen Boyd , "oleksandr.suvorov@toradex.com" , Stefan Agner , Peng Fan , Abel Vesa , Aisheng Dong , Andy Duan , Daniel Baluta , YueHaibing , Stephen Rothwell , Al Viro , Linux ARM , "linux-kernel@vger.kernel.org" , linux-clk , dl-linux-imx Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:wKgMKK0eUebDi30MowMdmQn02QMB0d3ji+fQ99MNTtuMvfZKqJj IGFEYRMy+xVLrwh3WOwQeEr1LKzXFgPeg7rFA2RO8pqbmryQpxnJ1JwGN98DYMQitIbtFDA H+w435NjfnbrJwry2unOkb6mjk2P2rkVAmcRlgqA6l7pvXAx06xwWhQkdz/AyWdzP3+6Koq S8My9fm5+y7e7qqsvFDUA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:iiPSoLVcnOk=:qoxOSacGPmBIHf5353Yapl gndagjhThquKoK9CuFn0RXLqH1ytqqCBv2O7rzoaIV4nHK+9dVhqcMuYUBd5M+6sbNeEXwxi2 u3MyWGgvXqMqBHHxaSgH6SD2rvap8DjqlJTxXhIbq1YT+Ry8bKv07ZBKZ2kp/9anClzRqvk1d N9qZVN0dmdKg2WBIAxWYpBfthLV3wjGrXC4lCw1nbQn5yiyzDx4IvPuhVPxmo7Lvd6Cf+LdJa rvTs1te+x8zWObIW7WKrISxPxZgGZGtiphjt4nEDZYxoke9kbYjf2o3VotfQjIEs38yslOZ1D z4E9HM61JkWcRcH8LXgM2buDQk53yMrsqgyo909zMIAH9Djr0jYRBTqklewJwEXuQCIe91rgN i1ZRa/bEs3gf/w/htk2eh3OUyGo6xZfBR536vqcK5E1qAeJXBBKrAN6b2VH5J1ns+YMe026IY ycrfc5x60mZEUIgPOW+7vjasWQY3M32RN2YwwGmUw+XDUqy6SaIxYHKWK91WcpjG6BRbiunwa GfixAd7RegewVNZNqQlNFhT285rp0vZbbrySolHEQr2UGYXUGICBdGOUIO1Pm9eYkGtZ+biio BJhNlg7dfFIy92SnPGC0GUXXtMjs4efj8pv/TTQ0LQJerHgveYkfI0WBp+zgkQ25kZVHiFVYB GMrzRDpVBDw1Naz8wlX/A51F7Ge3JdIvU2wBpXKxcluj5YDBWaI6RKt8mgS/8i6Noet18uytu ltKKZHsUjU3S4YdTRGOnP4s+0Fb+36/Hlpt8Vt4NvnqXZBHJ/xkJpeC7Xhe5immPAvD+texNM V/oWkPIdsjYEpRo1TLlpA2biPGaMar6SACaHB8Ut45zlKgje3g= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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