Skip to content

Commit 02d4e62

Browse files
arndbHans Verkuil
authored andcommitted
media: i2c: mt9m114: use fsleep() in place of udelay()
With clang-16, building without COMMON_CLK triggers a range check on udelay() because of a constant division-by-zero calculation: ld.lld: error: undefined symbol: __bad_udelay >>> referenced by mt9m114.c >>> drivers/media/i2c/mt9m114.o:(mt9m114_power_on) in archive vmlinux.a In this configuration, the driver already fails to probe, before this function gets called, so it's enough to suppress the assertion. Do this by using fsleep(), which turns long delays into sleep() calls in place of the link failure. This is probably a good idea regardless to avoid overly long dynamic udelay() calls on a slow clock. Cc: Sakari Ailus <[email protected]> Fixes: 24d756e ("media: i2c: Add driver for onsemi MT9M114 camera sensor") Signed-off-by: Arnd Bergmann <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Reviewed-by: Tomi Valkeinen <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
1 parent 80c2b40 commit 02d4e62

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/media/i2c/mt9m114.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2132,7 +2132,7 @@ static int mt9m114_power_on(struct mt9m114 *sensor)
21322132
duration = DIV_ROUND_UP(2 * 50 * 1000000, freq);
21332133

21342134
gpiod_set_value(sensor->reset, 1);
2135-
udelay(duration);
2135+
fsleep(duration);
21362136
gpiod_set_value(sensor->reset, 0);
21372137
} else {
21382138
/*

0 commit comments

Comments
 (0)