Skip to content

Commit

Permalink
rtc-dev: no need to convert file->private_data to rtc device
Browse files Browse the repository at this point in the history
In rtc-dev.c, when a rtc device is opened, file->private_data is already
attached with the rtc device pointer, so there is no need to call
to_rtc_device() to convert file->private_data to a rtc device pointer.

Acked-by: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Mark Zhan <rongkai.zhan@windriver.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Mark Zhan authored and Linus Torvalds committed Oct 16, 2007
1 parent 97144c6 commit 88efe13
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/rtc/rtc-dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ static int set_uie(struct rtc_device *rtc)
static ssize_t
rtc_dev_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
{
struct rtc_device *rtc = to_rtc_device(file->private_data);
struct rtc_device *rtc = file->private_data;

DECLARE_WAITQUEUE(wait, current);
unsigned long data;
Expand Down Expand Up @@ -196,7 +196,7 @@ rtc_dev_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)

static unsigned int rtc_dev_poll(struct file *file, poll_table *wait)
{
struct rtc_device *rtc = to_rtc_device(file->private_data);
struct rtc_device *rtc = file->private_data;
unsigned long data;

poll_wait(file, &rtc->irq_queue, wait);
Expand Down Expand Up @@ -396,7 +396,7 @@ static int rtc_dev_ioctl(struct inode *inode, struct file *file,

static int rtc_dev_release(struct inode *inode, struct file *file)
{
struct rtc_device *rtc = to_rtc_device(file->private_data);
struct rtc_device *rtc = file->private_data;

#ifdef CONFIG_RTC_INTF_DEV_UIE_EMUL
clear_uie(rtc);
Expand All @@ -410,7 +410,7 @@ static int rtc_dev_release(struct inode *inode, struct file *file)

static int rtc_dev_fasync(int fd, struct file *file, int on)
{
struct rtc_device *rtc = to_rtc_device(file->private_data);
struct rtc_device *rtc = file->private_data;
return fasync_helper(fd, file, on, &rtc->async_queue);
}

Expand Down

0 comments on commit 88efe13

Please sign in to comment.