aboutsummaryrefslogtreecommitdiffstats
path: root/parport.c
diff options
context:
space:
mode:
authorreinelt <>2003-09-09 06:54:43 +0000
committerreinelt <>2003-09-09 06:54:43 +0000
commitb1f5fffddaf31835515f88859f8a4670b6252deb (patch)
treec78e80eb3a22e818c6039ca5aa68c7f46000fd94 /parport.c
parentb39a42b909dfb1c174044cf977d272f94445b18e (diff)
downloadlcd4linux-b1f5fffddaf31835515f88859f8a4670b6252deb.tar.gz
[lcd4linux @ 2003-09-09 06:54:43 by reinelt]
new function 'cfg_number()'
Diffstat (limited to 'parport.c')
-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