Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 211352
b: refs/heads/master
c: a08c7c6
h: refs/heads/master
v: v3
  • Loading branch information
Brian Rogers authored and Mauro Carvalho Chehab committed Sep 30, 2010
1 parent 07f2abc commit 080fa11
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 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: ddc79e0fdc16c05c3ff7f9b6ae9052bda0506108
refs/heads/master: a08c7c68f702e2a2797a4035b6c0a756c4886c26
17 changes: 11 additions & 6 deletions trunk/drivers/media/IR/ir-sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,14 @@ static ssize_t show_protocols(struct device *d,
char *tmp = buf;
int i;

if (ir_dev->props->driver_type == RC_DRIVER_SCANCODE) {
if (ir_dev->props && ir_dev->props->driver_type == RC_DRIVER_SCANCODE) {
enabled = ir_dev->rc_tab.ir_type;
allowed = ir_dev->props->allowed_protos;
} else {
} else if (ir_dev->raw) {
enabled = ir_dev->raw->enabled_protocols;
allowed = ir_raw_get_allowed_protocols();
}
} else
return sprintf(tmp, "[builtin]\n");

IR_dprintk(1, "allowed - 0x%llx, enabled - 0x%llx\n",
(long long)allowed,
Expand Down Expand Up @@ -121,10 +122,14 @@ static ssize_t store_protocols(struct device *d,
int rc, i, count = 0;
unsigned long flags;

if (ir_dev->props->driver_type == RC_DRIVER_SCANCODE)
if (ir_dev->props && ir_dev->props->driver_type == RC_DRIVER_SCANCODE)
type = ir_dev->rc_tab.ir_type;
else
else if (ir_dev->raw)
type = ir_dev->raw->enabled_protocols;
else {
IR_dprintk(1, "Protocol switching not supported\n");
return -EINVAL;
}

while ((tmp = strsep((char **) &data, " \n")) != NULL) {
if (!*tmp)
Expand Down Expand Up @@ -185,7 +190,7 @@ static ssize_t store_protocols(struct device *d,
}
}

if (ir_dev->props->driver_type == RC_DRIVER_SCANCODE) {
if (ir_dev->props && ir_dev->props->driver_type == RC_DRIVER_SCANCODE) {
spin_lock_irqsave(&ir_dev->rc_tab.lock, flags);
ir_dev->rc_tab.ir_type = type;
spin_unlock_irqrestore(&ir_dev->rc_tab.lock, flags);
Expand Down

0 comments on commit 080fa11

Please sign in to comment.