Skip to content

Commit ae8ca03

Browse files
Fei Shaobebarino
authored andcommitted
clk: mediatek: reset: Return regmap's error code
device_node_to_regmap() can return different errors, and it's better practice to pass them to callers. Clean up the hardcoded -EINVAL and use PTR_ERR(regmap) instead. Signed-off-by: Fei Shao <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
1 parent 8400291 commit ae8ca03

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/clk/mediatek/reset.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ int mtk_register_reset_controller(struct device_node *np,
138138
regmap = device_node_to_regmap(np);
139139
if (IS_ERR(regmap)) {
140140
pr_err("Cannot find regmap for %pOF: %pe\n", np, regmap);
141-
return -EINVAL;
141+
return PTR_ERR(regmap);
142142
}
143143

144144
data = kzalloc(sizeof(*data), GFP_KERNEL);
@@ -198,7 +198,7 @@ int mtk_register_reset_controller_with_dev(struct device *dev,
198198
regmap = device_node_to_regmap(np);
199199
if (IS_ERR(regmap)) {
200200
dev_err(dev, "Cannot find regmap %pe\n", regmap);
201-
return -EINVAL;
201+
return PTR_ERR(regmap);
202202
}
203203

204204
data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);

0 commit comments

Comments
 (0)