DriverDev-Devel Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] staging: vchiq: call unregister_chrdev_region() when driver registration fails
@ 2019-12-03 15:39 Marcelo Diop-Gonzalez
  2019-12-03 17:48 ` Dan Carpenter
  2019-12-04 20:13 ` Nicolas Saenz Julienne
  0 siblings, 2 replies; 3+ messages in thread
From: Marcelo Diop-Gonzalez @ 2019-12-03 15:39 UTC (permalink / raw)
  To: gregkh, wahrenst, nsaenzjulienne; +Cc: devel, linux-rpi-kernel

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@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);
-- 
2.20.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] staging: vchiq: call unregister_chrdev_region() when driver registration fails
  2019-12-03 15:39 [PATCH] staging: vchiq: call unregister_chrdev_region() when driver registration fails Marcelo Diop-Gonzalez
@ 2019-12-03 17:48 ` Dan Carpenter
  2019-12-04 20:13 ` Nicolas Saenz Julienne
  1 sibling, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2019-12-03 17:48 UTC (permalink / raw)
  To: Marcelo Diop-Gonzalez; +Cc: devel, gregkh, wahrenst, linux-rpi-kernel

On Tue, Dec 03, 2019 at 10:39:21AM -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@google.com>

Fixes: 187ac53e590c ("staging: vchiq_arm: rework probe and init functions")
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>

Thanks!

regards,
dan carpenter

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] staging: vchiq: call unregister_chrdev_region() when driver registration fails
  2019-12-03 15:39 [PATCH] staging: vchiq: call unregister_chrdev_region() when driver registration fails Marcelo Diop-Gonzalez
  2019-12-03 17:48 ` Dan Carpenter
@ 2019-12-04 20:13 ` Nicolas Saenz Julienne
  1 sibling, 0 replies; 3+ messages in thread
From: Nicolas Saenz Julienne @ 2019-12-04 20:13 UTC (permalink / raw)
  To: Marcelo Diop-Gonzalez, gregkh, wahrenst; +Cc: devel, linux-rpi-kernel

[-- Attachment #1.1: Type: text/plain, Size: 1075 bytes --]

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@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@suse.de>


[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 169 bytes --]

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-03 15:39 [PATCH] staging: vchiq: call unregister_chrdev_region() when driver registration fails Marcelo Diop-Gonzalez
2019-12-03 17:48 ` Dan Carpenter
2019-12-04 20:13 ` Nicolas Saenz Julienne

DriverDev-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/driverdev-devel/0 driverdev-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 driverdev-devel driverdev-devel/ https://lore.kernel.org/driverdev-devel \
		driverdev-devel@linuxdriverproject.org devel@driverdev.osuosl.org
	public-inbox-index driverdev-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.linuxdriverproject.driverdev-devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git