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

# \_\_dev\_get\_by\_name(9)

find a device by its name

## NAME

\_\_dev\_get\_by\_name - find a device by its name

## SYNOPSIS

**struct net\_device \* \_\_dev\_get\_by\_name(struct net \*** *net***, const char \*** *name***);**

## ARGUMENTS

*net*

the applicable net namespace

*name*

name to find

## DESCRIPTION

Find an interface by name. Must be called under RTNL semaphore or *dev\_base\_lock*. If the name is found a pointer to the device is returned. If the name is not found then **NULL** is returned. The reference counters are not incremented so the caller must be careful with locks.

## COPYRIGHT
