Re: linux-next: build failure after merge of the battery tree

From: Jeremy Fitzhardinge
Date: Sat Jan 07 2012 - 04:00:40 EST


On 01/06/2012 02:25 AM, Anton Vorontsov wrote:
> On Thu, Jan 05, 2012 at 02:40:42PM +1100, Stephen Rothwell wrote:
>> Hi Anton,
>>
>> After merging the battery tree, today's linux-next build (x86_64
>> allmodconfig) failed like this:
>>
>> ERROR: "sysfs_create_link_nowarn" [drivers/power/power_supply.ko] undefined!
>>
>> Caused by commit 8351665195ce ("power_supply: allow a power supply to
>> explicitly point to powered device"). That symbol is not exported to
>> modules.
>>
>> I have used the battery tree from next-20120104 for today.
> Thanks for catching this, Stephen!
>
> I wonder why do we need to use _nowarn variant?..
>
> Something tells me that we actually want a warning.
>
> Jeremy, are you OK with the patch down below?

Yep, that's fine.

J

>
> - - - -
> From: Anton Vorontsov <cbouatmailru@xxxxxxxxx>
> Subject: power_supply: Drop usage of nowarn variant of sysfs_create_link()
>
> The function is not exported to modules, plus we do want to catch anyone
> who tries to create complex hierarchy (in that case we'd need to change
> 'powers' symlink to a directory, probably under a different name to not
> break ABI).
>
> This patch fixes the following build error:
>
> ERROR: "sysfs_create_link_nowarn" [drivers/power/power_supply.ko] undefined!
>
> Reported-by: Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx>
> Signed-off-by: Anton Vorontsov <cbouatmailru@xxxxxxxxx>
> ---
> drivers/power/power_supply_core.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/power/power_supply_core.c b/drivers/power/power_supply_core.c
> index b10c121..47f4e11 100644
> --- a/drivers/power/power_supply_core.c
> +++ b/drivers/power/power_supply_core.c
> @@ -149,7 +149,7 @@ EXPORT_SYMBOL_GPL(power_supply_get_by_name);
>
> int power_supply_powers(struct power_supply *psy, struct device *dev)
> {
> - return sysfs_create_link_nowarn(&psy->dev->kobj, &dev->kobj, "powers");
> + return sysfs_create_link(&psy->dev->kobj, &dev->kobj, "powers");
> }
> EXPORT_SYMBOL_GPL(power_supply_powers);
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/