fix ec_read using wrong #define's in sonypi driver.
Subsystems (2)
PATCH 1/1 fix ec_read using wrong #define's in sonypi driver.
This patch will make the driver use the correct #define's when querying battery charge.
This error sneaked into 2.4.20-pre1,
and have been present in 2.5 since 2.5.49.
The patch is for 2.4.21-pre6, but will also apply to 2.5.66 with an offset of 1 line.
Please apply.
Daniel K.
drivers/char/sonypi.c +3 -3
@@ -531,7 +531,7 @@ ret = -EFAULT ;break ;case SONYPI_IOCGBAT1REM : -if (ec_read16 (SONYPI_BAT1_FULL , &val16)) { +if (ec_read16 (SONYPI_BAT1_LEFT , &val16)) { ret = -EIO ;break ; }
@@ -539,7 +539,7 @@ ret = -EFAULT ;break ;case SONYPI_IOCGBAT2CAP : -if (ec_read16 (SONYPI_BAT1_FULL , &val16)) { +if (ec_read16 (SONYPI_BAT2_FULL , &val16)) { ret = -EIO ;break ; }
@@ -547,7 +547,7 @@ ret = -EFAULT ;break ;case SONYPI_IOCGBAT2REM : -if (ec_read16 (SONYPI_BAT1_FULL , &val16)) { +if (ec_read16 (SONYPI_BAT2_LEFT , &val16)) { ret = -EIO ;break ; }
Quoted 5 lines · Daniel K.
This patch will make the driver use the correct #define's when querying battery charge.
This error sneaked into 2.4.20-pre1,
and have been present in 2.5 since 2.5.49.
Damn, a copy and paste error and nobody noticed until now.
Thanks Daniel!
Linus, Marcelo, please apply it.
Stelian.
drivers/char/sonypi.c +3 -3
@@ -531,7 +531,7 @@ ret = -EFAULT ;break ;case SONYPI_IOCGBAT1REM : -if (ec_read16 (SONYPI_BAT1_FULL , &val16)) { +if (ec_read16 (SONYPI_BAT1_LEFT , &val16)) { ret = -EIO ;break ; }
@@ -539,7 +539,7 @@ ret = -EFAULT ;break ;case SONYPI_IOCGBAT2CAP : -if (ec_read16 (SONYPI_BAT1_FULL , &val16)) { +if (ec_read16 (SONYPI_BAT2_FULL , &val16)) { ret = -EIO ;break ; }
@@ -547,7 +547,7 @@ ret = -EFAULT ;break ;case SONYPI_IOCGBAT2REM : -if (ec_read16 (SONYPI_BAT1_FULL , &val16)) { +if (ec_read16 (SONYPI_BAT2_LEFT , &val16)) { ret = -EIO ;break ; }
Signature · 1 line
Stelian Pop <[email protected]>