[1/1] power_supply: Drop usage of nowarn variant of sysfs_create_link()

Submitted by Luis Henriques on May 28, 2012, 2:38 p.m.

Details

Message ID 1338215915-8064-2-git-send-email-luis.henriques@canonical.com
State New
Headers show

Commit Message

Luis Henriques May 28, 2012, 2:38 p.m.
From: Anton Vorontsov <cbouatmailru@gmail.com>

BugLink: http://bugs.launchpad.net/bugs/1005264

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@canb.auug.org.au>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
(cherry picked from commit 93278d151e7bd35ccd0e083d7f2d8123cbaf36f8)

Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/power/power_supply_core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Tim Gardner May 28, 2012, 2:54 p.m.

Herton Ronaldo Krzesinski May 28, 2012, 5:16 p.m.
On Mon, May 28, 2012 at 03:38:35PM +0100, Luis Henriques wrote:
> From: Anton Vorontsov <cbouatmailru@gmail.com>
> 
> BugLink: http://bugs.launchpad.net/bugs/1005264
> 
> 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@canb.auug.org.au>
> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
> (cherry picked from commit 93278d151e7bd35ccd0e083d7f2d8123cbaf36f8)
> 
> Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
> ---
>  drivers/power/power_supply_core.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> 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);
>  
> -- 
> 1.7.9.5
> 
> 
> -- 
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team
>
Tim Gardner May 28, 2012, 6 p.m.

Patch hide | download patch | download mbox

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);