Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 325369
b: refs/heads/master
c: 37812d2
h: refs/heads/master
i:
  325367: a3a689c
v: v3
  • Loading branch information
Lars-Peter Clausen authored and Jonathan Cameron committed Sep 17, 2012
1 parent 1fc3992 commit 0ed7223
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 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: a0e545e0e75006a7de0e9bc5397f6b44c61990b2
refs/heads/master: 37812d2e10e5790f3cc3319055aac0647080c4af
10 changes: 8 additions & 2 deletions trunk/drivers/staging/iio/trigger/iio-trig-bfin-timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,15 @@ static ssize_t iio_bfin_tmr_frequency_show(struct device *dev,
{
struct iio_trigger *trig = to_iio_trigger(dev);
struct bfin_tmr_state *st = trig->private_data;
unsigned int period = get_gptimer_period(st->t->id);
unsigned long val;

return sprintf(buf, "%lu\n",
get_sclk() / get_gptimer_period(st->t->id));
if (period == 0)
val = 0;
else
val = get_sclk() / get_gptimer_period(st->t->id);

return sprintf(buf, "%lu\n", val);
}

static DEVICE_ATTR(frequency, S_IRUGO | S_IWUSR, iio_bfin_tmr_frequency_show,
Expand Down

0 comments on commit 0ed7223

Please sign in to comment.