---
name: "misc_register"
section: "9"
platform: "linux"
package: "linux-manual-4.9"
version: "4.9.228-1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/misc_register"
---

# misc\_register(9)

register a miscellaneous device

## NAME

misc\_register - register a miscellaneous device

## SYNOPSIS

**int misc\_register(struct miscdevice \*** *misc***);**

## ARGUMENTS

*misc*

device structure

## DESCRIPTION

Register a miscellaneous device with the kernel. If the minor number is set to **MISC\_DYNAMIC\_MINOR** a minor number is assigned and placed in the minor field of the structure. For other cases the minor number requested is used.

The structure passed is linked into the kernel and may not be destroyed until it has been unregistered. By default, an **open** syscall to the device sets file-\>private\_data to point to the structure. Drivers don't need open in fops for this.

A zero is returned on success and a negative errno code for failure.

## COPYRIGHT
