From: <bal...@us...> - 2007-02-27 02:30:18
|
Revision: 876 http://svn.sourceforge.net/hackndev/?rev=876&view=rev Author: balrog-kun Date: 2007-02-26 18:30:14 -0800 (Mon, 26 Feb 2007) Log Message: ----------- l4p: battchargemon build error and warning fixes. Modified Paths: -------------- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/Kconfig linux4palm/linux/trunk/drivers/input/serio/serio_raw.c linux4palm/linux/trunk/drivers/misc/battchargemon.c Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/Kconfig =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/Kconfig 2007-02-27 00:48:43 UTC (rev 875) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/Kconfig 2007-02-27 02:30:14 UTC (rev 876) @@ -5,7 +5,7 @@ This enables support for Palm TX handheld. Note: this is in a very early stage. -config PALMTX_AC97 +config PALMTX_AC97 tristate "Palm TX AC97 driver" depends on MACH_XSCALE_PALMTX default y if MACH_XSCALE_PALMTX @@ -14,7 +14,7 @@ Enable support for WM9712 touchscreen and battery for the Palm TX PDA -config PALMTX_LCD +config PALMTX_LCD tristate "Palm TX LCD driver" select LCD_CLASS_DEVICE depends on MACH_XSCALE_PALMTX @@ -23,14 +23,14 @@ LCD driver for Palm TX. Enable support for switching the Palm TX LCD on/off -config PALMTX_PCMCIA +config PALMTX_PCMCIA tristate "Palm TX PCMCIA driver" depends on MACH_XSCALE_PALMTX default y if MACH_XSCALE_PALMTX help PCMCIA driver for Palm TX -config PALMTX_DEBUG +config PALMTX_DEBUG bool "Debug output for Palm TX" depends on MACH_XSCALE_PALMTX default n Modified: linux4palm/linux/trunk/drivers/input/serio/serio_raw.c =================================================================== --- linux4palm/linux/trunk/drivers/input/serio/serio_raw.c 2007-02-27 00:48:43 UTC (rev 875) +++ linux4palm/linux/trunk/drivers/input/serio/serio_raw.c 2007-02-27 02:30:14 UTC (rev 876) @@ -160,7 +160,7 @@ { struct serio_raw_list *list = file->private_data; struct serio_raw *serio_raw = list->serio_raw; - char c; + char c = 0; ssize_t retval = 0; if (!serio_raw->serio) Modified: linux4palm/linux/trunk/drivers/misc/battchargemon.c =================================================================== --- linux4palm/linux/trunk/drivers/misc/battchargemon.c 2007-02-27 00:48:43 UTC (rev 875) +++ linux4palm/linux/trunk/drivers/misc/battchargemon.c 2007-02-27 02:30:14 UTC (rev 876) @@ -12,7 +12,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/init.h> @@ -95,13 +94,14 @@ /**** class registration ****/ #define create_entry_conditional(_name) \ - if(bat->_name != -1) \ - class_device_create_file(&bat->class_dev, &battery_class_device_attr_##_name); + (bat->_name == -1 ? 0 : \ + class_device_create_file(&bat->class_dev, \ + &battery_class_device_attr_##_name)) int battery_class_register(struct battery *bat) { int rc = 0; - + // init list bat->attached_chargers.next = &bat->attached_chargers; bat->attached_chargers.prev = &bat->attached_chargers; @@ -114,18 +114,27 @@ goto out; if(bat->id) - class_device_create_file(&bat->class_dev, &battery_class_device_attr_id); - create_entry_conditional(min_voltage); - create_entry_conditional(max_voltage); - create_entry_conditional(v_current); - create_entry_conditional(temp); + rc |= class_device_create_file(&bat->class_dev, + &battery_class_device_attr_id); + rc |= create_entry_conditional(min_voltage); + rc |= create_entry_conditional(max_voltage); + rc |= create_entry_conditional(v_current); + rc |= create_entry_conditional(temp); if(bat->get_voltage) { - class_device_create_file(&bat->class_dev, &battery_class_device_attr_voltage); + rc |= class_device_create_file(&bat->class_dev, + &battery_class_device_attr_voltage); if((bat->min_voltage != -1) && (bat->max_voltage != -1)) { - class_device_create_file(&bat->class_dev, &battery_class_device_attr_charge); + rc |= class_device_create_file(&bat->class_dev, + &battery_class_device_attr_charge); } } + if(rc) { + printk(KERN_ERR "battchargemon: " + "creation of device entries failed\n"); + class_device_unregister(&bat->class_dev); + } + out: return rc; } @@ -148,9 +157,17 @@ goto out; if(cha->id) - class_device_create_file(&cha->class_dev, &charger_class_device_attr_id); - class_device_create_file(&cha->class_dev, &charger_class_device_attr_status); - + rc |= class_device_create_file(&cha->class_dev, + &charger_class_device_attr_id); + rc |= class_device_create_file(&cha->class_dev, + &charger_class_device_attr_status); + + if(rc) { + printk(KERN_ERR "charger: " + "creation of device entries failed\n"); + class_device_unregister(&cha->class_dev); + } + out: return rc; } @@ -188,7 +205,11 @@ sysfs_remove_link(&batt->class_dev.kobj, "charger"); list_for_each_entry(cha, &batt->attached_chargers, list) { if(cha->get_status(cha)) { - sysfs_create_link(&batt->class_dev.kobj, &cha->class_dev.kobj, "charger"); + if (sysfs_create_link(&batt->class_dev.kobj, + &cha->class_dev.kobj, + "charger")) + printk(KERN_ERR "charger: " + "sysfs link failed\n"); return; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |