Commit 30b27c73 authored by Ricardo Rivera-Matos's avatar Ricardo Rivera-Matos Committed by Anas Nashif
Browse files

regulator: cp9314: Cleans sleep related preprocesor directives



Removes conditional calling k_busy_wait() on single threaded
systems and uses k_sleep for both single and multi threaded
systems.

Commit e375d82 ("kernel: Implement k_sleep for Single Thread")
eliminated the need to call k_busy_wait() on single threaded
systems in place of k_sleep.

Signed-off-by: default avatarRicardo Rivera-Matos <rriveram@opensource.cirrus.com>
parent 7afc5932
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -338,11 +338,7 @@ static int cp9314_do_soft_reset(const struct device *dev)
		return ret;
	}

#ifdef CONFIG_MULTITHREADING
	k_msleep(CP9314_SOFT_RESET_DELAY_MSEC);
#else
	k_busy_wait(CP9314_SOFT_RESET_DELAY_MSEC * USEC_PER_MSEC);
#endif

	return 0;
}
@@ -421,11 +417,7 @@ static int regulator_cp9314_init(const struct device *dev)
			return ret;
		}

#ifdef CONFIG_MULTITHREADING
		k_usleep(CP9314_EN_DEBOUNCE_USEC);
#else
		k_busy_wait(CP9314_EN_DEBOUNCE_USEC);
#endif
	}

	ret = cp9314_do_soft_reset(dev);