Skip to content

Commit

Permalink
soc: mediatek: mtk-svs: move svs_platform_probe into probe
Browse files Browse the repository at this point in the history
Moving svs_platform_probe into driver probe function will allow us to
reduce svs_platform members. This will be done in a follow-up patch.

Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
Signed-off-by: Roger Lu <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Matthias Brugger <[email protected]>
  • Loading branch information
mbgg committed Jan 31, 2023
1 parent 227fafd commit 5343e9f
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions drivers/soc/mediatek/mtk-svs.c
Original file line number Diff line number Diff line change
Expand Up @@ -2353,17 +2353,17 @@ static const struct of_device_id svs_of_match[] = {
},
};

static struct svs_platform *svs_platform_probe(struct platform_device *pdev)
static int svs_probe(struct platform_device *pdev)
{
struct svs_platform *svsp;
const struct svs_platform_data *svsp_data;
int ret;
int ret, svsp_irq;

svsp_data = of_device_get_match_data(&pdev->dev);

svsp = devm_kzalloc(&pdev->dev, sizeof(*svsp), GFP_KERNEL);
if (!svsp)
return ERR_PTR(-ENOMEM);
return -ENOMEM;

svsp->dev = &pdev->dev;
svsp->name = svsp_data->name;
Expand All @@ -2374,19 +2374,7 @@ static struct svs_platform *svs_platform_probe(struct platform_device *pdev)

ret = svsp_data->probe(svsp);
if (ret)
return ERR_PTR(ret);

return svsp;
}

static int svs_probe(struct platform_device *pdev)
{
struct svs_platform *svsp;
int svsp_irq, ret;

svsp = svs_platform_probe(pdev);
if (IS_ERR(svsp))
return PTR_ERR(svsp);
return ret;

if (!svs_is_efuse_data_correct(svsp)) {
dev_notice(svsp->dev, "efuse data isn't correct\n");
Expand Down

0 comments on commit 5343e9f

Please sign in to comment.