Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fbecf4dc authored by David Collins's avatar David Collins
Browse files

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: default avatarDavid Collins <collinsd@codeaurora.org>
parent d3d6e9be
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2013-2014, 2017-2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2013-2014, 2017-2019, The Linux Foundation.
 * All rights reserved.
 */

#include <linux/export.h>
@@ -235,9 +236,11 @@ int qcom_cc_really_probe(struct platform_device *pdev,
	reset->regmap = regmap;
	reset->reset_map = desc->resets;

	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);