diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2022-10-14 18:06:23 +0200 |
---|---|---|
committer | Will Deacon <will@kernel.org> | 2023-04-17 12:26:03 +0100 |
commit | 858a56630a840aba0e291fd4958e9a8f74638d56 (patch) | |
tree | 02c94fc4340aca6b989a8b14dbaa82cc0f54c53b /drivers/acpi/arm64 | |
parent | e8d018dd0257f744ca50a729e3d042cf2ec9da65 (diff) | |
download | linux-stable-858a56630a840aba0e291fd4958e9a8f74638d56.tar.gz linux-stable-858a56630a840aba0e291fd4958e9a8f74638d56.tar.bz2 linux-stable-858a56630a840aba0e291fd4958e9a8f74638d56.zip |
ACPI: AGDI: Improve error reporting for problems during .remove()
Returning an error value in a platform driver's remove callback results in
a generic error message being emitted by the driver core, but otherwise it
doesn't make a difference. The device goes away anyhow.
So instead of triggering the generic platform error message, emit a more
helpful message if a problem occurs and return 0 to suppress the generic
message.
This patch is a preparation for making platform remove callbacks return
void.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Lorenzo Pieralisi <lpieralisi@kernel.org>
Link: https://lore.kernel.org/r/20221014160623.467195-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'drivers/acpi/arm64')
-rw-r--r-- | drivers/acpi/arm64/agdi.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/acpi/arm64/agdi.c b/drivers/acpi/arm64/agdi.c index cf31abd0ed1b..f605302395c3 100644 --- a/drivers/acpi/arm64/agdi.c +++ b/drivers/acpi/arm64/agdi.c @@ -64,8 +64,11 @@ static int agdi_remove(struct platform_device *pdev) int err, i; err = sdei_event_disable(adata->sdei_event); - if (err) - return err; + if (err) { + dev_err(&pdev->dev, "Failed to disable sdei-event #%d (%pe)\n", + adata->sdei_event, ERR_PTR(err)); + return 0; + } for (i = 0; i < 3; i++) { err = sdei_event_unregister(adata->sdei_event); @@ -75,7 +78,11 @@ static int agdi_remove(struct platform_device *pdev) schedule(); } - return err; + if (err) + dev_err(&pdev->dev, "Failed to unregister sdei-event #%d (%pe)\n", + adata->sdei_event, ERR_PTR(err)); + + return 0; } static struct platform_driver agdi_driver = { |