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

# i2c\_add\_adapter(9)

declare i2c adapter, use dynamic bus number

## NAME

i2c\_add\_adapter - declare i2c adapter, use dynamic bus number

## SYNOPSIS

**int i2c\_add\_adapter(struct i2c\_adapter \*** *adapter***);**

## ARGUMENTS

*adapter*

the adapter to add

## CONTEXT

can sleep

## DESCRIPTION

This routine is used to declare an I2C adapter when its bus number doesn't matter or when its bus number is specified by an dt alias. Examples of bases when the bus number doesn't matter: I2C adapters dynamically added by USB links or PCI plugin cards.

When this returns zero, a new bus number was allocated and stored in adap-\>nr, and the specified adapter became available for clients. Otherwise, a negative errno value is returned.

## COPYRIGHT
