aboutsummaryrefslogtreecommitdiffstats
path: root/parport.c
diff options
context:
space:
mode:
authorreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2003-09-09 06:54:43 +0000
committerreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2003-09-09 06:54:43 +0000
commitdd4d20ad1a3970752a4fe81c95c164bf751c0f16 (patch)
treec78e80eb3a22e818c6039ca5aa68c7f46000fd94 /parport.c
parentca55019e85e081afe878a93ba0dc83a44d862de9 (diff)
downloadlcd4linux-dd4d20ad1a3970752a4fe81c95c164bf751c0f16.tar.gz
[lcd4linux @ 2003-09-09 06:54:43 by reinelt]
new function 'cfg_number()' git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@233 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
Diffstat (limited to '')
-rw-r--r--parport.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/parport.c b/parport.c
index 5c9956d..204ba20 100644
--- a/parport.c
+++ b/parport.c
@@ -1,4 +1,4 @@
-/* $Id: parport.c,v 1.7 2003/08/24 05:17:58 reinelt Exp $
+/* $Id: parport.c,v 1.8 2003/09/09 06:54:43 reinelt Exp $
*
* generic parallel port handling
*
@@ -20,6 +20,9 @@
*
*
* $Log: parport.c,v $
+ * Revision 1.8 2003/09/09 06:54:43 reinelt
+ * new function 'cfg_number()'
+ *
* Revision 1.7 2003/08/24 05:17:58 reinelt
* liblcd4linux patch from Patrick Schemitz
*
@@ -143,17 +146,9 @@ static int PPfd=-1;
int parport_open (void)
{
char *s, *e;
-
+
#ifdef USE_OLD_UDELAY
- s=cfg_get ("Delay",NULL);
- if (s==NULL || *s=='\0') {
- error ("parport: no 'Delay' entry in %s", cfg_source());
- return -1;
- }
- if ((loops_per_usec=strtol(s, &e, 0))==0 || *e!='\0') {
- error ("parport: bad delay '%s' in %s", s, cfg_source());
- return -1;
- }
+ if (cfg_number("Delay", 0, 1, 1000000000, &loops_per_usec)<0) return -1;
#else
udelay_init();
#endif