include/linux/device/faux.h
Source file repositories/reference/linux-study-clean/include/linux/device/faux.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/device/faux.h- Extension
.h- Size
- 2456 bytes
- Lines
- 70
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/container_of.hlinux/device.h
Detected Declarations
struct faux_devicestruct faux_device_opsfunction faux_device_set_drvdata
Annotated Snippet
struct faux_device {
struct device dev;
};
#define to_faux_device(x) container_of_const((x), struct faux_device, dev)
/**
* struct faux_device_ops - a set of callbacks for a struct faux_device
* @probe: called when a faux device is probed by the driver core
* before the device is fully bound to the internal faux bus
* code. If probe succeeds, return 0, otherwise return a
* negative error number to stop the probe sequence from
* succeeding.
* @remove: called when a faux device is removed from the system
*
* Both @probe and @remove are optional, if not needed, set to NULL.
*/
struct faux_device_ops {
int (*probe)(struct faux_device *faux_dev);
void (*remove)(struct faux_device *faux_dev);
};
struct faux_device *faux_device_create(const char *name,
struct device *parent,
const struct faux_device_ops *faux_ops);
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);
void faux_device_destroy(struct faux_device *faux_dev);
static inline void *faux_device_get_drvdata(const struct faux_device *faux_dev)
{
return dev_get_drvdata(&faux_dev->dev);
}
static inline void faux_device_set_drvdata(struct faux_device *faux_dev, void *data)
{
dev_set_drvdata(&faux_dev->dev, data);
}
#endif /* _FAUX_DEVICE_H_ */
Annotation
- Immediate include surface: `linux/container_of.h`, `linux/device.h`.
- Detected declarations: `struct faux_device`, `struct faux_device_ops`, `function faux_device_set_drvdata`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.