#ifndef __DE_DEMO_H_ #define __DE_DEMO_H_ //操作设备的一层 struct driver { void (*Init)(struct driver *self); void* ops;//实际操作函数 void* pdata;//私有数据 }; #define U_BOOT_DRIVER(__name) struct driver __name##driver #define GetDRIVER_Name(__name) __name##driver #define PDATA_Name(driver) (driver->pdata) #endif