Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Michael Walle and committed by
Stephen Boyd
fb871515 0eba7707

+7 -19
+7 -19
drivers/clk/clk-fsl-sai.c
··· 58 58 /* set clock direction, we are the BCLK master */ 59 59 writel(CR2_BCD, base + I2S_CR2); 60 60 61 - hw = clk_hw_register_composite_pdata(dev, dev->of_node->name, 62 - &pdata, 1, NULL, NULL, 63 - &sai_clk->div.hw, 64 - &clk_divider_ops, 65 - &sai_clk->gate.hw, 66 - &clk_gate_ops, 67 - CLK_SET_RATE_GATE); 61 + hw = devm_clk_hw_register_composite_pdata(dev, dev->of_node->name, 62 + &pdata, 1, NULL, NULL, 63 + &sai_clk->div.hw, 64 + &clk_divider_ops, 65 + &sai_clk->gate.hw, 66 + &clk_gate_ops, 67 + CLK_SET_RATE_GATE); 68 68 if (IS_ERR(hw)) 69 69 return PTR_ERR(hw); 70 70 71 - platform_set_drvdata(pdev, hw); 72 - 73 71 return devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get, hw); 74 - } 75 - 76 - static int fsl_sai_clk_remove(struct platform_device *pdev) 77 - { 78 - struct clk_hw *hw = platform_get_drvdata(pdev); 79 - 80 - clk_hw_unregister_composite(hw); 81 - 82 - return 0; 83 72 } 84 73 85 74 static const struct of_device_id of_fsl_sai_clk_ids[] = { ··· 79 90 80 91 static struct platform_driver fsl_sai_clk_driver = { 81 92 .probe = fsl_sai_clk_probe, 82 - .remove = fsl_sai_clk_remove, 83 93 .driver = { 84 94 .name = "fsl-sai-clk", 85 95 .of_match_table = of_fsl_sai_clk_ids,