WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH linux-2.6.18-xen] blktap: make max # of tap devi

On Thu, 2011-02-24 at 11:40 -0500, Jan Beulich wrote:

>   /* 
>    * BLKTAP - immediately before the mmap area,
> @@ -511,26 +510,16 @@ blktap_ring_debug(struct blktap *tap, ch
>  int __init
>  blktap_ring_init(void)
>  {
> -     dev_t dev = 0;
>       int err;
>  
> -     cdev_init(&blktap_ring_cdev, &blktap_ring_file_operations);
> -     blktap_ring_cdev.owner = THIS_MODULE;
> -
> -     err = alloc_chrdev_region(&dev, 0, MAX_BLKTAP_DEVICE, "blktap2");
> +     err = __register_chrdev(0, 0, MAX_BLKTAP_DEVICE, "blktap2",
> +                             &blktap_ring_file_operations);
>       if (err < 0) {
>               BTERR("error registering ring devices: %d\n", err);
>               return err;
>       }
>  
> -     err = cdev_add(&blktap_ring_cdev, dev, MAX_BLKTAP_DEVICE);
> -     if (err) {
> -             BTERR("error adding ring device: %d\n", err);
> -             unregister_chrdev_region(dev, MAX_BLKTAP_DEVICE);
> -             return err;
> -     }
> -
> -     blktap_ring_major = MAJOR(dev);
> +     blktap_ring_major = err;
>       BTINFO("blktap ring major: %d\n", blktap_ring_major);

While you are at it: Feel free to drop init message(s?), too. Blktap is
not boot critical, and there are plenty alternative places to check
presence.

Cheers,
Daniel


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel