Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4397fc59 authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "leds: qti-tri-led: Cancel set_brightness_work before setting breath"

parents f81b5554 c45224b0
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
/* Copyright (c) 2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2018-2019, 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
@@ -378,6 +378,8 @@ static ssize_t breath_store(struct device *dev, struct device_attribute *attr,
	if (rc < 0)
		return rc;

	cancel_work_sync(&led_cdev->set_brightness_work);

	mutex_lock(&led->lock);
	if (led->breathing == breath)
		goto unlock;