/* Keep track of adapters which will be added or removed later */res = bus_register_notifier(&i2c_bus_type, &i2cdev_notifier);int bus_register_notifier(struct bus_type *bus, struct notifier_block *nb) { return blocking_n...【阅读全文】
container_of()宏在学习Linux驱动的过程中,遇到一个宏叫做container_of。该宏定义在include/linux/kernel.h中,首先来贴出它的代码:/** * container_of - cast a member of a structure out to the containing structure * @ptr: the pointer to the ...【阅读全文】
Linux Power Managment谨以此文纪念过往的岁月一.前言在这个对节能要求越来越严格的年代,对设备的电源管理就显的很重要的了,尤其对于可移动设备,在电源有限的情况下,续航能力就显的很重要的。在本文中将介绍linux是如何对设备电源进行管理的。二.睡眠Linux的电源管理的主要几个文...【阅读全文】