clk: qcom: common: only register reset controllers which define resets

Add a condition check to ensure that a reset controller is only
registered for a given clock controller inside of the
qcom_cc_really_probe() function if more than 0 resets are
defined for it.

Change-Id: Iffdfce1f7609ccab184a61c4a448a7edc15bb4ab
Signed-off-by: David Collins <collinsd@codeaurora.org>
This commit is contained in:
David Collins 2019-07-08 12:00:39 -07:00 committed by Mike Tipton
parent 9e2abb9c90
commit ce308ac8f9

View File

@ -1,4 +1,4 @@
// SPDX-License-Identifier: GPL-2.0
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2013-2014, 2017-2019, The Linux Foundation.
* All rights reserved.
@ -265,9 +265,11 @@ int qcom_cc_really_probe(struct platform_device *pdev,
reset->regmap = regmap;
reset->reset_map = desc->resets;
ret = devm_reset_controller_register(dev, &reset->rcdev);
if (ret)
return ret;
if (desc->num_resets) {
ret = devm_reset_controller_register(dev, &reset->rcdev);
if (ret)
return ret;
}
if (desc->gdscs && desc->num_gdscs) {
scd = devm_kzalloc(dev, sizeof(*scd), GFP_KERNEL);