v6.11: platform: Make platform_driver::remove() return void

commit 0edb555a65d1ef047a9805051c36922b52a38a9d
Author:     Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
AuthorDate: Mon Oct 9 12:37:26 2023 +0200
Commit:     Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
CommitDate: Mon May 27 10:34:35 2024 +0200

    platform: Make platform_driver::remove() return void

    struct platform_driver::remove returning an integer made driver authors
    expect that returning an error code was proper error handling. However
    the driver core ignores the error and continues to remove the device
    because there is nothing the core could do anyhow and reentering the
    remove callback again is only calling for trouble.

    To prevent such wrong assumptions, change the return type of the remove
    callback to void. This was prepared by introducing an alternative remove
    callback returning void and converting all drivers to that. So .remove()
    can be changed without further changes in drivers.

    This corresponds to step b) of the plan outlined in commit
    5c5a7680e67b ("platform: Provide a remove callback that returns no value").

    Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
This commit is contained in:
Hin-Tak Leung 2024-10-21 23:59:27 +01:00
parent 899fdb1e5b
commit f5710e9761

View file

@ -890,7 +890,7 @@ err:
return ret;
}
static int seeed_voice_card_remove(struct platform_device *pdev)
static void seeed_voice_card_remove(struct platform_device *pdev)
{
struct snd_soc_card *card = platform_get_drvdata(pdev);
struct seeed_card_data *priv = snd_soc_card_get_drvdata(card);
@ -899,7 +899,7 @@ static int seeed_voice_card_remove(struct platform_device *pdev)
}
simple_util_clean_reference(card);
return 0;
return;
}
static const struct of_device_id seeed_voice_of_match[] = {