From 51ab292802e21d1031c54bcab8c449d18b97ceaa Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Fri, 6 Feb 2015 18:38:32 +0100 Subject: plugin: let vendor/product filter be complementary So that a plugin can specify a full VID and a specific PID subset of another VID as supported. --- src/mm-plugin.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/mm-plugin.c') diff --git a/src/mm-plugin.c b/src/mm-plugin.c index a83baea8..372f1fc0 100644 --- a/src/mm-plugin.c +++ b/src/mm-plugin.c @@ -308,6 +308,14 @@ apply_pre_probing_filters (MMPlugin *self, if (!self->priv->product_ids[i].l) product_filtered = TRUE; } + + /* When both vendor ids and product ids are given, it may be the case that + * we're allowing a full VID1 and only a subset of another VID2, so try to + * handle that properly. */ + if (vendor_filtered && !product_filtered) + vendor_filtered = FALSE; + if (product_filtered && self->priv->vendor_ids && !vendor_filtered) + product_filtered = FALSE; } /* If we got filtered by vendor or product IDs; mark it as unsupported only if: -- cgit v1.2.3-70-g09d2