Skip to content

Commit c79a7ca

Browse files
salah-trikiMani-Sadhasivam
authored andcommitted
PCI: mvebu: Use devm_add_action_or_reset() instead of devm_add_action()
Replace devm_add_action() with devm_add_action_or_reset() to avoid explicitly dropping the 'port->clk' reference in error path. Signed-off-by: Salah Triki <[email protected]> [mani: reworded commit subject and description] Signed-off-by: Manivannan Sadhasivam <[email protected]> Link: https://patch.msgid.link/aHsgYALHfQbrgq0t@pc
1 parent 19272b3 commit c79a7ca

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/pci/controller/pci-mvebu.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1353,11 +1353,9 @@ static int mvebu_pcie_parse_port(struct mvebu_pcie *pcie,
13531353
goto skip;
13541354
}
13551355

1356-
ret = devm_add_action(dev, mvebu_pcie_port_clk_put, port);
1357-
if (ret < 0) {
1358-
clk_put(port->clk);
1356+
ret = devm_add_action_or_reset(dev, mvebu_pcie_port_clk_put, port);
1357+
if (ret < 0)
13591358
goto err;
1360-
}
13611359

13621360
return 1;
13631361

0 commit comments

Comments
 (0)