Re: [PATCH v1 1/3] virtio-blk: add virtio-blk chardev support.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 12/18/24 5:24 PM, Ferry Meng wrote:

> +static int virtblk_cdev_add(struct virtio_blk *vblk,
> +		const struct file_operations *fops)

@fops argument is not necessary, as currently virtblk_chr_fops is the
only valid value.


> @@ -1690,7 +1770,9 @@ static void __exit virtio_blk_fini(void)
>  {
>  	unregister_virtio_driver(&virtio_blk);
>  	unregister_blkdev(major, "virtblk");
> +	unregister_chrdev_region(vd_chr_devt, VIRTBLK_MINORS);

Better to call "unregister_chrdev_region(vd_chr_devt, VIRTBLK_MINORS)"
before "unregister_blkdev(major, "virtblk")" to follow the convention
that the order of the cleanup routine is exactly the reverse of that of
the init routine.

>  	destroy_workqueue(virtblk_wq);
> +	ida_destroy(&vd_chr_minor_ida);
>  }
>  module_init(virtio_blk_init);
>  module_exit(virtio_blk_fini);

-- 
Thanks,
Jingbo




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux