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

# kobject\_create\_and\_add(9)

create a struct kobject dynamically and register it with sysfs

## NAME

kobject\_create\_and\_add - create a struct kobject dynamically and register it with sysfs

## SYNOPSIS

**struct kobject \* kobject\_create\_and\_add(const char \*** *name***, struct kobject \*** *parent***);**

## ARGUMENTS

*name*

the name for the kobject

*parent*

the parent kobject of this kobject, if any.

## DESCRIPTION

This function creates a kobject structure dynamically and registers it with sysfs. When you are finished with this structure, call **kobject\_put** and the structure will be dynamically freed when it is no longer being used.

If the kobject was not able to be created, NULL will be returned.

## COPYRIGHT
