summaryrefslogtreecommitdiffstats
path: root/drivers/media/i2c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2023-12-13 12:23:07 +0100
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2023-12-14 12:40:13 +0100
commit02d4e62ae2452c83e4a3e279b8e4cb4dcbad4b31 (patch)
tree69f1d10a6a90f4848ce72563f3d0ea31b147f545 /drivers/media/i2c
parent80c2b40a51393add616a1fd186a1cc10bd676a3f (diff)
downloadlinux-stable-02d4e62ae2452c83e4a3e279b8e4cb4dcbad4b31.tar.gz
linux-stable-02d4e62ae2452c83e4a3e279b8e4cb4dcbad4b31.tar.bz2
linux-stable-02d4e62ae2452c83e4a3e279b8e4cb4dcbad4b31.zip
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 <sakari.ailus@linux.intel.com> Fixes: 24d756e914fc ("media: i2c: Add driver for onsemi MT9M114 camera sensor") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'drivers/media/i2c')
-rw-r--r--drivers/media/i2c/mt9m114.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/i2c/mt9m114.c b/drivers/media/i2c/mt9m114.c
index 427eae13ce26..5f0b0ad8f885 100644
--- a/drivers/media/i2c/mt9m114.c
+++ b/drivers/media/i2c/mt9m114.c
@@ -2132,7 +2132,7 @@ static int mt9m114_power_on(struct mt9m114 *sensor)
duration = DIV_ROUND_UP(2 * 50 * 1000000, freq);
gpiod_set_value(sensor->reset, 1);
- udelay(duration);
+ fsleep(duration);
gpiod_set_value(sensor->reset, 0);
} else {
/*