greybus: remove unique-id matching
authorJohan Hovold <johan@hovoldconsulting.com>
Sat, 21 Nov 2015 09:52:00 +0000 (10:52 +0100)
committerGreg Kroah-Hartman <gregkh@google.com>
Sun, 22 Nov 2015 01:15:35 +0000 (17:15 -0800)
Remove unique-id matching as it does not make much sense to have a
driver match a specific device serial number.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/bundle.c
drivers/staging/greybus/greybus.h
drivers/staging/greybus/greybus_id.h

index 01745f4..fbc0439 100644 (file)
@@ -79,10 +79,6 @@ static int gb_bundle_match_one_id(struct gb_bundle *bundle,
            (id->product != bundle->intf->product))
                return 0;
 
-       if ((id->match_flags & GREYBUS_ID_MATCH_SERIAL) &&
-           (id->unique_id != bundle->intf->unique_id))
-               return 0;
-
        if ((id->match_flags & GREYBUS_ID_MATCH_CLASS) &&
            (id->class != bundle->class))
                return 0;
@@ -97,8 +93,8 @@ gb_bundle_match_id(struct gb_bundle *bundle,
        if (id == NULL)
                return NULL;
 
-       for (; id->vendor || id->product || id->unique_id || id->class ||
-              id->driver_info; id++) {
+       for (; id->vendor || id->product || id->class || id->driver_info;
+                                                                       id++) {
                if (gb_bundle_match_one_id(bundle, id))
                        return id;
        }
index 4a6b235..4f8aa31 100644 (file)
        .vendor         = (v),                                  \
        .product        = (p),
 
-#define GREYBUS_DEVICE_SERIAL(s)                               \
-       .match_flags    = GREYBUS_ID_MATCH_SERIAL,              \
-       .serial_number  = (s),
-
 /* Maximum number of CPorts */
 #define CPORT_ID_MAX   4095            /* UniPro max id is 4095 */
 #define CPORT_ID_BAD   U16_MAX
index 8e76d42..68d2e95 100644 (file)
@@ -14,7 +14,6 @@ struct greybus_bundle_id {
        __u16   vendor;
        __u16   product;
        __u8    class;
-       __u64   unique_id;
 
        kernel_ulong_t  driver_info __aligned(sizeof(kernel_ulong_t));
 };
@@ -22,7 +21,6 @@ struct greybus_bundle_id {
 /* Used to match the greybus_bundle_id */
 #define GREYBUS_ID_MATCH_VENDOR                BIT(0)
 #define GREYBUS_ID_MATCH_PRODUCT       BIT(1)
-#define GREYBUS_ID_MATCH_SERIAL                BIT(2)
 #define GREYBUS_ID_MATCH_CLASS         BIT(3)
 
 #endif /* __LINUX_GREYBUS_ID_H */