Commit e3cee98f authored by Johan Hovold's avatar Johan Hovold Committed by Jassi Brar
Browse files

mailbox: th1520: fix clock imbalance on probe failure



The purpose of the devm_add_action_or_reset() helper is to call the
action function in case adding an action ever fails so drop the clock
disable from the error path to avoid disabling the clocks twice.

Fixes: 5d4d263e ("mailbox: Introduce support for T-head TH1520 Mailbox driver")
Cc: Michal Wilczynski <m.wilczynski@samsung.com>
Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
Reviewed-by: default avatarMichal Wilczynski <m.wilczynski@samsung.com>
Signed-off-by: default avatarJassi Brar <jassisinghbrar@gmail.com>
parent ff0e4d4c
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -435,10 +435,8 @@ static int th1520_mbox_probe(struct platform_device *pdev)
	}

	ret = devm_add_action_or_reset(dev, th1520_disable_clk, priv);
	if (ret) {
		clk_bulk_disable_unprepare(ARRAY_SIZE(priv->clocks), priv->clocks);
	if (ret)
		return ret;
	}

	/*
	 * The address mappings in the device tree align precisely with those