Skip to content

Linux Driver Release Checklist

Overview

This document defines a minimal and practical checklist before releasing a custom Linux driver.

The goal is to ensure:

  • build correctness
  • basic code quality
  • deployment readiness
  • runtime functionality

This checklist is designed for out-of-tree drivers with Device Tree overlays.


1. Build Validation

1.1 Clean build

make clean
make

Requirements:

  • no build errors
  • no unexpected warnings

1.2 Cross build (if applicable)

make -f Makefile.cross

Verify:

  • correct toolchain
  • correct target architecture
  • no vermagic mismatch risk

1.3 Device Tree build

dtc -@ -I dts -O dtb -o mysensor.dtbo mysensor.dts

Requirements:

  • no syntax errors
  • no critical warnings
  • no unit_address conflicts
  • no reg_format issues

2. Static Code Checks

2.1 checkpatch

./scripts/checkpatch.pl --no-tree --file mysensor_core.c mysensor_i2c.c mysensor_spi.c

Acceptable:

  • minor style warnings

Not acceptable:

  • ERROR level issues
  • obvious kernel API misuse

2.2 sparse (semantic check)

make C=1 CHECK="sparse" modules

Focus on:

  • pointer type mismatch
  • user-space pointer misuse
  • missing __user annotation
  • endian issues

2.3 (Optional) coccicheck

make coccicheck

Useful for:

  • API misuse patterns
  • deprecated usage
  • missing error handling

3. Module Metadata Check

3.1 modinfo

modinfo mysensor_i2c_drv.ko
modinfo mysensor_spi_drv.ko

Verify:

  • version matches release
  • license is correct
  • description is present

4. Installation Validation

4.1 Copy files

sudo cp *.ko /lib/modules/$(uname -r)/extra/
sudo cp *.dtbo /boot/firmware/overlays/
sudo depmod -a

4.2 Apply overlay

sudo dtoverlay mysensor-i2c
sudo dtoverlay mysensor-spi

Verify:

dtoverlay -l

4.3 Load module

sudo modprobe mysensor_i2c_drv
sudo modprobe mysensor_spi_drv

Verify:

dmesg | grep mysensor

5. Runtime Validation

5.1 Device presence

ls /sys/bus/i2c/devices/
ls /sys/bus/spi/devices/

5.2 Driver binding

ls /sys/bus/i2c/drivers/mysensor_i2c/
ls /sys/bus/spi/drivers/mysensor_spi/

5.3 Functional check

  • CHIP_ID read must match expected value
  • no unexpected 0x00 read
  • no probe failure

5.4 hwmon interface

ls /sys/class/hwmon/
cat /sys/class/hwmon/hwmonX/temp1_input

5.5 debug interface

cat /sys/class/hwmon/hwmonX/debug_status

Verify:

  • correct bus (i2c / spi)
  • correct mode (irq / poll)
  • counters increment correctly

5.6 IRQ validation

cat /proc/interrupts

Verify:

  • IRQ count increases when triggered

5.7 Polling validation

Verify:

  • polling mode works when IRQ disabled
  • no mixed behavior between IRQ and polling

6. Conflict Check

6.1 spidev conflict

ls /dev/spidev*

Expected:

  • no spidev if custom SPI driver is used

6.2 Chip select ownership

Check:

  • no "chipselect already in use" error
  • correct CE mapping

7. Version Consistency

Ensure consistency across:

  • VERSION file
  • README
  • package name
  • MODULE_VERSION()

8. Release Packaging

8.1 Package structure

mysensor-driver-vX.Y.Z/
├── i2c/
├── spi/
├── README.md
├── RELEASE_NOTES.md
└── VERSION

8.2 Final checks

  • install script works
  • uninstall script works
  • no hardcoded paths
  • no debug leftover logs

9. Minimum Release Criteria

A release is considered valid if:

  • build succeeds
  • dtbo compiles clean
  • module loads successfully
  • device probes successfully
  • functional read/write works
  • IRQ and polling both validated
  • no resource conflicts

Summary

This checklist ensures that the driver:

  • builds cleanly
  • integrates correctly with the kernel
  • binds correctly to hardware
  • functions correctly at runtime
  • can be deployed reproducibly

It is intentionally lightweight but sufficient for most custom driver releases.