nfc_set_drvdata(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 nfc_set_drvdata(9) 🌸

okay bestie, so this is a page from the Kernel API Manual (yes, the kernel kernel, we're being iconic today πŸ’…), and it's about the lil function that tucks your driver's very own data into an NFC device. no cap, it's a one-liner of a function but it's important. let's get into it 🫢


✨ NAME ✨

nfc_set_drvdata β€” set driver specific data πŸ’Ύ

like, you're literally attaching your driver's personal little payload to the device. main character energy for your private pointer, fr fr.


πŸŽ€ SYNOPSIS πŸŽ€

void nfc_set_drvdata (struct nfc_dev *dev , void *data );

that's it. that's the whole vibe. it returns void, so don't go looking for a return value, there isn't one, periodt. πŸ’€


πŸ¦‹ ARGUMENTS πŸ¦‹

  • dev β€” The nfc device 🌈 β€” the NFC device you're handing over, the one that's gonna carry your data around.
  • data β€” Pointer to driver specific data πŸ“ β€” whatever your driver wants to stash there. it's a void *, so the function is not judging you, it's not checking, it's just holding your pointer. lowkey the most accepting function in the kernel.
bestie reminder: data is literally just a pointer. what it points at, and whether it stays valid, is your business β€” this page doesn't promise anything beyond handing it over, iykyk πŸ™ˆ

πŸ‘‘ SEE ALSO πŸ‘‘

go read these next, they're all in the same friend group:

  • Kernel file ./include/net/nfc/nfc.h β€” the header where all this lives, the mothership ⭐
  • struct nfc_target(9) β€” the target struct, iconic in its own right
  • nfc_free_device(9) β€” the cleanup bestie, because every device eventually has to go 🧹
  • nfc_set_parent_dev(9) β€” sets up the parent device, family tree vibes 🌸
  • nfc_get_drvdata(9) β€” the getter to this setter, they're a matching set, obsessed πŸ’–
  • nfc_device_name(9) β€” gives your device a name, slay πŸ’…
  • nfc_vendor_cmd_alloc_reply_skb(9) β€” allocates a reply skb for vendor commands, allocating queen energy πŸ”₯

πŸ’œ a lil sign-off πŸ’œ

this page lives in ./include/net/nfc and it was dated October 2026 β€” so yeah, it's from the future, we love a forward-thinking manual. the whole thing is titled nfc_set_drvdata(9) and if you got this far, you ate. no crumbs. go set some driver data, bestie πŸŽ€βœ¨πŸ¦‹

mwah πŸ’‹

πŸ“¦ where this page comes from