Skip to content

Commit

Permalink
ASoC: xilinx: xlnx_spdif: Convert to platform remove callback returni…
Browse files Browse the repository at this point in the history
…ng void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Link: https://lore.kernel.org/r/20230315150745.67084-171-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Uwe Kleine-König authored and Mark Brown committed Mar 20, 2023
1 parent bf6b5ce commit 407a27b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions sound/soc/xilinx/xlnx_spdif.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,12 +312,11 @@ static int xlnx_spdif_probe(struct platform_device *pdev)
return ret;
}

static int xlnx_spdif_remove(struct platform_device *pdev)
static void xlnx_spdif_remove(struct platform_device *pdev)
{
struct spdif_dev_data *ctx = dev_get_drvdata(&pdev->dev);

clk_disable_unprepare(ctx->axi_clk);
return 0;
}

static struct platform_driver xlnx_spdif_driver = {
Expand All @@ -326,7 +325,7 @@ static struct platform_driver xlnx_spdif_driver = {
.of_match_table = xlnx_spdif_of_match,
},
.probe = xlnx_spdif_probe,
.remove = xlnx_spdif_remove,
.remove_new = xlnx_spdif_remove,
};
module_platform_driver(xlnx_spdif_driver);

Expand Down

0 comments on commit 407a27b

Please sign in to comment.