---
name: "devm_request_resource"
section: "9"
platform: "linux"
package: "linux-manual-4.9"
version: "4.9.228-1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/devm_request_resource"
---

# devm\_request\_resource(9)

request and reserve an I/O or memory resource

## NAME

devm\_request\_resource - request and reserve an I/O or memory resource

## SYNOPSIS

**int devm\_request\_resource(struct device \*** *dev***, struct resource \*** *root***, struct resource \*** *new***);**

## ARGUMENTS

*dev*

device for which to request the resource

*root*

root of the resource tree from which to request the resource

*new*

descriptor of the resource to request

## DESCRIPTION

This is a device-managed version of **request\_resource**. There is usually no need to release resources requested by this function explicitly since that will be taken care of when the device is unbound from its driver. If for some reason the resource needs to be released explicitly, because of ordering issues for example, drivers must call **devm\_release\_resource** rather than the regular **release\_resource**.

When a conflict is detected between any existing resources and the newly requested resource, an error message will be printed.

Returns 0 on success or a negative error code on failure.

## COPYRIGHT
