clk: fsl-sai: use devm_clk_hw_register_composite_pdata()
Simplify the driver by using that helper and drop the remove() function. Signed-off-by: Michael Walle <michael@walle.cc> Link: https://lore.kernel.org/r/20201105192746.19564-4-michael@walle.cc Signed-off-by: Stephen Boyd <sboyd@kernel.org>
This commit is contained in:
parent
0eba770790
commit
fb8715157b
|
@ -58,30 +58,19 @@ static int fsl_sai_clk_probe(struct platform_device *pdev)
|
||||||
/* set clock direction, we are the BCLK master */
|
/* set clock direction, we are the BCLK master */
|
||||||
writel(CR2_BCD, base + I2S_CR2);
|
writel(CR2_BCD, base + I2S_CR2);
|
||||||
|
|
||||||
hw = clk_hw_register_composite_pdata(dev, dev->of_node->name,
|
hw = devm_clk_hw_register_composite_pdata(dev, dev->of_node->name,
|
||||||
&pdata, 1, NULL, NULL,
|
&pdata, 1, NULL, NULL,
|
||||||
&sai_clk->div.hw,
|
&sai_clk->div.hw,
|
||||||
&clk_divider_ops,
|
&clk_divider_ops,
|
||||||
&sai_clk->gate.hw,
|
&sai_clk->gate.hw,
|
||||||
&clk_gate_ops,
|
&clk_gate_ops,
|
||||||
CLK_SET_RATE_GATE);
|
CLK_SET_RATE_GATE);
|
||||||
if (IS_ERR(hw))
|
if (IS_ERR(hw))
|
||||||
return PTR_ERR(hw);
|
return PTR_ERR(hw);
|
||||||
|
|
||||||
platform_set_drvdata(pdev, hw);
|
|
||||||
|
|
||||||
return devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get, hw);
|
return devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get, hw);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int fsl_sai_clk_remove(struct platform_device *pdev)
|
|
||||||
{
|
|
||||||
struct clk_hw *hw = platform_get_drvdata(pdev);
|
|
||||||
|
|
||||||
clk_hw_unregister_composite(hw);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static const struct of_device_id of_fsl_sai_clk_ids[] = {
|
static const struct of_device_id of_fsl_sai_clk_ids[] = {
|
||||||
{ .compatible = "fsl,vf610-sai-clock" },
|
{ .compatible = "fsl,vf610-sai-clock" },
|
||||||
{ }
|
{ }
|
||||||
|
@ -90,7 +79,6 @@ MODULE_DEVICE_TABLE(of, of_fsl_sai_clk_ids);
|
||||||
|
|
||||||
static struct platform_driver fsl_sai_clk_driver = {
|
static struct platform_driver fsl_sai_clk_driver = {
|
||||||
.probe = fsl_sai_clk_probe,
|
.probe = fsl_sai_clk_probe,
|
||||||
.remove = fsl_sai_clk_remove,
|
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = "fsl-sai-clk",
|
.name = "fsl-sai-clk",
|
||||||
.of_match_table = of_fsl_sai_clk_ids,
|
.of_match_table = of_fsl_sai_clk_ids,
|
||||||
|
|
Loading…
Reference in New Issue