ahci_platform_get_resources(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ‘‘ ahci_platform_get_resources(9) πŸ’…

okay so this is a page straight out of the Kernel API Manual, bestie, and it's about grabbing up all the platform resources an AHCI host is gonna need. it's giving "setup era" and honestly? iconic.


✨ NAME ✨

ahci_platform_get_resources β€” Get platform resources πŸŽ€


🌸 SYNOPSIS 🌸

struct ahci_host_priv * ahci_platform_get_resources (struct
platform_device *pdev , unsigned int flags );

like literally that's the whole signature, no cap 🫢


πŸ¦‹ ARGUMENTS πŸ¦‹

  • pdev β€” the platform device you're getting resources for. it's the main character here, we're doing this all for them πŸ’–
  • flags β€” a bitmap representing the resource(s) to get. bitmask vibes ✨

πŸ’œ DESCRIPTION πŸ’œ

so what this function does is: it allocates an ahci_host_priv struct, and then it goes and gets the following resources, storing a reference to each one inside that returned struct. it's like packing a little resource lunchbox πŸ“

  1. mmio registers (IORESOURCE_MEM 0, mandatory) β€” non-negotiable, this one is not optional bestie, it's required periodt.
  2. regulator for controlling the targets power (optional) and a regulator for controlling the AHCI controller (optional) β€” two regulators, both optional, both living their best life 🌈
  3. all clocks specified in the devicetree node, or a single clock for non-OF platforms (optional) β€” so it's either the whole clock squad or just the one, depending on whether you're OF or not 🧚
  4. resets, if flags has AHCI_PLATFORM_GET_RESETS (optional) β€” and only if that flag is set, iykyk πŸ‘€
  5. phys (optional) β€” last but not least, also optional πŸ’«
ngl the "optional" tag is doing a lot of heavy lifting on this page and we respect it πŸ™ˆ

πŸ”₯ RETURN πŸ”₯

The allocated ahci_host_priv on success β€” slay πŸ’… β€” otherwise an ERR_PTR value. so always check, bestie, fr fr 😭


πŸŽ€ SEE ALSO πŸŽ€

Kernel file ./drivers/ata/libahci_platform.c β€” that's the source of truth, go read it 🌟

then the whole friend group, in order:


and that's the whole page!! 🫢 shoutout to the ./drivers/ata source and the October 2026 date stamp β€” this one was served fresh πŸ’–βœ¨ go get those resources, queen πŸ‘‘

πŸ“¦ where this page comes from