From: Andres Salomon Date: Fri, 2 May 2008 20:41:59 +0000 (-0700) Subject: power_supply: bump EC version check that we refuse to run with in olpc_battery X-Git-Tag: v2.6.27-rc2~110^2~4 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=484d6d50cca3941db6e063113d124333aed0abc0;p=linux-2.6 power_supply: bump EC version check that we refuse to run with in olpc_battery Refuse to run with an EC < 0x44. We're playing it safe, and this is a pretty old EC version. Also, add a comment about why we're checking the EC version. Signed-off-by: Andres Salomon Cc: David Woodhouse Signed-off-by: Andrew Morton Signed-off-by: Anton Vorontsov --- diff --git a/drivers/power/olpc_battery.c b/drivers/power/olpc_battery.c index d5fe6f0c9d..c8b596a7fc 100644 --- a/drivers/power/olpc_battery.c +++ b/drivers/power/olpc_battery.c @@ -389,8 +389,14 @@ static int __init olpc_bat_init(void) if (!olpc_platform_info.ecver) return -ENXIO; - if (olpc_platform_info.ecver < 0x43) { - printk(KERN_NOTICE "OLPC EC version 0x%02x too old for battery driver.\n", olpc_platform_info.ecver); + + /* + * We've seen a number of EC protocol changes; this driver requires + * the latest EC protocol, supported by 0x44 and above. + */ + if (olpc_platform_info.ecver < 0x44) { + printk(KERN_NOTICE "OLPC EC version 0x%02x too old for " + "battery driver.\n", olpc_platform_info.ecver); return -ENXIO; }