/* 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_
/** * 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);
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.