treewide: use linux/time.h for time conversion defines
Now that we have time conversion defines from in time.h there is no need for each driver to define their own version. Signed-off-by: Igor Prusov <ivprusov@salutedevices.com> Reviewed-by: Svyatoslav Ryhel <clamor95@gmail.com> # tegra Reviewed-by: Eugen Hristev <eugen.hristev@collabora.com> #at91 Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org> #qcom geni Reviewed-by: Stefan Bosch <stefan_b@posteo.net> #nanopi2 Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
#include <linux/err.h>
|
||||
#include <linux/iopoll.h>
|
||||
#include <linux/ioport.h>
|
||||
#include <linux/time.h>
|
||||
|
||||
/* FMC2 Controller Registers */
|
||||
#define FMC2_BCR1 0x0
|
||||
@@ -90,8 +91,6 @@
|
||||
#define FMC2_BTR_DATLAT_MAX 0xf
|
||||
#define FMC2_PCSCNTR_CSCOUNT_MAX 0xff
|
||||
|
||||
#define FMC2_NSEC_PER_SEC 1000000000L
|
||||
|
||||
enum stm32_fmc2_ebi_bank {
|
||||
FMC2_EBI1 = 0,
|
||||
FMC2_EBI2,
|
||||
@@ -279,7 +278,7 @@ static u32 stm32_fmc2_ebi_ns_to_clock_cycles(struct stm32_fmc2_ebi *ebi,
|
||||
int cs, u32 setup)
|
||||
{
|
||||
unsigned long hclk = clk_get_rate(&ebi->clk);
|
||||
unsigned long hclkp = FMC2_NSEC_PER_SEC / (hclk / 1000);
|
||||
unsigned long hclkp = NSEC_PER_SEC / (hclk / 1000);
|
||||
|
||||
return DIV_ROUND_UP(setup * 1000, hclkp);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user