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

# kset\_create\_and\_add(9)

create a struct kset dynamically and add it to sysfs

## NAME

kset\_create\_and\_add - create a struct kset dynamically and add it to sysfs

## SYNOPSIS

**struct kset \* kset\_create\_and\_add(const char \*** *name***, const struct kset\_uevent\_ops \*** *uevent\_ops***, struct kobject \*** *parent\_kobj***);**

## ARGUMENTS

*name*

the name for the kset

*uevent\_ops*

a struct kset\_uevent\_ops for the kset

*parent\_kobj*

the parent kobject of this kset, if any.

## DESCRIPTION

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

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

## COPYRIGHT
