summaryrefslogtreecommitdiff
path: root/snd-pcxhr-dkms/src/pcxhr_clock_monitoring.c
diff options
context:
space:
mode:
Diffstat (limited to 'snd-pcxhr-dkms/src/pcxhr_clock_monitoring.c')
-rw-r--r--snd-pcxhr-dkms/src/pcxhr_clock_monitoring.c38
1 files changed, 12 insertions, 26 deletions
diff --git a/snd-pcxhr-dkms/src/pcxhr_clock_monitoring.c b/snd-pcxhr-dkms/src/pcxhr_clock_monitoring.c
index 2be208d..74043c0 100644
--- a/snd-pcxhr-dkms/src/pcxhr_clock_monitoring.c
+++ b/snd-pcxhr-dkms/src/pcxhr_clock_monitoring.c
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Driver for Digigram pcxhr compatible soundcards
*
* Copyright (c) 2004 by Digigram <alsa@digigram.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
@@ -47,7 +34,7 @@ void clock_monitoring_treatment(struct pcxhr_mgr *mgr) {
if( mgr->use_clock_type != PCXHR_CLOCK_TYPE_INTERNAL ) { //on est cencé être sur de l AES
pcxhr_get_external_clock(mgr,mgr->use_clock_type,&rate);
if( rate == 0 ) {
- snd_printk(KERN_ERR "\tpcxhr_clock_monitoring_tasklet external clock disappears...\n");
+ dev_err(&mgr->pci->dev, "\tpcxhr_clock_monitoring_tasklet external clock disappears...\n");
mgr->expected_clock_type = mgr->use_clock_type;
mgr->use_clock_type = PCXHR_CLOCK_TYPE_INTERNAL;
pcxhr_set_clock(mgr, mgr->sample_rate_real);
@@ -56,14 +43,14 @@ void clock_monitoring_treatment(struct pcxhr_mgr *mgr) {
else { //on est déjà sur l horloge interne on test si l aes est de retour
pcxhr_get_external_clock(mgr,mgr->expected_clock_type,&rate);
if( rate != 0) {
- snd_printk(KERN_ERR "\tpcxhr_clock_monitoring_tasklet external clock reappears...\n");
+ dev_err(&mgr->pci->dev, "\tpcxhr_clock_monitoring_tasklet external clock reappears...\n");
mgr->use_clock_type = mgr->expected_clock_type;
pcxhr_set_clock(mgr, rate);
}
}
mutex_unlock(&mgr->timer_mutex);
}else {
- snd_printk(KERN_ERR "\tclock_monitoring_treatment mgr pointer null\n");
+ dev_err(&mgr->pci->dev, "\tclock_monitoring_treatment mgr pointer null\n");
}
}
@@ -74,10 +61,9 @@ int clock_monitoring_thread(void *ptr) {
while (1){
set_current_state(TASK_INTERRUPTIBLE);
schedule();
- //snd_printk(KERN_ERR "+");
clock_monitoring_treatment(mgr);
}
- snd_printk(KERN_INFO "clock_monitoring_thread on sort\n");
+ dev_info(&mgr->pci->dev, "clock_monitoring_thread on sort\n");
return 0;
}
@@ -87,7 +73,7 @@ int clock_monitoring_thread_init(struct pcxhr_mgr *mgr) {
mgr->thread = kthread_create(clock_monitoring_thread,mgr,our_thread);
if(mgr->thread == NULL) {
- snd_printk(KERN_ERR "clock_monitoring_thread_init kthread_create FAILED\n");
+ dev_err(&mgr->pci->dev, "clock_monitoring_thread_init kthread_create FAILED\n");
return -ENOMEM;
}
wake_up_process(mgr->thread);
@@ -106,7 +92,7 @@ static void clockMonitor_timedout(unsigned long ptr) {
}
if(mgr->timer_state == 0) {
- snd_printk(KERN_INFO "\tclockMonitor_timedout timer should stop do not reload it\n");
+ dev_info(&mgr->pci->dev, "\tclockMonitor_timedout timer should stop do not reload it\n");
}
}
@@ -115,7 +101,7 @@ int clockMonitor_stop(struct pcxhr_mgr *mgr){
int result = 0;
mutex_lock(&mgr->timer_mutex);
- snd_printk(KERN_INFO " clockMonitor_stop %s\n", mgr->shortname);
+ dev_info(&mgr->pci->dev, " clockMonitor_stop %s\n", mgr->shortname);
if((mgr->clockMonitor_timer != NULL)&& (mgr->timer_state == 1)) {
// result = del_timer(mgr->clockMonitor_timer);
result = del_timer_sync(mgr->clockMonitor_timer);
@@ -128,7 +114,7 @@ int clockMonitor_stop(struct pcxhr_mgr *mgr){
int clockMonitor_start(struct pcxhr_mgr *mgr){
mutex_lock(&mgr->timer_mutex);
if(mgr->timer_state == 0) { //déjà était démarré...
- snd_printk(KERN_INFO "clockMonitor_start %s\n", mgr->shortname);
+ dev_info(&mgr->pci->dev, "clockMonitor_start %s\n", mgr->shortname);
init_timer(mgr->clockMonitor_timer);
mgr->clockMonitor_timer->function = clockMonitor_timedout;
@@ -143,13 +129,13 @@ int clockMonitor_start(struct pcxhr_mgr *mgr){
int clockMonitor_init(struct pcxhr_mgr *mgr){
- snd_printk(KERN_INFO "clockMonitor_init %s\n", mgr->shortname);
+ dev_info(&mgr->pci->dev, "clockMonitor_init %s\n", mgr->shortname);
mutex_init(&mgr->timer_mutex);
mgr->clockMonitor_timer = (struct timer_list*) kmalloc(sizeof(struct timer_list), GFP_KERNEL);
if(mgr->clockMonitor_timer == NULL){
- snd_printk(KERN_INFO "clockMonitor_init failed mgr->clockMonitor_timer NULL\n");
+ dev_info(&mgr->pci->dev, "clockMonitor_init failed mgr->clockMonitor_timer NULL\n");
return -ENOMEM;
}
//init_timer(mgr->clockMonitor_timer);
@@ -160,7 +146,7 @@ int clockMonitor_init(struct pcxhr_mgr *mgr){
}
int clockMonitor_free(struct pcxhr_mgr *mgr){
- snd_printk(KERN_INFO "clockMonitor_free %s\n", mgr->shortname);
+ dev_info(&mgr->pci->dev, "clockMonitor_free %s\n", mgr->shortname);
if (mgr->clockMonitor_timer != NULL)
{