* [PATCH] regulator: Rename files for Maxim PMIC drivers
@ 2016-03-17 17:54 Javier Martinez Canillas
2016-03-18 0:07 ` Krzysztof Kozlowski
2016-03-18 0:31 ` Chanwoo Choi
0 siblings, 2 replies; 5+ messages in thread
From: Javier Martinez Canillas @ 2016-03-17 17:54 UTC (permalink / raw)
To: linux-kernel
Cc: Liam Girdwood, Chanwoo Choi, Krzysztof Kozlowski, Mark Brown,
Javier Martinez Canillas
Most Maxim PMIC regulator drivers are for sub-devices of Multi-Function
Devices with drivers under drivers/mfd. But for many of these, the same
object file name was used for both the MFD and the regulator drivers.
Having 2 different drivers with the same name causes a lot of confusion
to Kbuild, specially if these are built as module since only one module
will be installed and also exported symbols will be undefined due being
overwritten by the other module during modpost.
For example, it fixes the following issue when both drivers are module:
$ 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!
Reported-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
---
MAINTAINERS | 4 ++--
drivers/regulator/Makefile | 6 +++---
drivers/regulator/{max14577.c => max14577-regulator.c} | 0
drivers/regulator/{max77693.c => max77693-regulator.c} | 0
drivers/regulator/{max8997.c => max8997-regulator.c} | 0
5 files changed, 5 insertions(+), 5 deletions(-)
rename drivers/regulator/{max14577.c => max14577-regulator.c} (100%)
rename drivers/regulator/{max77693.c => max77693-regulator.c} (100%)
rename drivers/regulator/{max8997.c => max8997-regulator.c} (100%)
diff --git a/MAINTAINERS b/MAINTAINERS
index 3c0be602d57c..37218e39f6dc 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -6985,9 +6985,9 @@ M: Chanwoo Choi <cw00.choi@samsung.com>
M: Krzysztof Kozlowski <k.kozlowski@samsung.com>
L: linux-kernel@vger.kernel.org
S: Supported
-F: drivers/*/max14577.c
+F: drivers/*/max14577*.c
F: drivers/*/max77686*.c
-F: drivers/*/max77693.c
+F: drivers/*/max77693*.c
F: drivers/extcon/extcon-max14577.c
F: drivers/extcon/extcon-max77693.c
F: drivers/rtc/rtc-max77686.c
diff --git a/drivers/regulator/Makefile b/drivers/regulator/Makefile
index 61bfbb9d4a0c..8018b2ef13cb 100644
--- a/drivers/regulator/Makefile
+++ b/drivers/regulator/Makefile
@@ -46,7 +46,7 @@ obj-$(CONFIG_REGULATOR_LP8788) += lp8788-buck.o
obj-$(CONFIG_REGULATOR_LP8788) += lp8788-ldo.o
obj-$(CONFIG_REGULATOR_LP8755) += lp8755.o
obj-$(CONFIG_REGULATOR_LTC3589) += ltc3589.o
-obj-$(CONFIG_REGULATOR_MAX14577) += max14577.o
+obj-$(CONFIG_REGULATOR_MAX14577) += max14577-regulator.o
obj-$(CONFIG_REGULATOR_MAX1586) += max1586.o
obj-$(CONFIG_REGULATOR_MAX77620) += max77620-regulator.o
obj-$(CONFIG_REGULATOR_MAX8649) += max8649.o
@@ -55,10 +55,10 @@ obj-$(CONFIG_REGULATOR_MAX8907) += max8907-regulator.o
obj-$(CONFIG_REGULATOR_MAX8925) += max8925-regulator.o
obj-$(CONFIG_REGULATOR_MAX8952) += max8952.o
obj-$(CONFIG_REGULATOR_MAX8973) += max8973-regulator.o
-obj-$(CONFIG_REGULATOR_MAX8997) += max8997.o
+obj-$(CONFIG_REGULATOR_MAX8997) += max8997-regulator.o
obj-$(CONFIG_REGULATOR_MAX8998) += max8998.o
obj-$(CONFIG_REGULATOR_MAX77686) += max77686-regulator.o
-obj-$(CONFIG_REGULATOR_MAX77693) += max77693.o
+obj-$(CONFIG_REGULATOR_MAX77693) += max77693-regulator.o
obj-$(CONFIG_REGULATOR_MAX77802) += max77802-regulator.o
obj-$(CONFIG_REGULATOR_MC13783) += mc13783-regulator.o
obj-$(CONFIG_REGULATOR_MC13892) += mc13892-regulator.o
diff --git a/drivers/regulator/max14577.c b/drivers/regulator/max14577-regulator.c
similarity index 100%
rename from drivers/regulator/max14577.c
rename to drivers/regulator/max14577-regulator.c
diff --git a/drivers/regulator/max77693.c b/drivers/regulator/max77693-regulator.c
similarity index 100%
rename from drivers/regulator/max77693.c
rename to drivers/regulator/max77693-regulator.c
diff --git a/drivers/regulator/max8997.c b/drivers/regulator/max8997-regulator.c
similarity index 100%
rename from drivers/regulator/max8997.c
rename to drivers/regulator/max8997-regulator.c
--
2.5.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] regulator: Rename files for Maxim PMIC drivers
2016-03-17 17:54 [PATCH] regulator: Rename files for Maxim PMIC drivers Javier Martinez Canillas
@ 2016-03-18 0:07 ` Krzysztof Kozlowski
2016-03-18 2:41 ` Javier Martinez Canillas
2016-03-18 0:31 ` Chanwoo Choi
1 sibling, 1 reply; 5+ messages in thread
From: Krzysztof Kozlowski @ 2016-03-18 0:07 UTC (permalink / raw)
To: Javier Martinez Canillas, linux-kernel
Cc: Liam Girdwood, Chanwoo Choi, Mark Brown
On 18.03.2016 02:54, Javier Martinez Canillas wrote:
> Most Maxim PMIC regulator drivers are for sub-devices of Multi-Function
> Devices with drivers under drivers/mfd. But for many of these, the same
> object file name was used for both the MFD and the regulator drivers.
>
> Having 2 different drivers with the same name causes a lot of confusion
> to Kbuild, specially if these are built as module since only one module
> will be installed and also exported symbols will be undefined due being
> overwritten by the other module during modpost.
These regulator drivers do not export symbols. In case of max14577 only
main MFD driver exports symbols so what do you mean by "overwriting by
other module"?
Beside that comment the patch itself is okay:
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Best regards,
Krzysztof
>
> For example, it fixes the following issue when both drivers are module:
>
> $ 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!
>
> Reported-by: Chanwoo Choi <cw00.choi@samsung.com>
> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
>
> ---
>
> MAINTAINERS | 4 ++--
> drivers/regulator/Makefile | 6 +++---
> drivers/regulator/{max14577.c => max14577-regulator.c} | 0
> drivers/regulator/{max77693.c => max77693-regulator.c} | 0
> drivers/regulator/{max8997.c => max8997-regulator.c} | 0
> 5 files changed, 5 insertions(+), 5 deletions(-)
> rename drivers/regulator/{max14577.c => max14577-regulator.c} (100%)
> rename drivers/regulator/{max77693.c => max77693-regulator.c} (100%)
> rename drivers/regulator/{max8997.c => max8997-regulator.c} (100%)
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] regulator: Rename files for Maxim PMIC drivers
2016-03-17 17:54 [PATCH] regulator: Rename files for Maxim PMIC drivers Javier Martinez Canillas
2016-03-18 0:07 ` Krzysztof Kozlowski
@ 2016-03-18 0:31 ` Chanwoo Choi
1 sibling, 0 replies; 5+ messages in thread
From: Chanwoo Choi @ 2016-03-18 0:31 UTC (permalink / raw)
To: Javier Martinez Canillas, linux-kernel
Cc: Liam Girdwood, Krzysztof Kozlowski, Mark Brown
Hi Javier,
On 2016년 03월 18일 02:54, Javier Martinez Canillas wrote:
> Most Maxim PMIC regulator drivers are for sub-devices of Multi-Function
> Devices with drivers under drivers/mfd. But for many of these, the same
> object file name was used for both the MFD and the regulator drivers.
>
> Having 2 different drivers with the same name causes a lot of confusion
> to Kbuild, specially if these are built as module since only one module
> will be installed and also exported symbols will be undefined due being
> overwritten by the other module during modpost.
>
> For example, it fixes the following issue when both drivers are module:
>
> $ 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!
>
> Reported-by: Chanwoo Choi <cw00.choi@samsung.com>
> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Best Regards,
Chanwoo Choi
[snip]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] regulator: Rename files for Maxim PMIC drivers
2016-03-18 0:07 ` Krzysztof Kozlowski
@ 2016-03-18 2:41 ` Javier Martinez Canillas
2016-03-18 3:29 ` Krzysztof Kozlowski
0 siblings, 1 reply; 5+ messages in thread
From: Javier Martinez Canillas @ 2016-03-18 2:41 UTC (permalink / raw)
To: Krzysztof Kozlowski, linux-kernel; +Cc: Liam Girdwood, Chanwoo Choi, Mark Brown
Hello Krzysztof,
Thanks a lot for your review.
On 03/17/2016 09:07 PM, Krzysztof Kozlowski wrote:
> On 18.03.2016 02:54, Javier Martinez Canillas wrote:
>> Most Maxim PMIC regulator drivers are for sub-devices of Multi-Function
>> Devices with drivers under drivers/mfd. But for many of these, the same
>> object file name was used for both the MFD and the regulator drivers.
>>
>> Having 2 different drivers with the same name causes a lot of confusion
>> to Kbuild, specially if these are built as module since only one module
>> will be installed and also exported symbols will be undefined due being
>> overwritten by the other module during modpost.
>
> These regulator drivers do not export symbols. In case of max14577 only
> main MFD driver exports symbols so what do you mean by "overwriting by
> other module"?
>
That's correct, what I meant is that if only the MFD driver is built, then
Kbuild / modpost are able to obtain the exported symbols and add it to the
Module.symvers file.
But if the regulator driver is also built, then the build system isn't able
to handle that case and the exported symbols from Module.symvers disappear.
So IIUC what happens is that the build system gets the exported symbols from
the max14755 MFD module but then finds another module that has the same name
(with no exported symbols) and so discards the list of symbols that previously
had for that module. That's why I used the "overwriting by the other module".
> Beside that comment the patch itself is okay:
>
> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
>
>
>
> Best regards,
>
> Krzysztof
>
Best regards,
--
Javier Martinez Canillas
Open Source Group
Samsung Research America
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] regulator: Rename files for Maxim PMIC drivers
2016-03-18 2:41 ` Javier Martinez Canillas
@ 2016-03-18 3:29 ` Krzysztof Kozlowski
0 siblings, 0 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2016-03-18 3:29 UTC (permalink / raw)
To: Javier Martinez Canillas, linux-kernel
Cc: Liam Girdwood, Chanwoo Choi, Mark Brown
On 18.03.2016 11:41, Javier Martinez Canillas wrote:
> Hello Krzysztof,
>
> Thanks a lot for your review.
>
> On 03/17/2016 09:07 PM, Krzysztof Kozlowski wrote:
>> On 18.03.2016 02:54, Javier Martinez Canillas wrote:
>>> Most Maxim PMIC regulator drivers are for sub-devices of Multi-Function
>>> Devices with drivers under drivers/mfd. But for many of these, the same
>>> object file name was used for both the MFD and the regulator drivers.
>>>
>>> Having 2 different drivers with the same name causes a lot of confusion
>>> to Kbuild, specially if these are built as module since only one module
>>> will be installed and also exported symbols will be undefined due being
>>> overwritten by the other module during modpost.
>>
>> These regulator drivers do not export symbols. In case of max14577 only
>> main MFD driver exports symbols so what do you mean by "overwriting by
>> other module"?
>>
>
> That's correct, what I meant is that if only the MFD driver is built, then
> Kbuild / modpost are able to obtain the exported symbols and add it to the
> Module.symvers file.
>
> But if the regulator driver is also built, then the build system isn't able
> to handle that case and the exported symbols from Module.symvers disappear.
>
> So IIUC what happens is that the build system gets the exported symbols from
> the max14755 MFD module but then finds another module that has the same name
> (with no exported symbols) and so discards the list of symbols that previously
> had for that module. That's why I used the "overwriting by the other module".
Ah, that indeed makes sense. Thanks for careful explanation.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-03-18 3:30 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-17 17:54 [PATCH] regulator: Rename files for Maxim PMIC drivers Javier Martinez Canillas
2016-03-18 0:07 ` Krzysztof Kozlowski
2016-03-18 2:41 ` Javier Martinez Canillas
2016-03-18 3:29 ` Krzysztof Kozlowski
2016-03-18 0:31 ` Chanwoo Choi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox