Re: [PATCH v3 07/15] platform: goldfish: pipe: Return status from "deinit" since "remove" does not do much

From: Greg KH
Date: Mon Oct 15 2018 - 14:36:11 EST


On Wed, Oct 03, 2018 at 10:17:12AM -0700, rkir@xxxxxxxxxx wrote:
> From: Roman Kiryanov <rkir@xxxxxxxxxx>
>
> This way deinit will have a chance to report an error.
>
> Signed-off-by: Roman Kiryanov <rkir@xxxxxxxxxx>
> ---
> Changes in v3:
> - No change.
> Changes in v2:
> - No change.
>
> drivers/platform/goldfish/goldfish_pipe.c | 9 +++++----
> 1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/platform/goldfish/goldfish_pipe.c b/drivers/platform/goldfish/goldfish_pipe.c
> index 445c0c0c66c4..1822d4146778 100644
> --- a/drivers/platform/goldfish/goldfish_pipe.c
> +++ b/drivers/platform/goldfish/goldfish_pipe.c
> @@ -888,13 +888,15 @@ static int goldfish_pipe_device_init(struct platform_device *pdev,
> return 0;
> }
>
> -static void goldfish_pipe_device_deinit(struct platform_device *pdev,
> - struct goldfish_pipe_dev *dev)
> +static int goldfish_pipe_device_deinit(struct platform_device *pdev,
> + struct goldfish_pipe_dev *dev)
> {
> misc_deregister(&dev->miscdev);
> tasklet_kill(&dev->irq_tasklet);
> kfree(dev->pipes);
> free_page((unsigned long)dev->buffers);
> +
> + return 0;
> }

This function can not fail, why are you returning 0 always? That
doesn't make sense.

thanks,

greg k-h