2010-12-15 02:09:20

by Stephen Rothwell

[permalink] [raw]
Subject: linux-next: build failure after merge of the voltage tree

Hi Liam,

After merging the voltage tree, today's linux-next build (x86_64 allmodconfig)
failed like this:

drivers/built-in.o: In function `mc13xxx_regulator_is_enabled':
mc13xxx-regulator-core.c:(.text+0x9b01c): undefined reference to `mc13xxx_lock'
mc13xxx-regulator-core.c:(.text+0x9b038): undefined reference to `mc13xxx_reg_read'
mc13xxx-regulator-core.c:(.text+0x9b04a): undefined reference to `mc13xxx_unlock'
drivers/built-in.o: In function `mc13xxx_regulator_disable':
mc13xxx-regulator-core.c:(.text+0x9b256): undefined reference to `mc13xxx_lock'
mc13xxx-regulator-core.c:(.text+0x9b26f): undefined reference to `mc13xxx_reg_rmw'
mc13xxx-regulator-core.c:(.text+0x9b281): undefined reference to `mc13xxx_unlock'
drivers/built-in.o: In function `mc13xxx_regulator_enable':
mc13xxx-regulator-core.c:(.text+0x9b323): undefined reference to `mc13xxx_lock'
mc13xxx-regulator-core.c:(.text+0x9b33c): undefined reference to `mc13xxx_reg_rmw'
mc13xxx-regulator-core.c:(.text+0x9b34e): undefined reference to `mc13xxx_unlock'
drivers/built-in.o: In function `mc13xxx_regulator_get_voltage':
mc13xxx-regulator-core.c:(.text+0x9b3f5): undefined reference to `mc13xxx_lock'
mc13xxx-regulator-core.c:(.text+0x9b40c): undefined reference to `mc13xxx_reg_read'
mc13xxx-regulator-core.c:(.text+0x9b41f): undefined reference to `mc13xxx_unlock'
drivers/built-in.o: In function `mc13xxx_regulator_set_voltage':
mc13xxx-regulator-core.c:(.text+0x9b67f): undefined reference to `mc13xxx_lock'
mc13xxx-regulator-core.c:(.text+0x9b6a4): undefined reference to `mc13xxx_reg_rmw'
mc13xxx-regulator-core.c:(.text+0x9b6b6): undefined reference to `mc13xxx_unlock'

Please build test this stuff ...

I have used the voltage tree from next-20101213 for today.
--
Cheers,
Stephen Rothwell [email protected]
http://www.canb.auug.org.au/~sfr/


Attachments:
(No filename) (1.80 kB)
(No filename) (490.00 B)
Download all attachments

2010-12-15 09:04:53

by Liam Girdwood

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the voltage tree

On Wed, 2010-12-15 at 13:09 +1100, Stephen Rothwell wrote:
> Hi Liam,
>
> After merging the voltage tree, today's linux-next build (x86_64 allmodconfig)
> failed like this:
>
> drivers/built-in.o: In function `mc13xxx_regulator_is_enabled':
> mc13xxx-regulator-core.c:(.text+0x9b01c): undefined reference to `mc13xxx_lock'
> mc13xxx-regulator-core.c:(.text+0x9b038): undefined reference to `mc13xxx_reg_read'
> mc13xxx-regulator-core.c:(.text+0x9b04a): undefined reference to `mc13xxx_unlock'
> drivers/built-in.o: In function `mc13xxx_regulator_disable':
> mc13xxx-regulator-core.c:(.text+0x9b256): undefined reference to `mc13xxx_lock'
> mc13xxx-regulator-core.c:(.text+0x9b26f): undefined reference to `mc13xxx_reg_rmw'
> mc13xxx-regulator-core.c:(.text+0x9b281): undefined reference to `mc13xxx_unlock'
> drivers/built-in.o: In function `mc13xxx_regulator_enable':
> mc13xxx-regulator-core.c:(.text+0x9b323): undefined reference to `mc13xxx_lock'
> mc13xxx-regulator-core.c:(.text+0x9b33c): undefined reference to `mc13xxx_reg_rmw'
> mc13xxx-regulator-core.c:(.text+0x9b34e): undefined reference to `mc13xxx_unlock'
> drivers/built-in.o: In function `mc13xxx_regulator_get_voltage':
> mc13xxx-regulator-core.c:(.text+0x9b3f5): undefined reference to `mc13xxx_lock'
> mc13xxx-regulator-core.c:(.text+0x9b40c): undefined reference to `mc13xxx_reg_read'
> mc13xxx-regulator-core.c:(.text+0x9b41f): undefined reference to `mc13xxx_unlock'
> drivers/built-in.o: In function `mc13xxx_regulator_set_voltage':
> mc13xxx-regulator-core.c:(.text+0x9b67f): undefined reference to `mc13xxx_lock'
> mc13xxx-regulator-core.c:(.text+0x9b6a4): undefined reference to `mc13xxx_reg_rmw'
> mc13xxx-regulator-core.c:(.text+0x9b6b6): undefined reference to `mc13xxx_unlock'
>
> Please build test this stuff ...
>

Sorry, this driver does build as built-in.

Yong, can you send a patch *today* that fixes the modular build for
this.

Thanks

Liam

--
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk

2010-12-15 14:03:50

by Mark Brown

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the voltage tree

On Wed, Dec 15, 2010 at 09:04:44AM +0000, Liam Girdwood wrote:

> Yong, can you send a patch *today* that fixes the modular build for
> this.

Looks like he's not going to get a chance to do that, I'm cooking up
some patches just now which should deal with the issue.

2010-12-15 14:10:32

by Mark Brown

[permalink] [raw]
Subject: [PATCH] regulator: Allow modular build of mc13xxx-core

Since the MFD core for this device and the regulator drivers for these
devices can be built modular we should also support modular build of
the shared code for the regulator drivers, otherwise we try to link
built in code against modular code with unfortunate results.

Signed-off-by: Mark Brown <[email protected]>
---
drivers/regulator/Kconfig | 2 +-
drivers/regulator/mc13xxx-regulator-core.c | 5 +++++
2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
index 485a9bc..e1d9436 100644
--- a/drivers/regulator/Kconfig
+++ b/drivers/regulator/Kconfig
@@ -187,7 +187,7 @@ config REGULATOR_PCAP
PCAP2 PMIC.

config REGULATOR_MC13XXX_CORE
- bool
+ tristate

config REGULATOR_MC13783
tristate "Support regulators on Freescale MC13783 PMIC"
diff --git a/drivers/regulator/mc13xxx-regulator-core.c b/drivers/regulator/mc13xxx-regulator-core.c
index 448e8f4..da46b3c 100644
--- a/drivers/regulator/mc13xxx-regulator-core.c
+++ b/drivers/regulator/mc13xxx-regulator-core.c
@@ -123,6 +123,7 @@ int mc13xxx_get_best_voltage_index(struct regulator_dev *rdev,
}
return bestindex;
}
+EXPORT_SYMBOL_GPL(mc13xxx_get_best_voltage_index);

static int mc13xxx_regulator_set_voltage(struct regulator_dev *rdev, int min_uV,
int max_uV, unsigned *selector)
@@ -185,6 +186,7 @@ struct regulator_ops mc13xxx_regulator_ops = {
.set_voltage = mc13xxx_regulator_set_voltage,
.get_voltage = mc13xxx_regulator_get_voltage,
};
+EXPORT_SYMBOL_GPL(mc13xxx_regulator_ops);

int mc13xxx_fixed_regulator_set_voltage(struct regulator_dev *rdev, int min_uV,
int max_uV, unsigned *selector)
@@ -202,6 +204,7 @@ int mc13xxx_fixed_regulator_set_voltage(struct regulator_dev *rdev, int min_uV,
else
return -EINVAL;
}
+EXPORT_SYMBOL_GPL(mc13xxx_fixed_regulator_set_voltage);

int mc13xxx_fixed_regulator_get_voltage(struct regulator_dev *rdev)
{
@@ -213,6 +216,7 @@ int mc13xxx_fixed_regulator_get_voltage(struct regulator_dev *rdev)

return mc13xxx_regulators[id].voltages[0];
}
+EXPORT_SYMBOL_GPL(mc13xxx_fixed_regulator_get_voltage);

struct regulator_ops mc13xxx_fixed_regulator_ops = {
.enable = mc13xxx_regulator_enable,
@@ -222,6 +226,7 @@ struct regulator_ops mc13xxx_fixed_regulator_ops = {
.set_voltage = mc13xxx_fixed_regulator_set_voltage,
.get_voltage = mc13xxx_fixed_regulator_get_voltage,
};
+EXPORT_SYMBOL_GPL(mc13xxx_fixed_regulator_ops);

int mc13xxx_sw_regulator_is_enabled(struct regulator_dev *rdev)
{
--
1.7.1

2010-12-15 21:30:25

by Liam Girdwood

[permalink] [raw]
Subject: Re: [PATCH] regulator: Allow modular build of mc13xxx-core

On Wed, 2010-12-15 at 14:10 +0000, Mark Brown wrote:
> Since the MFD core for this device and the regulator drivers for these
> devices can be built modular we should also support modular build of
> the shared code for the regulator drivers, otherwise we try to link
> built in code against modular code with unfortunate results.
>
> Signed-off-by: Mark Brown <[email protected]>

Thanks Mark !

It looks like you sent the wrong patch as I had to also add :-

diff --git a/drivers/regulator/mc13xxx-regulator-core.c b/drivers/regulator/mc13xxx-regulator-core.c
index da46b3c..f53d31b 100644
--- a/drivers/regulator/mc13xxx-regulator-core.c
+++ b/drivers/regulator/mc13xxx-regulator-core.c
@@ -89,6 +89,7 @@ int mc13xxx_regulator_list_voltage(struct regulator_dev *rdev,

return mc13xxx_regulators[id].voltages[selector];
}
+EXPORT_SYMBOL_GPL(mc13xxx_regulator_list_voltage);

int mc13xxx_get_best_voltage_index(struct regulator_dev *rdev,
int min_uV, int max_uV)
@@ -232,6 +233,7 @@ int mc13xxx_sw_regulator_is_enabled(struct regulator_dev *rdev)
{
return 1;
}
+EXPORT_SYMBOL_GPL(mc13xxx_sw_regulator_is_enabled);

MODULE_LICENSE("GPL v2");
MODULE_AUTHOR("Yong Shen <[email protected]>");

To get it all building.

Now applied and squashed with above.

Liam
--
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk

2010-12-16 01:52:07

by Yong Shen

[permalink] [raw]
Subject: Re: [PATCH] regulator: Allow modular build of mc13xxx-core

Hi there,

My bad. My test did not cover module-build case.
Thanks for fixing this.

Yong

On Thu, Dec 16, 2010 at 5:30 AM, Liam Girdwood <[email protected]> wrote:
> On Wed, 2010-12-15 at 14:10 +0000, Mark Brown wrote:
>> Since the MFD core for this device and the regulator drivers for these
>> devices can be built modular we should also support modular build of
>> the shared code for the regulator drivers, otherwise we try to link
>> built in code against modular code with unfortunate results.
>>
>> Signed-off-by: Mark Brown <[email protected]>
>
> Thanks Mark !
>
> It looks like you sent the wrong patch as I had to also add :-
>
> diff --git a/drivers/regulator/mc13xxx-regulator-core.c b/drivers/regulator/mc13xxx-regulator-core.c
> index da46b3c..f53d31b 100644
> --- a/drivers/regulator/mc13xxx-regulator-core.c
> +++ b/drivers/regulator/mc13xxx-regulator-core.c
> @@ -89,6 +89,7 @@ int mc13xxx_regulator_list_voltage(struct regulator_dev *rdev,
>
> ? ? ? ?return mc13xxx_regulators[id].voltages[selector];
> ?}
> +EXPORT_SYMBOL_GPL(mc13xxx_regulator_list_voltage);
>
> ?int mc13xxx_get_best_voltage_index(struct regulator_dev *rdev,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?int min_uV, int max_uV)
> @@ -232,6 +233,7 @@ int mc13xxx_sw_regulator_is_enabled(struct regulator_dev *rdev)
> ?{
> ? ? ? ?return 1;
> ?}
> +EXPORT_SYMBOL_GPL(mc13xxx_sw_regulator_is_enabled);
>
> ?MODULE_LICENSE("GPL v2");
> ?MODULE_AUTHOR("Yong Shen <[email protected]>");
>
> To get it all building.
>
> Now applied and squashed with above.
>
> Liam
> --
> Freelance Developer, SlimLogic Ltd
> ASoC and Voltage Regulator Maintainer.
> http://www.slimlogic.co.uk
>
>