Linux device driver


Driver porting: Device model overview:
The Linux Kernel Driver Model

Formal causes


ULK 3rd


ioremap() and memremap()

Device tree

  • What infomation was included in dtb
    HW platform识别,runtime parameter传递以及硬件设备描述
    for platform device init see arch/powerpc/platforms/52xx/media5200.c ppc_init
  • How does the device tree subsystem read and parse the dts file?
  • devm_kfree
    devm_kfree does not need for fail case of probe function and for remove function.
  • a must use devm_kfree Julia Lawall
    The function at91_dt_node_to_map is ultimately called by the function
    > pinctrl_get, which is an exported function. Since it is possible that this
    > function is not called from within a probe function, for safety, the kfree
    > is converted to a devm_kfree, to both free the data and remove it from the
    > device in a failure situation.
    *for noop devm_kmalloc_release
    devm_kmalloc()->dr = alloc_dr(devm_kmalloc_release, size, gfp);
    see release_nodes() ->kfree(dr);