---
name: "bus_generic_attach"
section: "9freebsd"
platform: "linux"
package: "freebsd-manpages"
version: "12.2-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/bus_generic_attach/9freebsd"
---

# bus\_generic\_attach(9freebsd)

generic implementation of DEVICE\_ATTACH for buses

## NAME

**bus\_generic\_attach** – generic implementation of DEVICE\_ATTACH for buses

## SYNOPSIS

**#include \<sys/param.h\>**

**#include \<sys/bus.h\>**

*int*\

**bus\_generic\_attach**(*device\_t dev*);

## DESCRIPTION

This function provides an implementation of the [DEVICE\_ATTACH(9)](/DEVICE_ATTACH/9.md) method which can be used by most bus code. It simply calls [device\_probe\_and\_attach(9)](/device_probe_and_attach/9.md) for each child device attached to the bus.

## RETURN VALUES

Zero is returned on success, otherwise an appropriate error is returned.

## SEE ALSO

[device(9)](/device/9.md), [driver(9)](/driver/9.md)

## AUTHORS

This manual page was written by Doug Rabson.
