---
name: "device_register"
section: "9"
platform: "linux"
package: "linux-manual-3.16"
version: "3.16.56-1+deb8u1"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/device_register"
---

# device\_register(9)

register a device with the system.

## NAME

device\_register - register a device with the system.

## SYNOPSIS

**int device\_register(struct device \*** *dev***);**

## ARGUMENTS

*dev*

pointer to the device structure

## DESCRIPTION

This happens in two clean steps - initialize the device and add it to the system. The two steps can be called separately, but this is the easiest and most common. I.e. you should only call the two helpers separately if have a clearly defined need to use and refcount the device before it is added to the hierarchy.

For more information, see the kerneldoc for **device\_initialize** and **device\_add**.

## NOTE

\_Never\_ directly free *dev* after calling this function, even if it returned an error! Always use **put\_device** to give up the reference initialized in this function instead.

## COPYRIGHT
