device_initialize(9)

device_initialize9

Init device structure.

Usage

void device_initialize(struct device * dev);

Arguments

dev

device.

Overview

This prepares the device for use by other layers by initializing its fields. It is the first half of device_register, if called by that function, though it can also be called separately, so one may use dev's fields. In particular, get_device/put_device may be used for reference counting of dev after calling this function.

All fields in dev must be initialized by the caller to 0, except for those explicitly set to some other value. The simplest approach is to use kzalloc to allocate the structure containing dev.

Note

Use put_device to give up your reference instead of freeing dev directly once you have called this function.

Releases

5 releases since Debian 4.0 (Etch); the text changed 4 times.

  1. 4.0
  2. 5.0
  3. 6.0
  4. 7
  5. 8

From linux-manual-3.16 3.16.56-1+deb8u1 in Debian 8 (Jessie). Parsed by carta from the page's man source.