OSDN Git Service

device: Fix sending unneeded property change signals
authorSzymon Janc <szymon.janc@tieto.com>
Fri, 21 Mar 2014 15:06:34 +0000 (16:06 +0100)
committerJohan Hedberg <johan.hedberg@intel.com>
Fri, 21 Mar 2014 15:58:18 +0000 (17:58 +0200)
Send property change for Modalias only if it changed. This fix sending
multiple unneeded property change events during discovery.

src/device.c

index 601dfdc..a69cfa6 100644 (file)
@@ -4811,6 +4811,10 @@ gboolean btd_device_remove_attio_callback(struct btd_device *device, guint id)
 void btd_device_set_pnpid(struct btd_device *device, uint16_t source,
                        uint16_t vendor, uint16_t product, uint16_t version)
 {
+       if (device->vendor_src == source && device->version == version &&
+                       device->vendor == vendor && device->product == product)
+               return;
+
        device->vendor_src = source;
        device->vendor = vendor;
        device->product = product;