From: Paul M. <le...@us...> - 2002-03-10 10:23:44
|
Update of /cvsroot/linux-mips/linux/drivers/char In directory usw-pr-cvs1:/tmp/cvs-serv18924/drivers/char Modified Files: vrc4173-ps2u.c Log Message: Don't try and read from the Vrc4173 if one doesn't exist, bail out sanely instead. Index: vrc4173-ps2u.c =================================================================== RCS file: /cvsroot/linux-mips/linux/drivers/char/vrc4173-ps2u.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- vrc4173-ps2u.c 18 Jan 2002 21:22:23 -0000 1.1 +++ vrc4173-ps2u.c 10 Mar 2002 10:23:42 -0000 1.2 @@ -348,6 +348,15 @@ unsigned short val; int retval; + /* + * Don't continue on unless a valid Vrc4173 exists. Otherwise the next + * read will Oops.. + */ + if (!vrc4173_pci_dev) { + printk(KERN_ERR "%s(): Couldn't find a NEC Vrc4173\n", __FUNCTION__); + return -ENODEV; + } + val = vrc4173_inw(VRC4173_SELECTREG); val |= VRC4173_SELECTREG_SEL2; vrc4173_outw(val, VRC4173_SELECTREG); |