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

clk: qcom: reset: Commonize the de/assert functions

They do the same thing, except the last argument of the last function
call differs. Commonize them.

Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20240105-topic-venus_reset-v2-2-c37eba13b5ce@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>

authored by

Konrad Dybcio and committed by
Bjorn Andersson
eda40d9c 316861f3

+9 -13
+9 -13
drivers/clk/qcom/reset.c
··· 22 22 return 0; 23 23 } 24 24 25 - static int 26 - qcom_reset_assert(struct reset_controller_dev *rcdev, unsigned long id) 25 + static int qcom_reset_set_assert(struct reset_controller_dev *rcdev, 26 + unsigned long id, bool assert) 27 27 { 28 28 struct qcom_reset_controller *rst; 29 29 const struct qcom_reset_map *map; ··· 33 33 map = &rst->reset_map[id]; 34 34 mask = map->bitmask ? map->bitmask : BIT(map->bit); 35 35 36 - return regmap_update_bits(rst->regmap, map->reg, mask, mask); 36 + return regmap_update_bits(rst->regmap, map->reg, mask, assert ? mask : 0); 37 37 } 38 38 39 - static int 40 - qcom_reset_deassert(struct reset_controller_dev *rcdev, unsigned long id) 39 + static int qcom_reset_assert(struct reset_controller_dev *rcdev, unsigned long id) 41 40 { 42 - struct qcom_reset_controller *rst; 43 - const struct qcom_reset_map *map; 44 - u32 mask; 41 + return qcom_reset_set_assert(rcdev, id, true); 42 + } 45 43 46 - rst = to_qcom_reset_controller(rcdev); 47 - map = &rst->reset_map[id]; 48 - mask = map->bitmask ? map->bitmask : BIT(map->bit); 49 - 50 - return regmap_update_bits(rst->regmap, map->reg, mask, 0); 44 + static int qcom_reset_deassert(struct reset_controller_dev *rcdev, unsigned long id) 45 + { 46 + return qcom_reset_set_assert(rcdev, id, false); 51 47 } 52 48 53 49 const struct reset_control_ops qcom_reset_ops = {