From def54dfafa784d5829a95ebe5150f9bc8c0bba6e Mon Sep 17 00:00:00 2001 From: Mike Isely Date: Sat, 9 Feb 2008 22:59:08 -0600 Subject: pvrusb2: Close potential race condition during initialization From: Mike Isely There is a callback that is issued to into pvr2_context from pvr2_hdw after initialization is done. There was a probability that this callback could get missed. Fixed. Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h') diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h index 8c0abb4e4..d2f8fa9d3 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h @@ -102,6 +102,12 @@ struct pvr2_hdw; struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf, const struct usb_device_id *devid); +/* Perform second stage initialization, passing in a notification callback + for when the master state changes. */ +void pvr2_hdw_initialize(struct pvr2_hdw *, + void (*callback_func)(void *), + void *callback_data); + #if 0 /* Get pointer to structure given unit number */ struct pvr2_hdw *pvr2_hdw_find(int unit_number); @@ -110,11 +116,6 @@ struct pvr2_hdw *pvr2_hdw_find(int unit_number); /* Destroy hardware interaction structure */ void pvr2_hdw_destroy(struct pvr2_hdw *); -/* Register a function to be called whenever the master state changes. */ -void pvr2_hdw_set_state_callback(struct pvr2_hdw *, - void (*callback_func)(void *), - void *callback_data); - /* Return true if in the ready (normal) state */ int pvr2_hdw_dev_ok(struct pvr2_hdw *); -- cgit v1.2.3