Skip to content

Commit

Permalink
power_supply: bump EC version check that we refuse to run with in olp…
Browse files Browse the repository at this point in the history
…c_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 <dilinger@debian.org>
Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
  • Loading branch information
Andres Salomon authored and Anton Vorontsov committed May 4, 2008
1 parent b2bd8a3 commit 484d6d5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions drivers/power/olpc_battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 484d6d5

Please sign in to comment.