Skip to content

Commit

Permalink
clk: qcom: reset: Use the correct type of sleep/delay based on length
Browse files Browse the repository at this point in the history
[ Upstream commit 181b66e ]

Use the fsleep() helper that (based on the length of the delay, see: [1])
chooses the correct sleep/delay functions.

[1] https://www.kernel.org/doc/Documentation/timers/timers-howto.txt

Fixes: 2cb8a39 ("clk: qcom: reset: Allow specifying custom reset delay")
Signed-off-by: Konrad Dybcio <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Bjorn Andersson <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
  • Loading branch information
konradybcio authored and gregkh committed Sep 13, 2023
1 parent e487f60 commit 96c0cde
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/clk/qcom/reset.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ static int qcom_reset(struct reset_controller_dev *rcdev, unsigned long id)
struct qcom_reset_controller *rst = to_qcom_reset_controller(rcdev);

rcdev->ops->assert(rcdev, id);
udelay(rst->reset_map[id].udelay ?: 1); /* use 1 us as default */
fsleep(rst->reset_map[id].udelay ?: 1); /* use 1 us as default */

rcdev->ops->deassert(rcdev, id);
return 0;
}
Expand Down

0 comments on commit 96c0cde

Please sign in to comment.