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

# devm\_input\_allocate\_device(9)

allocate managed input device

## NAME

devm\_input\_allocate\_device - allocate managed input device

## SYNOPSIS

**struct input\_dev \* devm\_input\_allocate\_device(struct device \*** *dev***);**

## ARGUMENTS

*dev*

device owning the input device being created

## DESCRIPTION

Returns prepared struct input\_dev or **NULL**.

Managed input devices do not need to be explicitly unregistered or freed as it will be done automatically when owner device unbinds from its driver (or binding fails). Once managed input device is allocated, it is ready to be set up and registered in the same fashion as regular input device. There are no special devm\_input\_device\_\[un\]**register** variants, regular ones work with both managed and unmanaged devices, should you need them. In most cases however, managed input device need not be explicitly unregistered or freed.

## NOTE

the owner device is set up as parent of input device and users should not override it.

## COPYRIGHT
