Skip to content

Commit e78f40c

Browse files
author
philippe baetens
committed
implement fsleep. change non-return function to void
1 parent ffb911a commit e78f40c

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

drivers/media/i2c/mira220.c

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,9 +1119,8 @@ static int mira220_power_on(struct device *dev)
11191119
dev_err(&client->dev, "%s: failed to enable clock\n", __func__);
11201120
goto clk_off;
11211121
}
1122-
usleep_range(MIRA220_XCLR_MIN_DELAY_US,
1123-
MIRA220_XCLR_MIN_DELAY_US + MIRA220_XCLR_DELAY_RANGE_US);
1124-
1122+
fsleep(MIRA220_XCLR_MIN_DELAY_US);
1123+
11251124
return 0;
11261125

11271126
clk_off:
@@ -1196,7 +1195,7 @@ static int mira220_write_stop_streaming_regs(struct mira220 *mira220)
11961195
return ret;
11971196
}
11981197

1199-
usleep_range(40000, 40000 + 10000);
1198+
fsleep(40000);
12001199

12011200
return ret;
12021201
}
@@ -1663,25 +1662,23 @@ static int mira220_get_regulators(struct mira220 *mira220)
16631662
}
16641663

16651664
/* OTP power on */
1666-
static int mira220_otp_power_on(struct mira220 *mira220)
1665+
static void mira220_otp_power_on(struct mira220 *mira220)
16671666
{
16681667
int ret;
16691668

16701669
ret = cci_write(mira220->regmap, MIRA220_OTP_CMD_REG,
16711670
MIRA220_OTP_CMD_UP, NULL);
16721671

1673-
return ret;
16741672
}
16751673

16761674
/* OTP power off */
1677-
static int mira220_otp_power_off(struct mira220 *mira220)
1675+
static void mira220_otp_power_off(struct mira220 *mira220)
16781676
{
16791677
int ret;
16801678

16811679
ret = cci_write(mira220->regmap, MIRA220_OTP_CMD_REG,
16821680
MIRA220_OTP_CMD_DOWN, NULL);
16831681

1684-
return ret;
16851682
}
16861683

16871684
/* OTP power on */
@@ -1709,7 +1706,7 @@ static int mira220_identify_module(struct mira220 *mira220)
17091706

17101707
mira220_otp_power_on(mira220);
17111708

1712-
usleep_range(100, 110);
1709+
fsleep(100);
17131710

17141711
ret = mira220_otp_read(mira220, 0x0d, 0, &val);
17151712
dev_err(&client->dev, "Read OTP add 0x0d with val %x\n", val);
@@ -1806,12 +1803,12 @@ static int mira220_init_controls(struct mira220 *mira220)
18061803
V4L2_CID_HFLIP, 0, 1, 1, 0);
18071804
if (mira220->hflip)
18081805
mira220->hflip->flags |= V4L2_CTRL_FLAG_MODIFY_LAYOUT;
1809-
1806+
18101807
mira220->vflip = v4l2_ctrl_new_std(ctrl_hdlr, &mira220_ctrl_ops,
18111808
V4L2_CID_VFLIP, 0, 1, 1, 0);
18121809
if (mira220->vflip)
18131810
mira220->vflip->flags |= V4L2_CTRL_FLAG_MODIFY_LAYOUT;
1814-
1811+
18151812
v4l2_ctrl_new_std_menu_items(ctrl_hdlr, &mira220_ctrl_ops,
18161813
V4L2_CID_TEST_PATTERN,
18171814
ARRAY_SIZE(mira220_test_pattern_menu) - 1,
@@ -1886,7 +1883,7 @@ static int mira220_probe(struct i2c_client *client)
18861883
return ret;
18871884
}
18881885

1889-
usleep_range(10000, 10000 + 100);
1886+
fsleep(10000);
18901887

18911888
// The sensor must be powered for mira220_identify_module()
18921889
// to be able to read the CHIP_ID register
@@ -1895,7 +1892,7 @@ static int mira220_probe(struct i2c_client *client)
18951892
if (ret)
18961893
return ret;
18971894

1898-
usleep_range(100000, 100000 + 1000);
1895+
fsleep(100000);
18991896

19001897
ret = mira220_identify_module(mira220);
19011898
if (ret)

0 commit comments

Comments
 (0)