sane-backends/sane-backends-1.0.22-avision-init-devices.patch
2012-04-17 11:47:42 +02:00

92 lines
2.4 KiB
Diff

From c688c041b21f955e420e0f1fb7807253d4f4035c Mon Sep 17 00:00:00 2001
From: Nils Philippsen <nils@redhat.com>
Date: Tue, 17 Apr 2012 11:42:54 +0200
Subject: [PATCH] patch: avision-init-devices
Squashed commit of the following:
commit ff9cb7dad86822147bc51a5cef9688603cbbcfa4
Author: Mike Kelly <mike@piratehaven.org>
Date: Wed Mar 21 21:03:00 2012 -0700
Added sane_reload_devices() to sane_init().
Adding sane_reload_devices() to sane_init() required sane_init() to be moved
below the sane_reload_devices() declaration. This restores the original
functionality present before I split the sane_reload_devices() code out of
sane_init() so that it could be called from sane_get_devices().
(cherry picked from commit 33bb529c5f8ca013fb499addc14c7fb229203ea8)
---
backend/avision.c | 48 +++++++++++++++++++++++++-----------------------
1 file changed, 25 insertions(+), 23 deletions(-)
diff --git a/backend/avision.c b/backend/avision.c
index 3398e08..8c066d7 100644
--- a/backend/avision.c
+++ b/backend/avision.c
@@ -7526,29 +7526,6 @@ attach_one_usb (const char* dev)
attach (dev, AV_USB, 0);
return SANE_STATUS_GOOD;
}
-
-SANE_Status
-sane_init (SANE_Int* version_code, SANE_Auth_Callback authorize)
-{
- authorize = authorize; /* silence gcc */
-
- DBG_INIT();
-
-#ifdef AVISION_STATIC_DEBUG_LEVEL
- DBG_LEVEL = AVISION_STATIC_DEBUG_LEVEL;
-#endif
-
- DBG (3, "sane_init:(Version: %i.%i Build: %i)\n",
- SANE_CURRENT_MAJOR, V_MINOR, BACKEND_BUILD);
-
- /* must come first */
- sanei_thread_init ();
-
- if (version_code)
- *version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, V_MINOR, BACKEND_BUILD);
-
- return SANE_STATUS_GOOD;
-}
static SANE_Status
sane_reload_devices (void)
@@ -7722,6 +7699,31 @@ sane_reload_devices (void)
return SANE_STATUS_GOOD;
}
+SANE_Status
+sane_init (SANE_Int* version_code, SANE_Auth_Callback authorize)
+{
+ authorize = authorize; /* silence gcc */
+
+ DBG_INIT();
+
+#ifdef AVISION_STATIC_DEBUG_LEVEL
+ DBG_LEVEL = AVISION_STATIC_DEBUG_LEVEL;
+#endif
+
+ DBG (3, "sane_init:(Version: %i.%i Build: %i)\n",
+ SANE_CURRENT_MAJOR, V_MINOR, BACKEND_BUILD);
+
+ /* must come first */
+ sanei_thread_init ();
+
+ if (version_code)
+ *version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, V_MINOR, BACKEND_BUILD);
+
+ sane_reload_devices ();
+
+ return SANE_STATUS_GOOD;
+}
+
void
sane_exit (void)
{
--
1.7.10