[PATCH] staging: vchiq: call unregister_chrdev_region() when driver registration fails

Nicolas Saenz Julienne nsaenzjulienne at suse.de
Wed Dec 4 20:13:21 UTC 2019


On Tue, 2019-12-03 at 10:39 -0500, Marcelo Diop-Gonzalez wrote:
> This undoes the previous call to alloc_chrdev_region() on failure,
> and is probably what was meant originally given the label name.
> 
> Signed-off-by: Marcelo Diop-Gonzalez <marcgonzalez at google.com>
> ---
>  drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
> b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
> index 02148a24818a..4458c1e60fa3 100644
> --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
> +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
> @@ -3309,7 +3309,7 @@ static int __init vchiq_driver_init(void)
>  	return 0;
>  
>  region_unregister:
> -	platform_driver_unregister(&vchiq_driver);
> +	unregister_chrdev_region(vchiq_devid, 1);
>  
>  class_destroy:
>  	class_destroy(vchiq_class);

Thanks!

Reviewed-by: Nicolas Saenz Julienne <nsaenzjulienne at suse.de>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part
URL: <http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/attachments/20191204/0327ce53/attachment.asc>


More information about the devel mailing list