leds: aw2013_led: fix issue led->vdd/vcc is NULL

kernel panic from as the led->vdd passed from the aw2013_power_on is NULL
hence panic. vdd/vcc instance are only assigned to red led, need to use the
led instance in pdata to make sure the vdd/vcc instances are valid.

Change-Id: I908feffa52194b5f4502200bf13e911e0ddbb933
Signed-off-by: Mao Li <maol@codeaurora.org>
This commit is contained in:
Mao Li 2015-02-09 10:03:56 +08:00
parent b0e84d7645
commit bcc30de793

View file

@ -208,7 +208,7 @@ static void aw2013_brightness_work(struct work_struct *work)
/* enable regulators if they are disabled */
if (!led->pdata->led->poweron) {
if (aw2013_power_on(led, true)) {
if (aw2013_power_on(led->pdata->led, true)) {
dev_err(&led->pdata->led->client->dev, "power on failed");
return;
}
@ -241,7 +241,7 @@ static void aw2013_led_blink_set(struct aw2013_led *led, unsigned long blinking)
/* enable regulators if they are disabled */
if (!led->pdata->led->poweron) {
if (aw2013_power_on(led, true)) {
if (aw2013_power_on(led->pdata->led, true)) {
dev_err(&led->pdata->led->client->dev, "power on failed");
return;
}