Skip to content

Commit

Permalink
ASoC: stm32: sai: use devm_of_platform_populate()
Browse files Browse the repository at this point in the history
Use devm_of_platform_populate() instead of of_platform_depopulate()
to simplify driver code.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
olivier moysan authored and Mark Brown committed Nov 27, 2017
1 parent 7dd0d83 commit 512d1bb
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions sound/soc/stm/stm32_sai.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ static int stm32_sai_set_sync(struct stm32_sai_data *sai_client,

static int stm32_sai_probe(struct platform_device *pdev)
{
struct device_node *np = pdev->dev.of_node;
struct stm32_sai_data *sai;
struct reset_control *rst;
struct resource *res;
Expand Down Expand Up @@ -184,14 +183,7 @@ static int stm32_sai_probe(struct platform_device *pdev)
sai->set_sync = &stm32_sai_set_sync;
platform_set_drvdata(pdev, sai);

return of_platform_populate(np, NULL, NULL, &pdev->dev);
}

static int stm32_sai_remove(struct platform_device *pdev)
{
of_platform_depopulate(&pdev->dev);

return 0;
return devm_of_platform_populate(&pdev->dev);
}

MODULE_DEVICE_TABLE(of, stm32_sai_ids);
Expand All @@ -202,7 +194,6 @@ static struct platform_driver stm32_sai_driver = {
.of_match_table = stm32_sai_ids,
},
.probe = stm32_sai_probe,
.remove = stm32_sai_remove,
};

module_platform_driver(stm32_sai_driver);
Expand Down

0 comments on commit 512d1bb

Please sign in to comment.