Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4143042rwd; Sat, 3 Jun 2023 21:43:14 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ440pnWoSUkjwksgRzKUxRj4h+yxSjGEaAmK2CLvliCvaZVKIgt7EMwFuksYqcxePp9GFrT X-Received: by 2002:a05:6358:7f14:b0:123:38a8:2693 with SMTP id p20-20020a0563587f1400b0012338a82693mr17960850rwn.20.1685853794642; Sat, 03 Jun 2023 21:43:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685853794; cv=none; d=google.com; s=arc-20160816; b=AC574KxptZ4rfLvK13/dA9vaTHeESwp+bU1j4bVmK6wmS2i1GxlqUw9YE1rw0IQhf+ Ii/alLMp1lYksaQSwzcQgs4Wm3sTlcgCGe5A2VrF1G3nzNffxC/mBYez9cHF4+VjcHSF HBP06nIx8/YT9kJvznBm6oO3v4P5OUv6es1MwJlkD+svSVTVNkIbt0KDRcbPh4ZeA5z2 RPP8BTdk8pbM1+rAVDY4qcKBmntIotgqQTUC4Nm6+cefMk5D2YBgWhBApR7+QijhF1nr vFxbb6BuVIqfwRQbZoKDqFDWaXr2VcODBda8MhGxG8U0XX1QwC/aesO7Dw88PthDsLG+ 78NA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=n7qFSDh+N+7Ex6c1CWStRzahvEhFnXPdFwEoRdbPVKA=; b=CAZy0EAUlVkNXyIcEkQloa4Rpl71wEXeYB0uhPMq/SgtH/Ncbk6ZcFn+v69t1rpebE iO0p2HYXNz68M0r2yhfZiEDSLMdMG/vduqHiyLYaqan8VSzRkgSQagK2TuKrH3JyfX6i qv9MKaAaAdse49Mjdr8pQElQu69FFpq72T1zQEmCJXnInRnvdXueSQKNtPAOIWjhNzJp pQ3ykCCrC0NmuUEqQlXSF373LBNh12F2yeTVg43ieZERZ8Rc3JRyDSYkYJeT0o36U+hb yw3jX8eMvvvlKlXKYZKE/6o/4NcgTRcWEfr+9LBgZlo4m4emNZ1BU1uW1ahGkBb1piR7 qbNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=h0R8cHoK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u13-20020a17090a5e4d00b00250697cb4e6si5344037pji.27.2023.06.03.21.43.00; Sat, 03 Jun 2023 21:43:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=h0R8cHoK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229873AbjFDE0P (ORCPT + 99 others); Sun, 4 Jun 2023 00:26:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229486AbjFDE0G (ORCPT ); Sun, 4 Jun 2023 00:26:06 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83E43B1 for ; Sat, 3 Jun 2023 21:26:03 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1C1DF60B9F for ; Sun, 4 Jun 2023 04:26:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 54D2BC433D2; Sun, 4 Jun 2023 04:26:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685852762; bh=uTyogFEYDmuDrlKpwoWEIQcvVLMVsdGuObp2WIschWM=; h=From:To:Cc:Subject:Date:From; b=h0R8cHoKxQKwLauS8DpXnePYwHktmrLF7t9qxCVrt8ORJkWOCf9y4qAKZ5oZkuz2D erCDgn8wPDmV0pK1oFn65IWW/uB/llIjGiii5jSMV4n7Nlhv8GopbS0cEvGKue/rhb e+7EwayIBW4PZMIUfw8MMPAOHb2NDhKJOislwTtOs4Ylj9VLDsYp8AHNy+o+x59YfV 1mK71oUtvPRU+e+jvCWi3J3gpGtnINWIKrEP+ugY6goUD1K0J4zOGEWNmdLBGGEPSG 3ve0ZX/fZbM4OntSoZVUoV+SfG1Rri1X3R7nODSEVZXeNNsoHcLf4PDLZfy8liJYEz Fm6bCYWWtvB/w== From: Masahiro Yamada To: linux-kernel@vger.kernel.org, Lee Jones Cc: Masahiro Yamada , Nick Terrell Subject: [PATCH 1/2] mfd: rsmu: fix mixed module-builtin object Date: Sun, 4 Jun 2023 13:25:56 +0900 Message-Id: <20230604042557.900590-1-masahiroy@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/mfd/Kconfig | 8 ++++++-- drivers/mfd/Makefile | 6 ++++-- drivers/mfd/rsmu_core.c | 3 +++ 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index e90463c4441c..1b2eeb654e91 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig @@ -2215,10 +2215,14 @@ config MFD_INTEL_M10_BMC_PMCI 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 @@ -2232,7 +2236,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 1d2392f06f78..2a0e80f941a1 100644 --- a/drivers/mfd/Makefile +++ b/drivers/mfd/Makefile @@ -271,7 +271,9 @@ obj-$(CONFIG_MFD_INTEL_M10_BMC_PMCI) += intel-m10-bmc-pmci.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"); -- 2.39.2