nfc_set_drvdata(9)
πΈ 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 avoid *, 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 rightnfc_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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms