ASoC: mxs: mxs-sgtl5000: Simplify probe function
Subsystems (3)
Fabio Estevam
reviewerPATCH 1/1 ASoC: mxs: mxs-sgtl5000: Simplify probe function
From: Fabio Estevam <[email protected]>
mxs is a device tree only platform, which allows us to simplify a bit mxs_sgtl5000_probe(), because there is no need to check whether device tree is supported or not.
Remove mxs_sgtl5000_probe_dt() and place its content inside mxs_sgtl5000_probe() for making the code simpler.
Signed-off-by Fabio Estevam <[email protected]>
--- sound/soc/mxs/mxs-sgtl5000.c | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-)
sound/soc/mxs/mxs-sgtl5000.c +3 -17
@@ -122,14 +122,12 @@ static struct snd_soc_card mxs_sgtl5000 = { .num_links = ARRAY_SIZE(mxs_sgtl5000_dai), }; -static int mxs_sgtl5000_probe_dt (struct platform_device *pdev) +static int mxs_sgtl5000_probe (struct platform_device *pdev) { +struct snd_soc_card *card = &mxs_sgtl5000; +int ret, i;struct device_node *np = pdev->dev.of_node;struct device_node *saif_np[2 ], *codec_np; -int i; - -if (!np) -return 1 ;/* no device tree */ saif_np[0 ] =of_parse_phandle (np,"saif-controllers" ,0 ); saif_np[1 ] =of_parse_phandle (np,"saif-controllers" ,1 );
@@ -152,18 +150,6 @@ static int mxs_sgtl5000_probe_dt(struct platform_device *pdev)of_node_put (saif_np[0 ]);of_node_put (saif_np[1 ]); -return 0 ; -} - -static int mxs_sgtl5000_probe (struct platform_device *pdev) -{ -struct snd_soc_card *card = &mxs_sgtl5000; -int ret; - - ret =mxs_sgtl5000_probe_dt (pdev); -if (ret <0 ) -return ret; -/* * Set an init clock(11.28Mhz) for sgtl5000 initialization(i2c r/w). * The Sgtl5000 sysclk is derived from saif0 mclk and it's range
Signature · 1 line
1.8.1.2
Quoted 5 lines · Fabio Estevam
From: Fabio Estevam <[email protected]>
mxs is a device tree only platform, which allows us to simplify a bit
mxs_sgtl5000_probe(), because there is no need to check whether device tree is supported or not.
Applied, thanks.