Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 271639
b: refs/heads/master
c: b05681b
h: refs/heads/master
i:
  271637: 4bba6d8
  271635: 43aaf81
  271631: ca1c76a
v: v3
  • Loading branch information
Mauro Carvalho Chehab committed Jul 31, 2011
1 parent 6fc03e1 commit c577436
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 11 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: eaceba650dea4af61f6f3a4919caa096bb4c2929
refs/heads/master: b05681b91709a19b40a452f566cc852619b30082
29 changes: 19 additions & 10 deletions trunk/drivers/media/rc/rc-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -928,10 +928,6 @@ static ssize_t store_protocols(struct device *device,

static void rc_dev_release(struct device *device)
{
struct rc_dev *dev = to_rc_dev(device);

kfree(dev);
module_put(THIS_MODULE);
}

#define ADD_HOTPLUG_VAR(fmt, val...) \
Expand All @@ -945,6 +941,9 @@ static int rc_dev_uevent(struct device *device, struct kobj_uevent_env *env)
{
struct rc_dev *dev = to_rc_dev(device);

if (!dev || !dev->input_dev)
return -ENODEV;

if (dev->rc_map.name)
ADD_HOTPLUG_VAR("NAME=%s", dev->rc_map.name);
if (dev->driver_name)
Expand Down Expand Up @@ -1013,10 +1012,16 @@ EXPORT_SYMBOL_GPL(rc_allocate_device);

void rc_free_device(struct rc_dev *dev)
{
if (dev) {
if (!dev)
return;

if (dev->input_dev)
input_free_device(dev->input_dev);
put_device(&dev->dev);
}

put_device(&dev->dev);

kfree(dev);
module_put(THIS_MODULE);
}
EXPORT_SYMBOL_GPL(rc_free_device);

Expand Down Expand Up @@ -1143,14 +1148,18 @@ void rc_unregister_device(struct rc_dev *dev)
if (dev->driver_type == RC_DRIVER_IR_RAW)
ir_raw_event_unregister(dev);

/* Freeing the table should also call the stop callback */
ir_free_table(&dev->rc_map);
IR_dprintk(1, "Freed keycode table\n");

input_unregister_device(dev->input_dev);
dev->input_dev = NULL;

ir_free_table(&dev->rc_map);
IR_dprintk(1, "Freed keycode table\n");
device_del(&dev->dev);

device_unregister(&dev->dev);
rc_free_device(dev);
}

EXPORT_SYMBOL_GPL(rc_unregister_device);

/*
Expand Down

0 comments on commit c577436

Please sign in to comment.