]> git.karo-electronics.de Git - linux-beck.git/commitdiff
gpio-charger: Provide default name for the power_supply
authorLars-Peter Clausen <lars@metafoo.de>
Thu, 18 Nov 2010 22:08:39 +0000 (23:08 +0100)
committerAnton Vorontsov <cbouatmailru@gmail.com>
Tue, 21 Dec 2010 23:29:04 +0000 (02:29 +0300)
This patch sets a default name for the power_supply in case there was
no name supplied through the platform_data.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
drivers/power/gpio-charger.c

index 8458cafcd2b268ecebcde76de1cc55cfd88e17a7..43078e34428a7b5f461b34ce222caac472e3df57 100644 (file)
@@ -94,7 +94,7 @@ static int __devinit gpio_charger_probe(struct platform_device *pdev)
 
        charger = &gpio_charger->charger;
 
-       charger->name = pdata->name;
+       charger->name = pdata->name ? pdata->name : "gpio-charger";
        charger->type = pdata->type;
        charger->properties = gpio_charger_properties;
        charger->num_properties = ARRAY_SIZE(gpio_charger_properties);