platform-device-model

platform-device-model is a skill for Claude Code, Codex from mohitmishra786/low-level-dev-skills. It costs 57 tokens per session (868 once invoked), scanned A, original, MIT.

A guide to Linux’s platform device model, which connects hardware descriptions to driver code. It covers driver setup and removal, hardware resources, sysfs entries, and delayed device probing.

In plain words
What is it for?
Use it when writing or debugging Linux platform drivers, handling device-tree hardware, exposing driver settings through sysfs, or investigating probe and remove behavior.
Why use it?
It explains the parts that make a platform driver attach to the right device and clean up safely. This helps when a driver does not load or its device state is not visible to user space.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when writing or debugging Linux platform drivers, handling device-tree hardware, exposing driver settings through sysfs, or investigating probe and remove behavior.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mohitmishra786/low-level-dev-skills/platform-device-model
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add mohitmishra786/low-level-dev-skills --skill platform-device-model
Clone the repo
git clone --depth 1 https://github.com/mohitmishra786/low-level-dev-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for platform-device-model

README.md
[![agentmods](https://agentmods.dev/badge/skills/mohitmishra786/low-level-dev-skills/platform-device-model/github.svg)](https://agentmods.dev/skills/mohitmishra786/low-level-dev-skills/platform-device-model)
Your own site
<a href="https://agentmods.dev/skills/mohitmishra786/low-level-dev-skills/platform-device-model"><img src="https://agentmods.dev/badge/skills/mohitmishra786/low-level-dev-skills/platform-device-model/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for platform-device-model

Your own site · 80×15
<a href="https://agentmods.dev/skills/mohitmishra786/low-level-dev-skills/platform-device-model"><img src="https://agentmods.dev/badge/skills/mohitmishra786/low-level-dev-skills/platform-device-model.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 57 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 868 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00057 $0.00868
Opus 5.5 $0.00023 $0.00347
Sonnet 5.5 $0.00011 $0.00174
Haiku 4.5 $0.00006 $0.00087

Measured 9d ago against content hash 793716d02c92, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

platform-device-model scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/kernel-dev/platform-device-model/SKILL.md · 125 lines

How it starts

The opening of the file, as written. The whole thing — 125 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Platform Device Model

Purpose

Explain the Linux driver model for platform (and similar) buses: struct device, device_driver, probe/remove, resource acquisition, sysfs, and deferred probe — the glue between device tree and driver code.

Triggers

  • Implementing or debugging platform_driver lifecycle
  • Exposing driver state via sysfs
  • Understanding uevent / udev device node creation
  • Before skills/kernel-dev/writing-char-drivers

Workflow

1. Object hierarchy

bus_type (platform, amba, pci, i2c, spi)
├── struct device        — hardware instance
└── struct device_driver — driver logic
        └── probe(dev) / remove(dev)

Platform devices often come from DT (of_platform) or legacy board files.

2. Platform driver skeleton

static int my_probe(struct platform_device *pdev)
{
    struct resource *res;
    void __iomem *base;

    res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
    base = devm_ioremap_resource(&pdev->dev, res);
    if (IS_ERR(base))
        return PTR_ERR(base);

    platform_set_drvdata(pdev, priv);
    return 0;
}

static void my_remove(struct platform_device *pdev)
{
    /* devm_* auto-cleanup on remove */
}

static struct platform_driver my_pdrv = {
    .probe  = my_probe,
    .remove = my_remove,
    .driver = {
        .name = "my-dev",
        .of_match_table = my_of_match,
    },
};
module_platform_driver(my_pdrv);

Prefer devm_* helpers for automatic unwind.

3. Device properties (DT / ACPI)

u32 speed;
device_property_read_u32(&pdev->dev, "clock-speed", &speed);
bool flag = device_property_present(&pdev->dev, "feature-x");

4. Sysfs (driver visibility)

static ssize_t status_show(struct device *dev,
                           struct device_attribute *attr, char *buf)
{
    return sysfs_emit(buf, "ok\n");
}
static DEVICE_ATTR_RO(status);

/* in probe */
device_create_file(&pdev->dev, &dev_attr_status);

5. Deferred probe

Return -EPROBE_DEFER when a clock, regulator, or bus is not ready — core retries later.

Read the full file on GitHub · 125 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago Changed · +1 lines 793716d02c92
  2. 2mo ago First seen · 124 lines · 57 tokens per session scan A c87f0f9a5a76

Subscribe to this mod's changes

platform-device-model is a skill published in the GitHub repository mohitmishra786/low-level-dev-skills (304 stars, last pushed 10d ago), licensed MIT. It adds 57 tokens to every session and 868 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

platform-device-model compared with skills from other repositories

platform-device-model next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
platform-device-modelmohitmishra786/low-level-dev-skillsSkill30410d agoMITA57Claude Code, Codex
gke-ai-troubleshooting-tpu-dynamic-slices-monitoringgoogle/skillsSkill25ktodayApache-2.0A107Claude Code, Codex
gke-ai-troubleshooting-tpu-vbar-oomgoogle/skillsSkill25ktodayApache-2.0A125Claude Code, Codex
doca-flowNVIDIA/skillsSkill4.2k2d agoApache-2.0A224Claude Code
diagnose-driver-installNVIDIA/deepopsSkill1.5k3d agoBSD-3-ClauseA47Claude Code, Codex
gtrace-path-analysisautomateyournetwork/netclawSkill739todayApache-2.0A156Claude Code
eidezhinkgit/embeddedskillsSkill8164d agoMITA151Claude Code