From 42bcb67fbc982efae2e77c1c3662c12f6fbec5e6 Mon Sep 17 00:00:00 2001 From: Chun Zhang Date: Wed, 13 Jan 2016 18:08:46 -0800 Subject: [PATCH] leds: leds-qpnp-flash: set open circuit fault flag when detected The open fault status flag depends on fault status register. However, the register value is reset when LED module is disabled. In this case, use OR logic to make sure the value is always set even if module gets disabled. Change-Id: If89f8fca25abc79d9d200d59031b8654f812105d Signed-off-by: Chun Zhang --- drivers/leds/leds-qpnp-flash.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/leds/leds-qpnp-flash.c b/drivers/leds/leds-qpnp-flash.c index 3eb794b30b4b..77c7bb89189f 100644 --- a/drivers/leds/leds-qpnp-flash.c +++ b/drivers/leds/leds-qpnp-flash.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2014-2015, The Linux Foundation. All rights reserved. +/* Copyright (c) 2014-2016, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -1644,7 +1644,7 @@ turn_off: goto exit_flash_led_work; } - led->open_fault = (temp & FLASH_LED_OPEN_FAULT_DETECTED); + led->open_fault |= (val & FLASH_LED_OPEN_FAULT_DETECTED); } rc = qpnp_led_masked_write(led,