Added patch

This commit is contained in:
Gerben Jan Dijkman 2023-03-14 12:27:23 +01:00
parent f77884e104
commit c0754cbbc1
2 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,28 @@
diff --git a/src/iio-sensor-proxy.c b/src/iio-sensor-proxy.c
index 9833be2e1ccb0a92ccd0c89464688722d6a570d1..836e7427e0259acc0be5288aa4dc532a14e4ee65 100644
--- a/src/iio-sensor-proxy.c
+++ b/src/iio-sensor-proxy.c
@@ -950,16 +950,21 @@ sensor_changes (GUdevClient *client,
SensorDriver *driver = (SensorDriver *) drivers[i];
if (!driver_type_exists (data, driver->type) &&
driver_discover (driver, device)) {
+ SensorDevice *sensor_device = NULL;
+
g_debug ("Found hotplugged device %s of type %s at %s",
g_udev_device_get_sysfs_path (device),
driver_type_to_str (driver->type),
driver->driver_name);
- if (driver_open (driver, device,
- driver_type_to_callback_func (driver->type), data)) {
+ sensor_device = driver_open (driver, device,
+ driver_type_to_callback_func (driver->type), data);
+
+ if (sensor_device) {
GHashTable *ht;
UDEV_DEVICE_FOR_TYPE(driver->type) = g_object_ref (device);
+ DEVICE_FOR_TYPE(driver->type) = sensor_device;
DRIVER_FOR_TYPE(driver->type) = (SensorDriver *) driver;
send_driver_changed_dbus_event (data, driver->type);

View File

@ -32,6 +32,10 @@ DEPEND="
virtual/pkgconfig
"
PATCHES=(
"${FILESDIR}"/5a1a5df532a7b272dbacbfc5ce8c26834c6c19c7.patch
}
src_install() {
meson_src_install
}