summaryrefslogtreecommitdiff
path: root/backend/plustek-pp_wrapper.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2019-07-31 16:59:49 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2019-07-31 16:59:49 +0200
commit1687222e1b9e74c89cafbb5910e72d8ec7bfd40f (patch)
treed78102ce30207c63e7608eeba743efd680c888dc /backend/plustek-pp_wrapper.c
parent58912f68c2489bcee787599837447e0d64dfd61a (diff)
New upstream version 1.0.28upstream/1.0.28
Diffstat (limited to 'backend/plustek-pp_wrapper.c')
-rw-r--r--backend/plustek-pp_wrapper.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/backend/plustek-pp_wrapper.c b/backend/plustek-pp_wrapper.c
index ba635ef..c41d340 100644
--- a/backend/plustek-pp_wrapper.c
+++ b/backend/plustek-pp_wrapper.c
@@ -56,7 +56,7 @@
/******************* wrapper functions for parport device ********************/
#ifndef _BACKEND_ENABLED
-
+
static int PtDrvInit( char *dev_name, unsigned short model_override )
{
_VAR_NOT_USED( dev_name );
@@ -124,7 +124,7 @@ static int ppDev_open( const char *dev_name, void *misc )
handle = PtDrvOpen();
else
handle = open( dev_name, O_RDONLY );
-
+
if ( handle < 0 ) {
DBG( _DBG_ERROR, "open: can't open %s as a device\n", dev_name );
return handle;
@@ -134,7 +134,7 @@ static int ppDev_open( const char *dev_name, void *misc )
result = PtDrvIoctl( _PTDRV_OPEN_DEVICE, &version );
else
result = ioctl( handle, _PTDRV_OPEN_DEVICE, &version );
-
+
if( result < 0 ) {
if( -9019 == result ) {
@@ -149,14 +149,14 @@ static int ppDev_open( const char *dev_name, void *misc )
result = PtDrvIoctl( _PTDRV_OPEN_DEVICE, &version );
else
result = ioctl( handle, _PTDRV_OPEN_DEVICE, &version );
-
+
if( result < 0 ) {
-
+
if( dev->adj.direct_io )
PtDrvClose();
else
close( dev->fd );
-
+
DBG( _DBG_ERROR,
"ioctl PT_DRV_OPEN_DEVICE failed(%d)\n", result );
@@ -294,23 +294,23 @@ static int ppDev_setMap( Plustek_Device *dev, SANE_Word *map,
m.map_id = channel;
m.map = (void *)map;
-
+
DBG(_DBG_INFO,"Setting map[%u] at 0x%08lx\n", channel, (unsigned long)map);
buf = (SANE_Byte*)malloc( m.len );
-
+
if( !buf )
return _E_ALLOC;
-
+
for( i = 0; i < m.len; i++ ) {
buf[i] = (SANE_Byte)map[i];
-
+
if( map[i] > 0xFF )
buf[i] = 0xFF;
}
-
+
m.map = buf;
-
+
if( dev->adj.direct_io )
PtDrvIoctl( _PTDRV_SETMAP, &m );
else
@@ -334,7 +334,7 @@ static int ppDev_stopScan( Plustek_Device *dev, short *mode )
retval = PtDrvIoctl( _PTDRV_STOP_SCAN, mode );
else
retval = ioctl( dev->fd, _PTDRV_STOP_SCAN, mode );
-
+
/* ... and use it here */
if( 0 == tmp ) {
if( dev->adj.direct_io )