|
@@ -45,9 +45,6 @@ struct reset_control {
|
|
static int of_reset_simple_xlate(struct reset_controller_dev *rcdev,
|
|
static int of_reset_simple_xlate(struct reset_controller_dev *rcdev,
|
|
const struct of_phandle_args *reset_spec)
|
|
const struct of_phandle_args *reset_spec)
|
|
{
|
|
{
|
|
- if (WARN_ON(reset_spec->args_count != rcdev->of_reset_n_cells))
|
|
|
|
- return -EINVAL;
|
|
|
|
-
|
|
|
|
if (reset_spec->args[0] >= rcdev->nr_resets)
|
|
if (reset_spec->args[0] >= rcdev->nr_resets)
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
|
|
|
@@ -178,6 +175,11 @@ struct reset_control *of_reset_control_get_by_index(struct device_node *node,
|
|
return ERR_PTR(-EPROBE_DEFER);
|
|
return ERR_PTR(-EPROBE_DEFER);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if (WARN_ON(args.args_count != rcdev->of_reset_n_cells)) {
|
|
|
|
+ mutex_unlock(&reset_controller_list_mutex);
|
|
|
|
+ return ERR_PTR(-EINVAL);
|
|
|
|
+ }
|
|
|
|
+
|
|
rstc_id = rcdev->of_xlate(rcdev, &args);
|
|
rstc_id = rcdev->of_xlate(rcdev, &args);
|
|
if (rstc_id < 0) {
|
|
if (rstc_id < 0) {
|
|
mutex_unlock(&reset_controller_list_mutex);
|
|
mutex_unlock(&reset_controller_list_mutex);
|