STRUCT FWNODE_OPERATIONS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ struct fwnode_operations(9) ✨

okay so this is a page from the Kernel API Manual and bestie, it's literally the blueprint for struct fwnode_operations β€” the operations table for the fwnode interface πŸ’… like, every function pointer a firmware-node backend can implement lives right here. no cap.


🌸 NAME 🌸

struct fwnode_operations β€” the Operations for fwnode interface πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

here's the whole struct, verbatim, don't touch a single character or I will cry 😭

struct fwnode_operations {
    struct fwnode_handle *(*get)(struct fwnode_handle *fwnode);
    void (*put)(struct fwnode_handle *fwnode);
    bool (*device_is_available)(const struct fwnode_handle *fwnode);
    const void *(*device_get_match_data)(const struct fwnode_handle
*fwnode, const struct device *dev);
    bool (*device_dma_supported)(const struct fwnode_handle *fwnode);
    enum dev_dma_attr (*device_get_dma_attr)(const struct fwnode_handle
*fwnode);
    bool (*property_present)(const struct fwnode_handle *fwnode, const
char *propname);
    bool (*property_read_bool)(const struct fwnode_handle *fwnode, const
char *propname);
    int (*property_read_int_array)(const struct fwnode_handle *fwnode,
const char *propname, unsigned int elem_size, void *val, size_t nval);
    int (*property_read_string_array)(const struct fwnode_handle
*fwnode_handle, const char *propname, const char **val, size_t nval);
    const char *(*get_name)(const struct fwnode_handle *fwnode);
    const char *(*get_name_prefix)(const struct fwnode_handle *fwnode);
    struct fwnode_handle *(*get_parent)(const struct fwnode_handle
*fwnode);
    struct fwnode_handle * (*get_next_child_node)(const struct
fwnode_handle *fwnode, struct fwnode_handle *child);
    struct fwnode_handle * (*get_named_child_node)(const struct
fwnode_handle *fwnode, const char *name);
    int (*get_reference_args)(const struct fwnode_handle *fwnode, const
char *prop, const char *nargs_prop, unsigned int nargs, unsigned int
index, struct fwnode_reference_args *args);
    struct fwnode_handle * (*graph_get_next_endpoint)(const struct
fwnode_handle *fwnode, struct fwnode_handle *prev);
    struct fwnode_handle * (*graph_get_remote_endpoint)(const struct
fwnode_handle *fwnode);
    struct fwnode_handle * (*graph_get_port_parent)(struct fwnode_handle
*fwnode);
    int (*graph_parse_endpoint)(const struct fwnode_handle *fwnode,
struct fwnode_endpoint *endpoint);
    void __iomem *(*iomap)(struct fwnode_handle *fwnode, int index);
    int (*irq_get)(const struct fwnode_handle *fwnode, unsigned int
index);
    int (*add_links)(struct fwnode_handle *fwnode);
 };

like… that's a lot of function pointers. she's got range πŸ‘‘


πŸ’– Members πŸ’–

okay group chat, let's go through every single one, no skipping, we don't do that here 🫢

  • get β€” Get a reference to an fwnode. (grabby hands, but make it refcounting ✨)
  • put β€” Put a reference to an fwnode. (the breakup arc πŸ’”)
  • device_is_available β€” Return true if the device is available.
  • device_get_match_data β€” Return the device driver match data.
  • device_dma_supported β€” Return true if DMA is supported.
  • device_get_dma_attr β€” Return the device DMA attribute.
  • property_present β€” Return true if a property is present.
  • property_read_bool β€” Return a boolean property value.
  • property_read_int_array β€” Read an array of integer properties. Return zero on success, a negative error code otherwise. 🎯
  • property_read_string_array β€” Read an array of string properties. Return zero on success, a negative error code otherwise. 🎯
  • get_name β€” Return the name of an fwnode.
  • get_name_prefix β€” Get a prefix for a node (for printing purposes). πŸ‘€ for the aesthetic only
  • get_parent β€” Return the parent of an fwnode. (family tree moment 🌳)
  • get_next_child_node β€” Return the next child node in an iteration. πŸ”
  • get_named_child_node β€” Return a child node with a given name.
  • get_reference_args β€” Return a reference pointed to by a property, with args
  • graph_get_next_endpoint β€” Return an endpoint node in an iteration. πŸ”
  • graph_get_remote_endpoint β€” Return the remote endpoint node of a local endpoint node. (long distance relationship core 😭)
  • graph_get_port_parent β€” Return the parent node of a port node.
  • graph_parse_endpoint β€” Parse endpoint for port and endpoint id.
  • iomap β€” Map the I/O memory of a given index for a fwnode. πŸ—ΊοΈ
  • irq_get β€” Get the IRQ of a given index for a fwnode. ⚑
  • add_links β€” Create fwnode links to all the suppliers of the fwnode. Return zero on success, a negative error code otherwise. πŸ”—

πŸ‘‘ SEE ALSO πŸ‘‘

check these out, they're literally in the Kernel file ./include/linux/fwnode.h β€” go read them, iykyk πŸ“š

  • struct fwnode_endpoint(9)
  • struct fwnode_reference_args(9)

πŸ’€ friendly reminder that this is the interface, so if you're implementing one of these backends you're on the hook for making every pointer behave. no pressure or whatever πŸ’…

okay that's the whole page!! mwah πŸ’– and for the receipts: this came from ./include/linux, dated October 2026, and it's struct fwnode_operations(9) all the way down β€” periodt. πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from