Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 322062
b: refs/heads/master
c: cfc1b2a
h: refs/heads/master
v: v3
  • Loading branch information
Hans de Goede authored and Mauro Carvalho Chehab committed Aug 12, 2012
1 parent 3e5fbc8 commit 507b0c4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 22 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 820ddfa6ca87fc12bf202907b77f635df2098e66
refs/heads/master: cfc1b2a06f87f562da2ffb9f8d1ae4203d9bfbfa
13 changes: 2 additions & 11 deletions trunk/drivers/media/radio/radio-shark.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,14 +181,6 @@ static void shark_led_work(struct work_struct *work)
container_of(work, struct shark_device, led_work);
int i, res, brightness, actual_len;

/*
* We use the v4l2_dev lock and registered bit to ensure the device
* does not get unplugged and unreffed while we're running.
*/
mutex_lock(&shark->tea.mutex);
if (!video_is_registered(&shark->tea.vd))
goto leave;

for (i = 0; i < 3; i++) {
if (!test_and_clear_bit(i, &shark->brightness_new))
continue;
Expand All @@ -208,8 +200,6 @@ static void shark_led_work(struct work_struct *work)
v4l2_err(&shark->v4l2_dev, "set LED %s error: %d\n",
shark->led_names[i], res);
}
leave:
mutex_unlock(&shark->tea.mutex);
}

static void shark_led_set_blue(struct led_classdev *led_cdev,
Expand Down Expand Up @@ -259,14 +249,15 @@ static void usb_shark_disconnect(struct usb_interface *intf)
for (i = 0; i < NO_LEDS; i++)
led_classdev_unregister(&shark->leds[i]);

cancel_work_sync(&shark->led_work);

v4l2_device_put(&shark->v4l2_dev);
}

static void usb_shark_release(struct v4l2_device *v4l2_dev)
{
struct shark_device *shark = v4l2_dev_to_shark(v4l2_dev);

cancel_work_sync(&shark->led_work);
v4l2_device_unregister(&shark->v4l2_dev);
kfree(shark->transfer_buffer);
kfree(shark);
Expand Down
12 changes: 2 additions & 10 deletions trunk/drivers/media/radio/radio-shark2.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,6 @@ static void shark_led_work(struct work_struct *work)
struct shark_device *shark =
container_of(work, struct shark_device, led_work);
int i, res, brightness, actual_len;
/*
* We use the v4l2_dev lock and registered bit to ensure the device
* does not get unplugged and unreffed while we're running.
*/
mutex_lock(&shark->tea.mutex);
if (!video_is_registered(&shark->tea.vd))
goto leave;

for (i = 0; i < 2; i++) {
if (!test_and_clear_bit(i, &shark->brightness_new))
Expand All @@ -191,8 +184,6 @@ static void shark_led_work(struct work_struct *work)
v4l2_err(&shark->v4l2_dev, "set LED %s error: %d\n",
shark->led_names[i], res);
}
leave:
mutex_unlock(&shark->tea.mutex);
}

static void shark_led_set_blue(struct led_classdev *led_cdev,
Expand Down Expand Up @@ -231,14 +222,15 @@ static void usb_shark_disconnect(struct usb_interface *intf)
for (i = 0; i < NO_LEDS; i++)
led_classdev_unregister(&shark->leds[i]);

cancel_work_sync(&shark->led_work);

v4l2_device_put(&shark->v4l2_dev);
}

static void usb_shark_release(struct v4l2_device *v4l2_dev)
{
struct shark_device *shark = v4l2_dev_to_shark(v4l2_dev);

cancel_work_sync(&shark->led_work);
v4l2_device_unregister(&shark->v4l2_dev);
kfree(shark->transfer_buffer);
kfree(shark);
Expand Down

0 comments on commit 507b0c4

Please sign in to comment.