diff options
author | Johan Hovold <johan@hovoldconsulting.com> | 2016-01-08 20:13:41 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@google.com> | 2016-01-09 00:41:46 -0800 |
commit | b77f9328f2d629220389d44febf7ab6b48848050 (patch) | |
tree | 0e0e5d6a5af9c46fa6cd541dae7755cbdd79b240 /drivers | |
parent | 3c48d1b8a5a9571c9107fc7f2b5aea31d458fd18 (diff) | |
download | op-kernel-dev-b77f9328f2d629220389d44febf7ab6b48848050.zip op-kernel-dev-b77f9328f2d629220389d44febf7ab6b48848050.tar.gz |
greybus: core: fix greybus device matching
The bus code should only match bundle devices for now, and must not
assume all greybus devices are bundles.
Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/greybus/core.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/staging/greybus/core.c b/drivers/staging/greybus/core.c index c56c0c4..6b31155 100644 --- a/drivers/staging/greybus/core.c +++ b/drivers/staging/greybus/core.c @@ -65,9 +65,14 @@ greybus_match_id(struct gb_bundle *bundle, const struct greybus_bundle_id *id) static int greybus_module_match(struct device *dev, struct device_driver *drv) { struct greybus_driver *driver = to_greybus_driver(drv); - struct gb_bundle *bundle = to_gb_bundle(dev); + struct gb_bundle *bundle; const struct greybus_bundle_id *id; + if (!is_gb_bundle(dev)) + return 0; + + bundle = to_gb_bundle(dev); + id = greybus_match_id(bundle, driver->id_table); if (id) return 1; |