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

# \_\_root\_device\_register(9)

allocate and register a root device

## NAME

\_\_root\_device\_register - allocate and register a root device

## SYNOPSIS

**struct device \* \_\_root\_device\_register(const char \*** *name***, struct module \*** *owner***);**

## ARGUMENTS

*name*

root device name

*owner*

owner module of the root device, usually THIS\_MODULE

## DESCRIPTION

This function allocates a root device and registers it using **device\_register**. In order to free the returned device, use **root\_device\_unregister**.

Root devices are dummy devices which allow other devices to be grouped under /sys/devices. Use this function to allocate a root device and then use it as the parent of any device which should appear under /sys/devices/{name}

The /sys/devices/{name} directory will also contain a 'module' symlink which points to the *owner* directory in sysfs.

Returns struct device pointer on success, or **ERR\_PTR** on error.

## NOTE

You probably want to use **root\_device\_register**.

## COPYRIGHT
