Commit 02a8e769 authored by Russell King's avatar Russell King Committed by Russell King

[ARM] pxa: corgibl_limit_intensity build errors

If CONFIG_BACKLIGHT_CORGI is not selected, then corgibl_limit_intensity()
is not present.  However, both corgi_pm.c and sharp_pm.c reference this
symbol, resulting in a link error.

Wrap the references with the relevant ifdefs, and avoid the resulting
NULL pointer dereference by making the code in sharpsl_pm.c also
conditional on the config symbol.
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent b8291ad0
...@@ -157,6 +157,7 @@ static void sharpsl_battery_thread(struct work_struct *private_) ...@@ -157,6 +157,7 @@ static void sharpsl_battery_thread(struct work_struct *private_)
dev_dbg(sharpsl_pm.dev, "Battery: voltage: %d, status: %d, percentage: %d, time: %ld\n", voltage, dev_dbg(sharpsl_pm.dev, "Battery: voltage: %d, status: %d, percentage: %d, time: %ld\n", voltage,
sharpsl_pm.battstat.mainbat_status, sharpsl_pm.battstat.mainbat_percent, jiffies); sharpsl_pm.battstat.mainbat_status, sharpsl_pm.battstat.mainbat_percent, jiffies);
#ifdef CONFIG_BACKLIGHT_CORGI
/* If battery is low. limit backlight intensity to save power. */ /* If battery is low. limit backlight intensity to save power. */
if ((sharpsl_pm.battstat.ac_status != APM_AC_ONLINE) if ((sharpsl_pm.battstat.ac_status != APM_AC_ONLINE)
&& ((sharpsl_pm.battstat.mainbat_status == APM_BATTERY_STATUS_LOW) || && ((sharpsl_pm.battstat.mainbat_status == APM_BATTERY_STATUS_LOW) ||
...@@ -169,6 +170,7 @@ static void sharpsl_battery_thread(struct work_struct *private_) ...@@ -169,6 +170,7 @@ static void sharpsl_battery_thread(struct work_struct *private_)
sharpsl_pm.machinfo->backlight_limit(0); sharpsl_pm.machinfo->backlight_limit(0);
sharpsl_pm.flags &= ~SHARPSL_BL_LIMIT; sharpsl_pm.flags &= ~SHARPSL_BL_LIMIT;
} }
#endif
/* Suspend if critical battery level */ /* Suspend if critical battery level */
if ((sharpsl_pm.battstat.ac_status != APM_AC_ONLINE) if ((sharpsl_pm.battstat.ac_status != APM_AC_ONLINE)
......
...@@ -204,7 +204,9 @@ static struct sharpsl_charger_machinfo corgi_pm_machinfo = { ...@@ -204,7 +204,9 @@ static struct sharpsl_charger_machinfo corgi_pm_machinfo = {
.read_devdata = corgipm_read_devdata, .read_devdata = corgipm_read_devdata,
.charger_wakeup = corgi_charger_wakeup, .charger_wakeup = corgi_charger_wakeup,
.should_wakeup = corgi_should_wakeup, .should_wakeup = corgi_should_wakeup,
#ifdef CONFIG_BACKLIGHT_CORGI
.backlight_limit = corgibl_limit_intensity, .backlight_limit = corgibl_limit_intensity,
#endif
.charge_on_volt = SHARPSL_CHARGE_ON_VOLT, .charge_on_volt = SHARPSL_CHARGE_ON_VOLT,
.charge_on_temp = SHARPSL_CHARGE_ON_TEMP, .charge_on_temp = SHARPSL_CHARGE_ON_TEMP,
.charge_acin_high = SHARPSL_CHARGE_ON_ACIN_HIGH, .charge_acin_high = SHARPSL_CHARGE_ON_ACIN_HIGH,
......
...@@ -207,7 +207,9 @@ struct sharpsl_charger_machinfo spitz_pm_machinfo = { ...@@ -207,7 +207,9 @@ struct sharpsl_charger_machinfo spitz_pm_machinfo = {
.read_devdata = spitzpm_read_devdata, .read_devdata = spitzpm_read_devdata,
.charger_wakeup = spitz_charger_wakeup, .charger_wakeup = spitz_charger_wakeup,
.should_wakeup = spitz_should_wakeup, .should_wakeup = spitz_should_wakeup,
#ifdef CONFIG_BACKLIGHT_CORGI
.backlight_limit = corgibl_limit_intensity, .backlight_limit = corgibl_limit_intensity,
#endif
.charge_on_volt = SHARPSL_CHARGE_ON_VOLT, .charge_on_volt = SHARPSL_CHARGE_ON_VOLT,
.charge_on_temp = SHARPSL_CHARGE_ON_TEMP, .charge_on_temp = SHARPSL_CHARGE_ON_TEMP,
.charge_acin_high = SHARPSL_CHARGE_ON_ACIN_HIGH, .charge_acin_high = SHARPSL_CHARGE_ON_ACIN_HIGH,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment