mei: bus: enable running fixup routines before device registration

Split the device registration into allocation and device struct
initialization, device setup, and the final device registration.
This why it is possible to run fixups and quirks during the setup stage
on an initialized device. Each fixup routine effects do_match flag.
If the flag is set to false at the end the device won't be
registered on the bus.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Tomas Winkler
2015-07-23 15:08:43 +03:00
committed by Greg Kroah-Hartman
parent 0ff0a8d853
commit 71ce789115
4 changed files with 111 additions and 16 deletions

View File

@@ -29,6 +29,8 @@ typedef void (*mei_cl_event_cb_t)(struct mei_cl_device *device,
* events (e.g. Rx buffer pending) notifications.
* @event_context: event callback run context
* @events: Events bitmask sent to the driver.
*
* @do_match: wheather device can be matched with a driver
* @is_added: device is already scanned
* @priv_data: client private data
*/
@@ -45,6 +47,8 @@ struct mei_cl_device {
mei_cl_event_cb_t event_cb;
void *event_context;
unsigned long events;
unsigned int do_match:1;
unsigned int is_added:1;
void *priv_data;