---
name: "input_register_device"
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/input_register_device"
---

# input\_register\_device(9)

register device with input core

## NAME

input\_register\_device - register device with input core

## SYNOPSIS

**int input\_register\_device(struct input\_dev \*** *dev***);**

## ARGUMENTS

*dev*

device to be registered

## DESCRIPTION

This function registers device with input core. The device must be allocated with **input\_allocate\_device** and all it's capabilities set up before registering. If function fails the device must be freed with **input\_free\_device**. Once device has been successfully registered it can be unregistered with **input\_unregister\_device**; **input\_free\_device** should not be called in this case.

Note that this function is also used to register managed input devices (ones allocated with **devm\_input\_allocate\_device**). Such managed input devices need not be explicitly unregistered or freed, their tear down is controlled by the devres infrastructure. It is also worth noting that tear down of managed input devices is internally a 2-step process: registered managed input device is first unregistered, but stays in memory and can still handle **input\_event** calls (although events will not be delivered anywhere). The freeing of managed input device will happen later, when devres stack is unwound to the point where device allocation was made.

## COPYRIGHT
