platform/chrome: cros_ec: Make cros_ec_unregister() return void

Up to now cros_ec_unregister() returns zero unconditionally. Make it
return void instead which makes it easier to see in the callers that
there is no error to handle.

Also the return value of i2c, platform and spi remove callbacks is
ignored anyway.

Reviewed-by: Guenter Roeck <groeck@chromium.org>
Link: https://lore.kernel.org/r/20211020071753.wltjslmimb6wtlp5@pengutronix.de
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220123175201.34839-5-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Uwe Kleine-König 2022-01-23 18:52:00 +01:00 committed by Mark Brown
parent 316f569df7
commit afb0a80e63
No known key found for this signature in database
GPG key ID: 24D68B725D5487D0
5 changed files with 11 additions and 7 deletions

View file

@ -302,13 +302,11 @@ EXPORT_SYMBOL(cros_ec_register);
*
* Return: 0 on success or negative error code.
*/
int cros_ec_unregister(struct cros_ec_device *ec_dev)
void cros_ec_unregister(struct cros_ec_device *ec_dev)
{
if (ec_dev->pd)
platform_device_unregister(ec_dev->pd);
platform_device_unregister(ec_dev->ec);
return 0;
}
EXPORT_SYMBOL(cros_ec_unregister);

View file

@ -11,7 +11,7 @@
#include <linux/interrupt.h>
int cros_ec_register(struct cros_ec_device *ec_dev);
int cros_ec_unregister(struct cros_ec_device *ec_dev);
void cros_ec_unregister(struct cros_ec_device *ec_dev);
int cros_ec_suspend(struct cros_ec_device *ec_dev);
int cros_ec_resume(struct cros_ec_device *ec_dev);

View file

@ -313,7 +313,9 @@ static int cros_ec_i2c_remove(struct i2c_client *client)
{
struct cros_ec_device *ec_dev = i2c_get_clientdata(client);
return cros_ec_unregister(ec_dev);
cros_ec_unregister(ec_dev);
return 0;
}
#ifdef CONFIG_PM_SLEEP

View file

@ -439,7 +439,9 @@ static int cros_ec_lpc_remove(struct platform_device *pdev)
acpi_remove_notify_handler(adev->handle, ACPI_ALL_NOTIFY,
cros_ec_lpc_acpi_notify);
return cros_ec_unregister(ec_dev);
cros_ec_unregister(ec_dev);
return 0;
}
static const struct acpi_device_id cros_ec_lpc_acpi_device_ids[] = {

View file

@ -790,7 +790,9 @@ static int cros_ec_spi_remove(struct spi_device *spi)
{
struct cros_ec_device *ec_dev = spi_get_drvdata(spi);
return cros_ec_unregister(ec_dev);
cros_ec_unregister(ec_dev);
return 0;
}
#ifdef CONFIG_PM_SLEEP