public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Javier Martinez Canillas <javier@osg.samsung.com>
To: Chanwoo Choi <cw00.choi@samsung.com>, linux-kernel@vger.kernel.org
Cc: Lee Jones <lee.jones@linaro.org>
Subject: Re: [RFC/RFT PATCH 2/2] mfd: max14577: Allow driver to be built as a module
Date: Thu, 17 Mar 2016 12:37:36 -0300	[thread overview]
Message-ID: <56EACF40.8090609@osg.samsung.com> (raw)
In-Reply-To: <56EA0F59.4090507@samsung.com>

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

  reply	other threads:[~2016-03-17 15:37 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-16 16:48 [RFC/RFT PATCH 0/2] mfd: max14577: Allow the driver to be built as a module Javier Martinez Canillas
2016-03-16 16:48 ` [RFC/RFT PATCH 1/2] mfd: max14577: Use module_init() instead of subsys_initcall() Javier Martinez Canillas
2016-03-16 16:48 ` [RFC/RFT PATCH 2/2] mfd: max14577: Allow driver to be built as a module Javier Martinez Canillas
2016-03-17  1:58   ` Chanwoo Choi
2016-03-17 15:37     ` Javier Martinez Canillas [this message]
2016-03-17 16:57       ` Javier Martinez Canillas
2016-03-17 18:02         ` Javier Martinez Canillas
2016-03-18  7:55           ` Chanwoo Choi
2016-03-18 10:50             ` Javier Martinez Canillas
2016-03-17  1:09 ` [RFC/RFT PATCH 0/2] mfd: max14577: Allow the " Krzysztof Kozlowski
2016-03-17 15:22   ` Javier Martinez Canillas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56EACF40.8090609@osg.samsung.com \
    --to=javier@osg.samsung.com \
    --cc=cw00.choi@samsung.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox