Files
RedBear-OS/local/recipes/gpu/amdgpu-source/include/linux/device/faux.h
T
vasilito dc68054305 restore lost packages from 0.2.3 + fix overwritten 0.2.4 files
- Restore 29 recipe symlinks (libdrm, qtbase, dbus, sddm, pipewire, etc.)
- Restore 33 patches (KDE, libdrm, mesa, pipewire, sddm, wireplumber)
- Restore 20+ local/scripts (audit, lint, test, build helpers)
- Restore src/cook/scheduler.rs, status.rs, gnu-config/
- Restore scripts/patch-inclusion-gate.sh, run_mini1.sh, validate-collision-log.sh
- Recover TLC source from HEAD (was overwritten by 0.2.3 checkout)
- Recover 11 local/docs plans from HEAD (were overwritten)
- Recover qt6-wayland-smoke symlink from HEAD
- Fix MOTD: remove garbled ASCII art, use clean text
- Update version: 0.2.0 -> 0.2.4 in os-release, motd, config
- Reduce filesystem_size: 1536 -> 512 MiB
- Add ABSOLUTE RULE to AGENTS.md: never delete/ignore packages
- Reduce pcid scheme log verbosity: info -> debug
2026-06-19 12:39:14 +03:00

70 lines
2.4 KiB
C

/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2025 Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Copyright (c) 2025 The Linux Foundation
*
* A "simple" faux bus that allows devices to be created and added
* automatically to it. This is to be used whenever you need to create a
* device that is not associated with any "real" system resources, and do
* not want to have to deal with a bus/driver binding logic. It is
* intended to be very simple, with only a create and a destroy function
* available.
*/
#ifndef _FAUX_DEVICE_H_
#define _FAUX_DEVICE_H_
#include <linux/container_of.h>
#include <linux/device.h>
/**
* struct faux_device - a "faux" device
* @dev: internal struct device of the object
*
* A simple faux device that can be created/destroyed. To be used when a
* driver only needs to have a device to "hang" something off. This can be
* used for downloading firmware or other basic tasks. Use this instead of
* a struct platform_device if the device has no resources assigned to
* it at all.
*/
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_ */