Linux Kernel log 定義

#define FP_DEBUG
#ifdef FP_DEBUG
#define egislog_a(fmt,args...) printk(KERN_ALERT "[][ALERT]: %s: Line %d: " fmt, __FUNCTION__,__LINE__,## args)
#define egislog_d(fmt,args...) printk(KERN_DEBUG "[][DEBUG]: %s: Line %d: " fmt, __FUNCTION__,__LINE__,## args)
#define egislog_e(fmt,args...) printk(KERN_ERR "[][ERROR]: %s: Line %d: " fmt, __FUNCTION__,__LINE__,## args)
#define egislog_i(fmt,args...) printk(KERN_INFO "[]: %s: Line %d: " fmt, __FUNCTION__,__LINE__,## args)
//#define DEBUG_PRINT printk
#else
#define egislog_a(fmt,args...) printk(KERN_ALERT "[][ALERT]: %s: Line %d: " fmt, __FUNCTION__,__LINE__,## args)
#define egislog_d(fmt,args...)
#define egislog_e(fmt,args...) printk(KERN_ERR "[][ERROR]: %s: Line %d: " fmt, __FUNCTION__,__LINE__,## args)
#define egislog_i(fmt,args...) printk(KERN_INFO "[]: %s: " fmt, __FUNCTION__,## args)
#endif

 

 

static void spi_clk_enable(u8 bonoff)
{
 if (bonoff) {
  egislog_d("enable spi clk\n");
  mt_spi_enable_master_clk(g_data->spi);
 } else {
  egislog_d("disable spi clk\n");
  mt_spi_disable_master_clk(g_data->spi);
 }
}

發佈了9 篇原創文章 · 獲贊 0 · 訪問量 974
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章