From patchwork Sat Nov 19 23:05:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Lobakin X-Patchwork-Id: 13049835 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C787AC433FE for ; Sat, 19 Nov 2022 23:06:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235022AbiKSXGD (ORCPT ); Sat, 19 Nov 2022 18:06:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234334AbiKSXF7 (ORCPT ); Sat, 19 Nov 2022 18:05:59 -0500 X-Greylist: delayed 64 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Sat, 19 Nov 2022 15:05:57 PST Received: from mail-4322.protonmail.ch (mail-4322.protonmail.ch [185.70.43.22]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C5B819C35; Sat, 19 Nov 2022 15:05:57 -0800 (PST) Date: Sat, 19 Nov 2022 23:05:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail3; t=1668899155; x=1669158355; bh=os6z3ba01+YXEoGx1b8Zwzyato7B2D5Y3WgXf8vG8a0=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=euSIxToFxm3b5kV2z4QSpdEhp/M2qP87Z7/nF7qW0RbkUB18Qr5BvHy9d0Y9XHjDb 3LrhPo2OmnhdnRrmFSIXxR+F0yBxPHvFeKwqUrQ4GLQcjDpoyiFYbhMwfDBeDMHGk7 /TtkNpy4nCP8L7b/5h2XeR/9keyCzOnIpJcerLKDYt8JTnrwtBgBSkMXeRs2Mkd7J/ KJDAzsJFsa/7pqnoPueRjCve9rg/EhL6hOScGKWZ4Xegm1l88FzlQ2a5L7iGoCySty QmeihC2zQKpjMJH9K3knmyWWs4OCWkELkv8M/vWege356kVN4dFtEs3Mog7LsPQ02J Sbt7yWJq9brVA== To: linux-kbuild@vger.kernel.org From: Alexander Lobakin Cc: Alexander Lobakin , Masahiro Yamada , Nicolas Schier , Jens Axboe , Boris Brezillon , Borislav Petkov , Tony Luck , Miquel Raynal , Vladimir Oltean , Alexandre Belloni , Derek Chickles , Ioana Ciornei , Salil Mehta , Sunil Goutham , Grygorii Strashko , Daniel Scally , Hans de Goede , Mark Brown , Andy Shevchenko , NXP Linux Team , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 05/18] mfd: rsmu: fix mixed module-builtin object Message-ID: <20221119225650.1044591-6-alobakin@pm.me> In-Reply-To: <20221119225650.1044591-1-alobakin@pm.me> References: <20221119225650.1044591-1-alobakin@pm.me> Feedback-ID: 22809121:user:proton MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Masahiro Yamada With CONFIG_MFD_RSMU_I2C=m and CONFIG_MFD_RSMU_SPI=y (or vice versa), rsmu_core.o is linked to a module and also to vmlinux even though the expected CFLAGS are different between builtins and modules. This is the same situation as fixed by commit 637a642f5ca5 ("zstd: Fixing mixed module-builtin objects"). Split rsmu-core into a separate module. Signed-off-by: Masahiro Yamada Reviewed-and-tested-by: Alexander Lobakin Signed-off-by: Alexander Lobakin --- drivers/mfd/Kconfig | 8 ++++++-- drivers/mfd/Makefile | 6 ++++-- drivers/mfd/rsmu_core.c | 3 +++ 3 files changed, 13 insertions(+), 4 deletions(-) -- 2.38.1 diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index 8b93856de432..f52efa1a968d 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig @@ -2232,10 +2232,14 @@ config MFD_INTEL_M10_BMC additional drivers must be enabled in order to use the functionality of the device. +config MFD_RSMU_CORE + tristate + select MFD_CORE + config MFD_RSMU_I2C tristate "Renesas Synchronization Management Unit with I2C" depends on I2C && OF - select MFD_CORE + select MFD_RSMU_CORE select REGMAP_I2C help Support for the Renesas Synchronization Management Unit, such as @@ -2249,7 +2253,7 @@ config MFD_RSMU_I2C config MFD_RSMU_SPI tristate "Renesas Synchronization Management Unit with SPI" depends on SPI && OF - select MFD_CORE + select MFD_RSMU_CORE select REGMAP_SPI help Support for the Renesas Synchronization Management Unit, such as diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile index 7ed3ef4a698c..d40d6619bacd 100644 --- a/drivers/mfd/Makefile +++ b/drivers/mfd/Makefile @@ -276,7 +276,9 @@ obj-$(CONFIG_MFD_INTEL_M10_BMC) += intel-m10-bmc.o obj-$(CONFIG_MFD_ATC260X) += atc260x-core.o obj-$(CONFIG_MFD_ATC260X_I2C) += atc260x-i2c.o -rsmu-i2c-objs := rsmu_core.o rsmu_i2c.o -rsmu-spi-objs := rsmu_core.o rsmu_spi.o +rsmu-core-objs := rsmu_core.o +rsmu-i2c-objs := rsmu_i2c.o +rsmu-spi-objs := rsmu_spi.o +obj-$(CONFIG_MFD_RSMU_CORE) += rsmu-core.o obj-$(CONFIG_MFD_RSMU_I2C) += rsmu-i2c.o obj-$(CONFIG_MFD_RSMU_SPI) += rsmu-spi.o diff --git a/drivers/mfd/rsmu_core.c b/drivers/mfd/rsmu_core.c index 29437fd0bd5b..5bf1e23a47e5 100644 --- a/drivers/mfd/rsmu_core.c +++ b/drivers/mfd/rsmu_core.c @@ -5,6 +5,7 @@ * Copyright (C) 2021 Integrated Device Technology, Inc., a Renesas Company. */ +#include #include #include #include @@ -78,11 +79,13 @@ int rsmu_core_init(struct rsmu_ddata *rsmu) return ret; } +EXPORT_SYMBOL_GPL(rsmu_core_init); void rsmu_core_exit(struct rsmu_ddata *rsmu) { mutex_destroy(&rsmu->lock); } +EXPORT_SYMBOL_GPL(rsmu_core_exit); MODULE_DESCRIPTION("Renesas SMU core driver"); MODULE_LICENSE("GPL");