Skip to content

Commit

Permalink
platform/chrome: cros_ec: Make cros_ec_unregister() return void
Browse files Browse the repository at this point in the history
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 <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Uwe Kleine-König <[email protected]>
Acked-by: Lee Jones <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
Uwe Kleine-König authored and broonie committed Feb 9, 2022
1 parent 316f569 commit afb0a80
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
4 changes: 1 addition & 3 deletions drivers/platform/chrome/cros_ec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion drivers/platform/chrome/cros_ec.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 3 additions & 1 deletion drivers/platform/chrome/cros_ec_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion drivers/platform/chrome/cros_ec_lpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = {
Expand Down
4 changes: 3 additions & 1 deletion drivers/platform/chrome/cros_ec_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit afb0a80

Please sign in to comment.