sdio_readw(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– sdio_readw β€” bestie edition πŸ’–

okay so real talk, this one lives in the Kernel API Manual and it's literally just "read a 16 bit integer from a SDIO function" and honestly? iconic. tiny little function, does exactly one thing, slays. πŸŽ€


✨ SYNOPSIS ✨

u16 sdio_readw (struct sdio_func *func , unsigned int addr , int
*err_ret );

like, that's the whole vibe. three args, one u16 coming back at you. πŸ’…


🌸 ARGUMENTS 🌸

  • func β€” the SDIO function you wanna access. your main character. the one you're talking to. 🫢
  • addr β€” the address you're reading from. yes bestie, this exact one, no cap. πŸ“
  • err_ret β€” optional status value from the transfer. it's optional so like, you can pass NULL, but then you're reading on hard mode ngl. πŸ™ˆ

πŸ¦‹ DESCRIPTION πŸ¦‹

So the way this works: sdio_readw reads a 16 bit integer out of the address space of a given SDIO function. that's it, that's the whole job, and it eats every time. ✨

BUT β€” and this is the important part, listen to me β€” if there's a problem reading the address, it returns 0xffff and err_ret will contain the error code. so like, if you get 0xffff back, don't just assume the hardware said 0xffff?? check err_ret first, fr fr. that's your vibe check. πŸ˜­πŸ’€

ngl this is the kind of thing that bites you at 3am. 0xffff is both a valid-looking number AND the error sentinel, so please please please actually read err_ret. 🧚

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./drivers/mmc/core/sdio_io.c β€” go read the source, it's giving open book exam. πŸ“–

like yes that's a lot of besties but they're all in the same friend group, iykyk. 🌈


mwah πŸ’‹ this page lives in ./drivers/mmc/core and it's dated October 2026 β€” that's the source, the version, and the whole entire footer, periodt. go read your 16 bits responsibly. πŸ“πŸ’œ

πŸ“¦ where this page comes from