Loading drivers/leds/leds-qpnp.c +21 −5 Original line number Diff line number Diff line Loading @@ -548,6 +548,7 @@ struct qpnp_led_data { }; static int num_kpbl_leds_on; static DEFINE_MUTEX(flash_lock); static int qpnp_led_masked_write(struct qpnp_led_data *led, u16 addr, u8 mask, u8 val) Loading Loading @@ -1706,6 +1707,9 @@ static void __qpnp_led_work(struct qpnp_led_data *led, { int rc; if (led->id == QPNP_ID_FLASH1_LED0 || led->id == QPNP_ID_FLASH1_LED1) mutex_lock(&flash_lock); else mutex_lock(&led->lock); switch (led->id) { Loading Loading @@ -1753,6 +1757,9 @@ static void __qpnp_led_work(struct qpnp_led_data *led, dev_err(&led->spmi_dev->dev, "Invalid LED(%d)\n", led->id); break; } if (led->id == QPNP_ID_FLASH1_LED0 || led->id == QPNP_ID_FLASH1_LED1) mutex_unlock(&flash_lock); else mutex_unlock(&led->lock); } Loading Loading @@ -3784,6 +3791,8 @@ static int qpnp_leds_probe(struct spmi_device *spmi) goto fail_id_check; } if (led->id != QPNP_ID_FLASH1_LED0 && led->id != QPNP_ID_FLASH1_LED1) mutex_init(&led->lock); INIT_WORK(&led->work, qpnp_led_work); Loading Loading @@ -3879,6 +3888,8 @@ static int qpnp_leds_probe(struct spmi_device *spmi) fail_id_check: for (i = 0; i < parsed_leds; i++) { if (led_array[i].id != QPNP_ID_FLASH1_LED0 && led_array[i].id != QPNP_ID_FLASH1_LED1) mutex_destroy(&led_array[i].lock); led_classdev_unregister(&led_array[i].cdev); } Loading @@ -3893,7 +3904,12 @@ static int qpnp_leds_remove(struct spmi_device *spmi) for (i = 0; i < parsed_leds; i++) { cancel_work_sync(&led_array[i].work); if (led_array[i].id != QPNP_ID_FLASH1_LED0 && led_array[i].id != QPNP_ID_FLASH1_LED1) mutex_destroy(&led_array[i].lock); else if (led_array[i].id == QPNP_ID_FLASH1_LED0) mutex_destroy(&flash_lock); led_classdev_unregister(&led_array[i].cdev); switch (led_array[i].id) { case QPNP_ID_WLED: Loading Loading
drivers/leds/leds-qpnp.c +21 −5 Original line number Diff line number Diff line Loading @@ -548,6 +548,7 @@ struct qpnp_led_data { }; static int num_kpbl_leds_on; static DEFINE_MUTEX(flash_lock); static int qpnp_led_masked_write(struct qpnp_led_data *led, u16 addr, u8 mask, u8 val) Loading Loading @@ -1706,6 +1707,9 @@ static void __qpnp_led_work(struct qpnp_led_data *led, { int rc; if (led->id == QPNP_ID_FLASH1_LED0 || led->id == QPNP_ID_FLASH1_LED1) mutex_lock(&flash_lock); else mutex_lock(&led->lock); switch (led->id) { Loading Loading @@ -1753,6 +1757,9 @@ static void __qpnp_led_work(struct qpnp_led_data *led, dev_err(&led->spmi_dev->dev, "Invalid LED(%d)\n", led->id); break; } if (led->id == QPNP_ID_FLASH1_LED0 || led->id == QPNP_ID_FLASH1_LED1) mutex_unlock(&flash_lock); else mutex_unlock(&led->lock); } Loading Loading @@ -3784,6 +3791,8 @@ static int qpnp_leds_probe(struct spmi_device *spmi) goto fail_id_check; } if (led->id != QPNP_ID_FLASH1_LED0 && led->id != QPNP_ID_FLASH1_LED1) mutex_init(&led->lock); INIT_WORK(&led->work, qpnp_led_work); Loading Loading @@ -3879,6 +3888,8 @@ static int qpnp_leds_probe(struct spmi_device *spmi) fail_id_check: for (i = 0; i < parsed_leds; i++) { if (led_array[i].id != QPNP_ID_FLASH1_LED0 && led_array[i].id != QPNP_ID_FLASH1_LED1) mutex_destroy(&led_array[i].lock); led_classdev_unregister(&led_array[i].cdev); } Loading @@ -3893,7 +3904,12 @@ static int qpnp_leds_remove(struct spmi_device *spmi) for (i = 0; i < parsed_leds; i++) { cancel_work_sync(&led_array[i].work); if (led_array[i].id != QPNP_ID_FLASH1_LED0 && led_array[i].id != QPNP_ID_FLASH1_LED1) mutex_destroy(&led_array[i].lock); else if (led_array[i].id == QPNP_ID_FLASH1_LED0) mutex_destroy(&flash_lock); led_classdev_unregister(&led_array[i].cdev); switch (led_array[i].id) { case QPNP_ID_WLED: Loading