diff options
author | tzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2007-09-21 22:14:33 +0000 |
---|---|---|
committer | tzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2007-09-21 22:14:33 +0000 |
commit | dddf4218e96ea4d514f6c709a4493f644564f43c (patch) | |
tree | 28b8af033eaaed6ed65c624ffea6cc3fdd880bfc | |
parent | 7ebdb0caddab40157088db99a53377d1457bb0bf (diff) |
Sort out print messages in ztdummy:
* Proper priority to every message.
* Remove a useless global.
git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.4@3073 5390a7c7-147a-4af0-8ec9-7488f05a26cb
-rw-r--r-- | ztdummy.c | 32 |
1 files changed, 17 insertions, 15 deletions
@@ -124,7 +124,6 @@ static struct timer_list timer; /* Old UCHI stuff */ static uhci_desc_t *td; static uhci_t *s; -static int check_int = 0; static int monitor = 0; /* exported kernel symbols */ @@ -154,12 +153,12 @@ extern uhci_t **uhci_devices; static void update_rtc_rate(struct ztdummy *ztd) { if (((rtc_rate & (rtc_rate - 1)) != 0) || (rtc_rate > 8192) || (rtc_rate < 2)) { - printk("Invalid RTC rate %d specified\n", rtc_rate); + printk(KERN_NOTICE "Invalid RTC rate %d specified\n", rtc_rate); rtc_rate = current_rate; /* Set default RTC rate */ } if (!rtc_rate || (rtc_rate != current_rate)) { rtc_control(&ztd->rtc_task, RTC_IRQP_SET, current_rate = (rtc_rate ? rtc_rate : 1024)); /* 1024 Hz */ - printk("ztdummy: RTC rate is %d\n", rtc_rate); + printk(KERN_INFO "ztdummy: RTC rate is %d\n", rtc_rate); ztd->counter = 0; } } @@ -247,11 +246,14 @@ static void ztdummy_interrupt(int irq, void *dev_id, struct pt_regs *regs) status = inw (io_addr + USBSTS); if (status != 0) { /* interrupt from our USB port */ + static int check_int = 0; zt_receive(&ztd->span); zt_transmit(&ztd->span); - if (monitor && (check_int==0)) { /* for testing if interrupt gets triggered*/ + /* TODO: What's the relation between monitor and + * DEBUG_TICKS */ + if (monitor && check_int) { check_int = 1; - printk("ztdummy: interrupt triggered \n"); + printk(KERN_NOTICE "ztdummy: interrupt triggered \n"); } } return; @@ -292,26 +294,26 @@ int init_module(void) #endif if (uhci_devices==NULL) { - printk ("ztdummy: Uhci_devices pointer error.\n"); + printk (KERN_ERR "ztdummy: Uhci_devices pointer error.\n"); return -ENODEV; } s=*uhci_devices; /* uhci device */ if (s==NULL) { - printk ("ztdummy: No uhci_device found.\n"); + printk (KERN_ERR "ztdummy: No uhci_device found.\n"); return -ENODEV; } #endif ztd = kmalloc(sizeof(struct ztdummy), GFP_KERNEL); if (ztd == NULL) { - printk("ztdummy: Unable to allocate memory\n"); + printk(KERN_ERR "ztdummy: Unable to allocate memory\n"); return -ENOMEM; } memset(ztd, 0x0, sizeof(struct ztdummy)); if (ztdummy_initialize(ztd)) { - printk("ztdummy: Unable to intialize zaptel driver\n"); + printk(KERN_ERR "ztdummy: Unable to intialize zaptel driver\n"); kfree(ztd); return -ENODEV; } @@ -324,7 +326,7 @@ int init_module(void) ztd->rtc_task.private_data = ztd; err = rtc_register(&ztd->rtc_task); if (err < 0) { - printk("ztdummy: Unable to register zaptel rtc driver\n"); + printk(KERN_ERR "ztdummy: Unable to register zaptel rtc driver\n"); zt_unregister(&ztd->span); kfree(ztd); return err; @@ -336,16 +338,16 @@ int init_module(void) rtc_control(&ztd->rtc_task, RTC_PIE_ON, 0); tasklet_init(&ztd_tlet, ztd_tasklet, 0); #elif defined(USE_HIGHRESTIMER) - printk("ztdummy: Trying to load High Resolution Timer\n"); + printk(KERN_DEBUG "ztdummy: Trying to load High Resolution Timer\n"); hrtimer_init(&zaptimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); - printk("ztdummy: Initialized High Resolution Timer\n"); + printk(KERN_DEBUG "ztdummy: Initialized High Resolution Timer\n"); /* Set timer callback function */ zaptimer.function = ztdummy_hr_int; - printk("ztdummy: Starting High Resolution Timer\n"); + printk(KERN_DEBUG "ztdummy: Starting High Resolution Timer\n"); hrtimer_start(&zaptimer, ktime_set(0, ZAPTEL_TIME_NS), HRTIMER_MODE_REL); - printk("ztdummy: High Resolution Timer started, good to go\n"); + printk(KERN_INFO "ztdummy: High Resolution Timer started, good to go\n"); #else init_timer(&timer); timer.function = ztdummy_timer; @@ -375,7 +377,7 @@ int init_module(void) #endif if (debug) - printk("ztdummy: init() finished\n"); + printk(KERN_DEBUG "ztdummy: init() finished\n"); return 0; } |