faux_device_..._with_groups(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– faux_device_..._with_groups(9) πŸ’–

okay so bestie, welcome to the Kernel API Manual page for faux_device_..._with_groups(9) β€” yes the name is a whole mouthful, yes it's iconic, and yes we're gonna get through it together 🫢


✨ NAME ✨

faux_device_create_with_groups β€” create a faux device, register it with the driver core, and populate it with an initial set of sysfs attributes. that's the whole vibe. πŸ’…


🌸 SYNOPSIS 🌸

struct faux_device * faux_device_create_with_groups (const char *name ,
struct device *parent , const struct faux_device_ops *faux_ops , const
struct attribute_group **groups );

πŸŽ€ ARGUMENTS πŸŽ€

  • name β€” the name of the device we're adding. it must be unique across all faux devices, no sharing, no reusing, periodt.
  • parent β€” pointer to a potential parent struct device. if you set it to NULL, the device gets created in the "root" of the faux device tree in sysfs. lowkey the orphan route, but make it fashion.
  • faux_ops β€” the struct faux_device_ops that the new device will call back into. can be NULL, no pressure bestie πŸ’œ
  • groups β€” the set of sysfs attributes that get created for this device when it's registered with the driver core. this is where your device gets its lil personality ✨

πŸ¦‹ DESCRIPTION πŸ¦‹

Create a brand new faux device and register it in the driver core properly β€” none of that half-done nonsense, we're doing this right. If faux_ops is present, the callbacks in it get called with the device so the caller can do something with it at the proper time given the device's lifecycle. it's giving main character energy for the device πŸŽ€

⚠️ important note, bestie, listen up: when this function is called, the functions specified in struct faux_ops can be called before the function returns. so be prepared for everything to be properly initialized before that point in time. no cap.

and if the probe callback (when one is present) does NOT succeed, the creation of the device will fail and NULL will be returned. sad girl hours 😭 but that's the contract.


πŸ‘‘ RETURN πŸ‘‘

  • NULL if an error happened with creating the device πŸ’€
  • a pointer to a valid struct faux_device that is registered with sysfs πŸ”₯

🌈 SEE ALSO 🌈

Kernel file ./drivers/base/faux.c, plus faux_device_create(9) and faux_device_destroy(9) β€” go read the whole friend group, iykyk 🧚


and that's the page, bestie!! this one lives under ./drivers/base, dated October 2026, faux_device_..._with_groups(9). slay, go build something iconic πŸ’–βœ¨πŸ“

πŸ“¦ where this page comes from