Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1359955

Re: [RFC/RFT PATCH 2/2] mfd: max14577: Allow driver to be built as a module

Path csiph.com!weretis.net!feeder4.news.weretis.net!news.mixmin.net!aioe.org!gothmog.csi.it!bofh.it!news.nic.it!robomod
From Javier Martinez Canillas <javier@osg.samsung.com>
Newsgroups linux.kernel
Subject Re: [RFC/RFT PATCH 2/2] mfd: max14577: Allow driver to be built as a module
Date Thu, 17 Mar 2016 16:40:01 +0100
Message-ID <rdIbL-Jr-1@gated-at.bofh.it> (permalink)
References <rdmNY-333-11@gated-at.bofh.it> <rdmNZ-333-35@gated-at.bofh.it> <rdvoe-yw-9@gated-at.bofh.it>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0
MIME-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding 8bit
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 88
Organization linux.* mail to news gateway
X-Original-Cc Lee Jones <lee.jones@linaro.org>
X-Original-Date Thu, 17 Mar 2016 12:37:36 -0300
X-Original-Message-ID <56EACF40.8090609@osg.samsung.com>
X-Original-References <1458146930-2723-1-git-send-email-javier@osg.samsung.com> <1458146930-2723-3-git-send-email-javier@osg.samsung.com> <56EA0F59.4090507@samsung.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1359955

Show key headers only | View raw


Hello Chanwoo,

On 03/16/2016 10:58 PM, Chanwoo Choi wrote:
> On 2016년 03월 17일 01:48, Javier Martinez Canillas wrote:
>> The driver's Kconfig symbol is a boolean but nothing prevents the driver
>> to be built as a module instead of built-in. It is true that most system
>> integrators will choose the latter but the config should not restrict it.
>>
>> Suggested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
>> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
>>
>> ---
>>
>>  drivers/mfd/Kconfig | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
>> index eea61e349e26..be0ff820621b 100644
>> --- a/drivers/mfd/Kconfig
>> +++ b/drivers/mfd/Kconfig
>> @@ -514,8 +514,8 @@ config MFD_88PM860X
>>  	  battery-charger under the corresponding menus.
>>  
>>  config MFD_MAX14577
>> -	bool "Maxim Semiconductor MAX14577/77836 MUIC + Charger Support"
>> -	depends on I2C=y
>> +	tristate "Maxim Semiconductor MAX14577/77836 MUIC + Charger Support"
>> +	depends on I2C
>>  	select MFD_CORE
>>  	select REGMAP_I2C
>>  	select REGMAP_IRQ
>>
> 
> When I test the kernel build with these patch-set on next-20160316 tag,
> the following errors happen. 
>

You are absolutely right, there was an error on my test script and always
built it as built-in instead of as a module. I'm so sorry about that...

> ERROR: "maxim_charger_calc_reg_current" [drivers/regulator/max14577.ko] undefined!
> ERROR: "maxim_charger_currents" [drivers/regulator/max14577.ko] undefined!
> ERROR: "maxim_charger_currents" [drivers/power/max14577_charger.ko] undefined!
> ERROR: "maxim_charger_calc_reg_current" [drivers/power/max14577_charger.ko] undefined!
> 

This seems to be a latent bug that was exposed by making the max14577 MFD
Kconfig symbol tristate. Since I'm able to reproduce it even without the
patches by enabling the max14577 regulator and power drivers as a module.

These steps reproduce it on just next-20160316 without any other changes:

$ make exynos_defconfig
$ ./scripts/config --module CONFIG_REGULATOR_MAX14577
$ ./scripts/config --module CONFIG_CHARGER_MAX14577
$ make modules_prepare

$ make M=drivers/regulator/
  ...
  CC [M]  drivers/regulator//max14577.o
  Building modules, stage 2.
  MODPOST 1 modules
WARNING: "maxim_charger_calc_reg_current" [drivers/regulator//max14577.ko] undefined!
WARNING: "maxim_charger_currents" [drivers/regulator//max14577.ko] undefined!

$ make M=drivers/power
  ...
  CC [M]  drivers/power/max14577_charger.o
  Building modules, stage 2.
  MODPOST 1 modules
WARNING: "maxim_charger_calc_reg_current" [drivers/power/max14577_charger.ko] undefined!
WARNING: "maxim_charger_currents" [drivers/power/max14577_charger.ko] undefined!

Now, from a quick look the functions have EXPORT_SYMBOL_GPL() and the
function prototype declaration is in include/linux/mfd/max14577.h so
that should work AFAICT...

I'll take a look to this since it has to be fixed before the other patches.

> Best Regards,
> Chanwoo Choi
> 

Best regards,
-- 
Javier Martinez Canillas
Open Source Group
Samsung Research America

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC/RFT PATCH 0/2] mfd: max14577: Allow the driver to be built as a module Javier Martinez Canillas <javier@osg.samsung.com> - 2016-03-16 17:50 +0100
  [RFC/RFT PATCH 1/2] mfd: max14577: Use module_init() instead of subsys_initcall() Javier Martinez Canillas <javier@osg.samsung.com> - 2016-03-16 17:50 +0100
  [RFC/RFT PATCH 2/2] mfd: max14577: Allow driver to be built as a module Javier Martinez Canillas <javier@osg.samsung.com> - 2016-03-16 17:50 +0100
    Re: [RFC/RFT PATCH 2/2] mfd: max14577: Allow driver to be built as a  module Chanwoo Choi <cw00.choi@samsung.com> - 2016-03-17 03:00 +0100
      Re: [RFC/RFT PATCH 2/2] mfd: max14577: Allow driver to be built as a  module Javier Martinez Canillas <javier@osg.samsung.com> - 2016-03-17 16:40 +0100
        Re: [RFC/RFT PATCH 2/2] mfd: max14577: Allow driver to be built as a  module Javier Martinez Canillas <javier@osg.samsung.com> - 2016-03-17 18:00 +0100
          Re: [RFC/RFT PATCH 2/2] mfd: max14577: Allow driver to be built as a  module Javier Martinez Canillas <javier@osg.samsung.com> - 2016-03-17 19:10 +0100
            Re: [RFC/RFT PATCH 2/2] mfd: max14577: Allow driver to be built as a  module Chanwoo Choi <cw00.choi@samsung.com> - 2016-03-18 09:00 +0100
              Re: [RFC/RFT PATCH 2/2] mfd: max14577: Allow driver to be built as a  module Javier Martinez Canillas <javier@osg.samsung.com> - 2016-03-18 12:00 +0100
  Re: [RFC/RFT PATCH 0/2] mfd: max14577: Allow the driver to be built as  a module Krzysztof Kozlowski <k.kozlowski@samsung.com> - 2016-03-17 02:20 +0100
    Re: [RFC/RFT PATCH 0/2] mfd: max14577: Allow the driver to be built  as a module Javier Martinez Canillas <javier@osg.samsung.com> - 2016-03-17 16:30 +0100

csiph-web