package/dhcp/S80dhcp-server: allow empty INTERFACES
[buildroot-gz.git] / package / sane-backends / 0001-qcam-x86.patch
blobf14dd0e9808459e73fc3797d6b59c2162db3c9a9
1 [PATCH] backend/qcam.c: fix build on !x86
3 inb/outb/ioperm are x86 specific interfaces, so replace with noops on
4 !x86.
6 Inspired by similar patch in openwrt:
7 https://dev.openwrt.org/ticket/5689
9 Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
10 ---
11 backend/qcam.c | 14 +++++++++++++-
12 1 file changed, 13 insertions(+), 1 deletion(-)
14 Index: sane-backends-1.0.22/backend/qcam.c
15 ===================================================================
16 --- sane-backends-1.0.22.orig/backend/qcam.c
17 +++ sane-backends-1.0.22/backend/qcam.c
18 @@ -205,12 +205,20 @@
20 #endif /* <sys/io.h> || <asm/io.h> || <sys/hw.h> */
22 +/* inb / outb only exist on x86 */
23 +#if defined(__i386__) || defined(__x86_64__)
24 #define read_lpdata(d) inb ((d)->port)
25 #define read_lpstatus(d) inb ((d)->port + 1)
26 #define read_lpcontrol(d) inb ((d)->port + 2)
27 #define write_lpdata(d,v) outb ((v), (d)->port)
28 #define write_lpcontrol(d,v) outb ((v), (d)->port + 2)
30 +#else
31 +#define read_lpdata(d) 0
32 +#define read_lpstatus(d) 0
33 +#define read_lpcontrol(d) 0
34 +#define write_lpdata(d,v)
35 +#define write_lpcontrol(d,v)
36 +#endif
38 static SANE_Status
39 enable_ports (QC_Device * q)
40 @@ -219,8 +227,10 @@
41 if (q->port < 0x278 || q->port > 0x3bc)
42 return SANE_STATUS_INVAL;
44 +#if defined(__i386__) || defined(__x86_64__)
45 if (ioperm (q->port, 3, 1) < 0)
46 return SANE_STATUS_INVAL;
47 +#endif
49 return SANE_STATUS_GOOD;
51 @@ -228,8 +238,10 @@
52 static SANE_Status
53 disable_ports (QC_Device * q)
55 +#if defined(__i386__) || defined(__x86_64__)
56 if (ioperm (q->port, 3, 0) < 0)
57 return SANE_STATUS_INVAL;
58 +#endif
60 return SANE_STATUS_GOOD;