Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

media: i2c: os05b10: Few minor improvements

Return 0 from disable_streams, use div_u64() instead of do_div(), use
dev_dbg() for a debug message and move loop variable definition into the
loop itself.

Signed-off-by: Himanshu Bhavani <himanshu.bhavani@siliconsignals.io>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>

authored by

Himanshu Bhavani and committed by
Hans Verkuil
f422140e df60764e

+7 -12
+7 -12
drivers/media/i2c/os05b10.c
··· 708 708 709 709 pm_runtime_put(os05b10->dev); 710 710 711 - return ret; 711 + return 0; 712 712 } 713 713 714 714 static int os05b10_init_state(struct v4l2_subdev *sd, ··· 884 884 const struct os05b10_mode *mode) 885 885 { 886 886 u64 link_freq = link_frequencies[os05b10->link_freq_index]; 887 - const unsigned int lanes = os05b10->data_lanes; 888 - u64 numerator = link_freq * 2 * lanes; 889 - unsigned int bpp = mode->bpp; 887 + u64 pixel_rate = div_u64(link_freq * 2 * os05b10->data_lanes, mode->bpp); 890 888 891 - do_div(numerator, bpp); 889 + dev_dbg(os05b10->dev, 890 + "link_freq=%llu bpp=%u lanes=%u pixel_rate=%llu\n", 891 + link_freq, mode->bpp, os05b10->data_lanes, pixel_rate); 892 892 893 - dev_info(os05b10->dev, 894 - "link_freq=%llu bpp=%u lanes=%u pixel_rate=%llu\n", 895 - link_freq, bpp, lanes, numerator); 896 - 897 - return numerator; 893 + return pixel_rate; 898 894 } 899 895 900 896 static int os05b10_init_controls(struct os05b10 *os05b10) ··· 973 977 { 974 978 struct os05b10 *os05b10; 975 979 unsigned int xclk_freq; 976 - unsigned int i; 977 980 int ret; 978 981 979 982 os05b10 = devm_kzalloc(&client->dev, sizeof(*os05b10), GFP_KERNEL); ··· 1000 1005 "xclk frequency not supported: %d Hz\n", 1001 1006 xclk_freq); 1002 1007 1003 - for (i = 0; i < ARRAY_SIZE(os05b10_supply_name); i++) 1008 + for (unsigned int i = 0; i < ARRAY_SIZE(os05b10_supply_name); i++) 1004 1009 os05b10->supplies[i].supply = os05b10_supply_name[i]; 1005 1010 1006 1011 ret = devm_regulator_bulk_get(os05b10->dev,