aboutsummaryrefslogtreecommitdiffstats
path: root/drv_generic_parport.c
diff options
context:
space:
mode:
authorreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2004-04-12 05:14:42 +0000
committerreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2004-04-12 05:14:42 +0000
commitbace3dcf3dffa734e1444aa367c53565a9408345 (patch)
treea31e133ea94c58b4b45d0b913bbf4e13c272f807 /drv_generic_parport.c
parentc55e7c91f86ad9cc5235b79f31108d1d53810d80 (diff)
downloadlcd4linux-bace3dcf3dffa734e1444aa367c53565a9408345.tar.gz
[lcd4linux @ 2004-04-12 05:14:42 by reinelt]
another BIG FAT WARNING on the use of raw ports instead of ppdev git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@416 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
Diffstat (limited to 'drv_generic_parport.c')
-rw-r--r--drv_generic_parport.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/drv_generic_parport.c b/drv_generic_parport.c
index f20fecc..a4b7643 100644
--- a/drv_generic_parport.c
+++ b/drv_generic_parport.c
@@ -1,4 +1,4 @@
-/* $Id: drv_generic_parport.c,v 1.4 2004/03/03 04:44:16 reinelt Exp $
+/* $Id: drv_generic_parport.c,v 1.5 2004/04/12 05:14:42 reinelt Exp $
*
* generic driver helper for serial and parport access
*
@@ -23,6 +23,9 @@
*
*
* $Log: drv_generic_parport.c,v $
+ * Revision 1.5 2004/04/12 05:14:42 reinelt
+ * another BIG FAT WARNING on the use of raw ports instead of ppdev
+ *
* Revision 1.4 2004/03/03 04:44:16 reinelt
* changes (cosmetics?) to the big patch from Martin
* hash patch un-applied
@@ -121,19 +124,27 @@ int drv_generic_parport_open (char *section, char *driver)
udelay_init();
+#ifndef WITH_PPDEV
+ error ("The files include/linux/parport.h and/or include/linux/ppdev.h");
+ error ("were missing at compile time. Even if your system supports");
+ error ("ppdev, it will not be used.");
+ error ("You *really* should install these files and recompile LCD4linux!");
+#endif
+
s=cfg_get (Section, "Port", NULL);
if (s==NULL || *s=='\0') {
error ("%s: no '%s.Port' entry from %s", Driver, Section, cfg_source());
return -1;
}
+
PPdev=NULL;
if ((Port=strtol(s, &e, 0))==0 || *e!='\0') {
#ifdef WITH_PPDEV
Port=0;
PPdev=s;
#else
- free(s);
error ("%s: bad %s.Port '%s' from %s", Driver, Section, s, cfg_source());
+ free(s);
return -1;
#endif
}
@@ -142,7 +153,7 @@ int drv_generic_parport_open (char *section, char *driver)
#ifdef WITH_PPDEV
if (PPdev) {
- debug ("using ppdev %s", PPdev);
+ info ("using ppdev %s", PPdev);
PPfd=open(PPdev, O_RDWR);
if (PPfd==-1) {
error ("%s: open(%s) failed: %s", Driver, PPdev, strerror(errno));
@@ -167,7 +178,8 @@ int drv_generic_parport_open (char *section, char *driver)
#endif
{
- debug ("using raw port 0x%x", Port);
+ error ("using raw port 0x%x (deprecated!)", Port);
+ error ("You *really* should change your setup and use ppdev!");
if ((Port+3)<=0x3ff) {
if (ioperm(Port, 3, 1)!=0) {
error ("%s: ioperm(0x%x) failed: %s", Driver, Port, strerror(errno));