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

Commit 332b32a2 authored by Jerome Brunet's avatar Jerome Brunet Committed by Neil Armstrong
Browse files

clk: meson: use devm_of_clk_add_hw_provider



There is no remove callbacks in meson's clock controllers and
of_clk_del_provider is never called if of_clk_add_hw_provider has been
executed, introducing a potential memory leak.
Fixing this by the using the devm variant.

In reality, the leak would never happen since these controllers are
never unloaded once in use ... still, this is worth cleaning.

Signed-off-by: default avatarJerome Brunet <jbrunet@baylibre.com>
Signed-off-by: default avatarNeil Armstrong <narmstrong@baylibre.com>
parent 323346d3
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -854,7 +854,7 @@ static int axg_clkc_probe(struct platform_device *pdev)
		}
	}

	return of_clk_add_hw_provider(dev->of_node, of_clk_hw_onecell_get,
	return devm_of_clk_add_hw_provider(dev, of_clk_hw_onecell_get,
					   clkc_data->hw_onecell_data);
}

+3 −2
Original line number Diff line number Diff line
@@ -2002,7 +2002,8 @@ static int gxbb_clkc_probe(struct platform_device *pdev)
			goto iounmap;
	}

	return of_clk_add_hw_provider(dev->of_node, of_clk_hw_onecell_get,

	return devm_of_clk_add_hw_provider(dev, of_clk_hw_onecell_get,
					   clkc_data->hw_onecell_data);

iounmap:
+2 −2
Original line number Diff line number Diff line
@@ -878,7 +878,7 @@ static int meson8b_clkc_probe(struct platform_device *pdev)
		return ret;
	}

	return of_clk_add_hw_provider(dev->of_node, of_clk_hw_onecell_get,
	return devm_of_clk_add_hw_provider(dev, of_clk_hw_onecell_get,
					   &meson8b_hw_onecell_data);
}