From patchwork Tue Nov 24 12:17:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Andrzej Siewior X-Patchwork-Id: 11928211 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=-13.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 D493DC2D0E4 for ; Tue, 24 Nov 2020 12:19:13 +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 64EF520708 for ; Tue, 24 Nov 2020 12:19:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="xl2QS3A+"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="YhN2yWhb"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="yrUzkSb8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 64EF520708 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linutronix.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:MIME-Version:Message-ID:Subject:To:From:Date: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=xWjQ/1E3VFvMckf9qG9jZHzYg7+6x4kI8LlM+zv0ppw=; b=xl2QS3A+sgJC0BTaGgCj5hmzpw Jo4qIIdvzccrSABIe2G5fa9Jr8iyngN579hEKXjyeKsHZ5QYvPlrr2Qi/Qe64t0YnmbvA47/N4Xx8 +5aIIChqpCOQj3fwg8VRVdULON5J5tbvvDDIkxyagEVIUh8xuxlDDNuMnr42gwIhSZByI4owWhrn+ Umq95glnDU2pyPSm7MUx+1TdOT7E+Dkj3CePcT/c8gl/sfpT2Z5l1XwZYNNZry1SvtpUYMst5jcDC hR4+obYAUQLZ9W1Pd8V8J5jMZMWER2pd05v+Ef9t+s7TmdlEk2m0qt8H+XVfe/lVayhvpbG2O1L2X jrscnUXQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1khXGV-0000Qk-2v; Tue, 24 Nov 2020 12:17:47 +0000 Received: from galois.linutronix.de ([193.142.43.55]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1khXGT-0000QA-0S for linux-arm-kernel@lists.infradead.org; Tue, 24 Nov 2020 12:17:45 +0000 Date: Tue, 24 Nov 2020 13:17:40 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1606220261; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type; bh=kTDmb1nq5DsvYQtwEl53F/9vZGifeG6mz+DsJxGUu+E=; b=YhN2yWhbwvzUGKovyNANDYlW+ka3jffakficckcHO+I4LLXn2KZYQkoiLZwzuZ1Gp2L8C9 l9CuA4sBLQw7a0fL/IzhRW9bid1EdCn4fn1XUg+6NJ1YgzUqmeo/jwzoijJWECggsW/yg4 B3N7YbVs5Tqk2rU47cv+J3a7lBSN8xlm+n875bszbd7FNCl77Ze3lKYL4mGgF2s8Xw3jer Q8x1hntI3qhJik8kKLNuILrQLceneYugZSCwimc8FgLDjp9AWiRhXAQbjW4EhOA6HSq2k/ eBYg6xcnmlj4pCsBY0uPc++kkmoEkZWD3L/+P5CtwTxEH3fCX3QIG6aVUmSWLQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1606220261; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type; bh=kTDmb1nq5DsvYQtwEl53F/9vZGifeG6mz+DsJxGUu+E=; b=yrUzkSb8WpJMxXjPjQOJIHsVm9yqrLRUvlkyVQfMkpF+cWw9wmCHSbn10kYiHpIcVAGhN5 WzHA64TKvssixRCA== From: Sebastian Andrzej Siewior To: linux-clk@vger.kernel.org Subject: [RFC PATCH] clk: imx8qxp: Unbreak auto module building for MXC_CLK_SCU Message-ID: <20201124121740.ytag7rm53umi2qvm@linutronix.de> MIME-Version: 1.0 Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201124_071745_178058_2D8D3DCE X-CRM114-Status: GOOD ( 15.38 ) 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: Anson Huang , Stephen Boyd , Fabio Estevam , Michael Turquette , NXP Linux Team , Pengutronix Kernel Team , Thomas Gleixner , Shawn Guo , Sascha Hauer , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Automatic moudule building is broken by adding module support to i.MX8QXP clock driver. It can be tested by ARM defconfig + CONFIG_IMX_MBOX=m and CONFIG_MXC_CLK_SCU=m. The compile breaks because the modules and source files are mixed. After fixing that, the build breaks because the SCU driver has no license or symbols, which are required by the CLK_IMX8QXP driver, are not properly exported. The following patch is against -rc5: Compile module clk-imx-scu.o which contains of clk-scu.o clk-lpcg-scu.o if CONFIG_MXC_CLK_SCU is enabled. Compile modules clk-imx8qxp.o and clk-imx8qxp-lpcg.o if CONFIG_CLK_IMX8QXP is enabled. Add EXPORT_SYMBOL_GPL() to functions which fail to resolve once CONFIG_CLK_IMX8QXP is enabled as module. Add License GPL to clk-scu.c. In -next it breaks additionally because device_is_bound() is not made available to modules. Any suggestions? Should the original commit be revoked? Fixes: e0d0d4d86c766 ("clk: imx8qxp: Support building i.MX8QXP clock driver as module") Signed-off-by: Sebastian Andrzej Siewior --- drivers/clk/imx/Makefile | 6 +++--- drivers/clk/imx/clk-lpcg-scu.c | 1 + drivers/clk/imx/clk-scu.c | 4 ++++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/clk/imx/Makefile b/drivers/clk/imx/Makefile index dd6a737d060b4..b8bf9460c91d7 100644 --- a/drivers/clk/imx/Makefile +++ b/drivers/clk/imx/Makefile @@ -26,9 +26,9 @@ obj-$(CONFIG_CLK_IMX8MN) += clk-imx8mn.o obj-$(CONFIG_CLK_IMX8MP) += clk-imx8mp.o obj-$(CONFIG_CLK_IMX8MQ) += clk-imx8mq.o -obj-$(CONFIG_MXC_CLK_SCU) += clk-imx-scu.o clk-imx-lpcg-scu.o -clk-imx-scu-$(CONFIG_CLK_IMX8QXP) += clk-scu.o clk-imx8qxp.o -clk-imx-lpcg-scu-$(CONFIG_CLK_IMX8QXP) += clk-lpcg-scu.o clk-imx8qxp-lpcg.o +obj-$(CONFIG_MXC_CLK_SCU) += clk-imx-scu.o +clk-imx-scu-y := clk-scu.o clk-lpcg-scu.o +obj-$(CONFIG_CLK_IMX8QXP) += clk-imx8qxp.o clk-imx8qxp-lpcg.o obj-$(CONFIG_CLK_IMX1) += clk-imx1.o obj-$(CONFIG_CLK_IMX25) += clk-imx25.o diff --git a/drivers/clk/imx/clk-lpcg-scu.c b/drivers/clk/imx/clk-lpcg-scu.c index 1f0e44f921aee..336dce43da82d 100644 --- a/drivers/clk/imx/clk-lpcg-scu.c +++ b/drivers/clk/imx/clk-lpcg-scu.c @@ -115,3 +115,4 @@ struct clk_hw *imx_clk_lpcg_scu(const char *name, const char *parent_name, return hw; } +EXPORT_SYMBOL_GPL(imx_clk_lpcg_scu); diff --git a/drivers/clk/imx/clk-scu.c b/drivers/clk/imx/clk-scu.c index b8b2072742a56..026a33606ae53 100644 --- a/drivers/clk/imx/clk-scu.c +++ b/drivers/clk/imx/clk-scu.c @@ -9,6 +9,7 @@ #include #include #include +#include #include "clk-scu.h" @@ -132,6 +133,7 @@ int imx_clk_scu_init(void) { return imx_scu_get_handle(&ccm_ipc_handle); } +EXPORT_SYMBOL_GPL(imx_clk_scu_init); /* * clk_scu_recalc_rate - Get clock rate for a SCU clock @@ -387,3 +389,5 @@ struct clk_hw *__imx_clk_scu(const char *name, const char * const *parents, return hw; } +EXPORT_SYMBOL_GPL(__imx_clk_scu); +MODULE_LICENSE("GPL");