デバイス番号を動的に得る result = register_chrdev(0, "hello", &hello_fops); if (result < 0) { printk("hello: can't get major ¥n"); return result; } hello_major = result;