Added a missing return statement in paired_grant().
Removed lots of unused variables.
This commit is contained in:
@@ -4,8 +4,6 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <minix/sysutil.h>
|
||||
#include <errno.h>
|
||||
|
||||
|
||||
|
||||
@@ -430,9 +430,7 @@ PRIVATE int AC97_get_volume(struct volume_level *level) {
|
||||
&(level->left), &(level->right), 0x1f, 1);
|
||||
break;
|
||||
case Speaker:
|
||||
cmd = AC97_PC_BEEP_VOLUME;
|
||||
return EINVAL;
|
||||
break;
|
||||
case Treble:
|
||||
cmd = AC97_MASTER_TONE;
|
||||
get_volume(&left, &right, cmd);
|
||||
@@ -464,7 +462,6 @@ PRIVATE int AC97_set_volume(struct volume_level *level) {
|
||||
break;
|
||||
case Dac:
|
||||
return EINVAL;
|
||||
break;
|
||||
case Fm:
|
||||
cmd = AC97_PCM_OUT_VOLUME;
|
||||
convert(level->left, level->right, 0x1f, &left, &right, 0x1f, 0);
|
||||
@@ -482,17 +479,11 @@ PRIVATE int AC97_set_volume(struct volume_level *level) {
|
||||
convert(level->left, level->right, 0x1f, &left, &right, 0x1f, 1);
|
||||
break;
|
||||
case Speaker:
|
||||
cmd = AC97_PC_BEEP_VOLUME;
|
||||
return EINVAL;
|
||||
break;
|
||||
case Treble:
|
||||
cmd = AC97_MASTER_TONE;
|
||||
return EINVAL;
|
||||
break;
|
||||
case Bass:
|
||||
cmd = AC97_MASTER_TONE;
|
||||
return EINVAL;
|
||||
break;
|
||||
default:
|
||||
return EINVAL;
|
||||
}
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <minix/sysutil.h>
|
||||
#include <errno.h>
|
||||
|
||||
|
||||
|
||||
@@ -1,25 +1,24 @@
|
||||
#include "../../drivers.h"
|
||||
#include <sys/types.h>
|
||||
#include <time.h>
|
||||
#include "pci_helper.h"
|
||||
|
||||
|
||||
int WaitBitd (int paddr, int bitno, int state, long tmout)
|
||||
{
|
||||
unsigned long val, mask;
|
||||
unsigned long mask;
|
||||
|
||||
mask = 1UL << bitno;
|
||||
tmout *= 5000;
|
||||
|
||||
if(state) {
|
||||
while(tmout-- > 0) {
|
||||
if((val = pci_inl(paddr)) & mask) {
|
||||
if(pci_inl(paddr) & mask) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
while(tmout-- > 0) {
|
||||
if(!((val = pci_inl(paddr)) & mask)) {
|
||||
if(!(pci_inl(paddr) & mask)) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -576,7 +576,6 @@ PRIVATE void msg_read(message *m_ptr)
|
||||
PRIVATE void msg_hardware(void) {
|
||||
|
||||
u32_t i;
|
||||
int j = 0;
|
||||
|
||||
dprint("%s: handling hardware message\n", drv.DriverName);
|
||||
|
||||
@@ -659,7 +658,6 @@ PRIVATE void msg_sig_stop(void)
|
||||
PRIVATE void handle_int_write(int sub_dev_nr)
|
||||
{
|
||||
sub_dev_t *sub_dev_ptr;
|
||||
int r;
|
||||
|
||||
sub_dev_ptr = &sub_dev[sub_dev_nr];
|
||||
|
||||
@@ -710,7 +708,7 @@ PRIVATE void handle_int_write(int sub_dev_nr)
|
||||
drv_reenable_int(sub_dev_nr);
|
||||
#if 0
|
||||
/* reenable irq_hook*/
|
||||
if ((r=sys_irqenable(&irq_hook_id)) != OK) {
|
||||
if (sys_irqenable(&irq_hook_id != OK) {
|
||||
error("%s Couldn't enable IRQ\n", drv.DriverName);
|
||||
}
|
||||
#endif
|
||||
@@ -720,7 +718,7 @@ PRIVATE void handle_int_write(int sub_dev_nr)
|
||||
/* handle interrupt for specified sub device; DmaMode == DEV_READ_S */
|
||||
PRIVATE void handle_int_read(int sub_dev_nr)
|
||||
{
|
||||
sub_dev_t *sub_dev_ptr; int r,i;
|
||||
sub_dev_t *sub_dev_ptr;
|
||||
|
||||
sub_dev_ptr = &sub_dev[sub_dev_nr];
|
||||
|
||||
@@ -765,7 +763,7 @@ PRIVATE void handle_int_read(int sub_dev_nr)
|
||||
|
||||
#if 0
|
||||
/* reenable irq_hook*/
|
||||
if ((r=sys_irqenable(&irq_hook_id)) != OK) {
|
||||
if (sys_irqenable(&irq_hook_id) != OK) {
|
||||
error("%s: Couldn't reenable IRQ", drv.DriverName);
|
||||
}
|
||||
#endif
|
||||
@@ -773,7 +771,7 @@ PRIVATE void handle_int_read(int sub_dev_nr)
|
||||
|
||||
|
||||
PRIVATE int get_started(sub_dev_t *sub_dev_ptr) {
|
||||
u32_t i;char c;
|
||||
u32_t i;
|
||||
|
||||
/* enable interrupt messages from MINIX */
|
||||
if ((i=sys_irqenable(&irq_hook_id)) != OK) {
|
||||
|
||||
@@ -73,7 +73,7 @@ PUBLIC int drv_init(void) {
|
||||
|
||||
|
||||
PUBLIC int drv_init_hw(void) {
|
||||
int i, s;
|
||||
int i;
|
||||
int DspVersion[2];
|
||||
dprint("drv_init_hw():\n");
|
||||
|
||||
@@ -413,7 +413,7 @@ PRIVATE int dsp_get_max_frag_size(u32_t *val, int *len) {
|
||||
|
||||
|
||||
PUBLIC int dsp_command(int value) {
|
||||
int i, status;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < SB_TIMEOUT; i++) {
|
||||
if((sb16_inb(DSP_STATUS) & 0x80) == 0) {
|
||||
|
||||
Reference in New Issue
Block a user