Skip to content

Commit

Permalink
rtc-parisc: remove redundant locking
Browse files Browse the repository at this point in the history
The RTC subsystem proides ops locking, no need to implement our own

Signed-off-by: dann frazier <dannf@hp.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Kyle McMartin <kyle@mcmartin.ca>
Cc: Grant Grundler <grundler@parisc-linux.org>
Cc: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
dann frazier authored and Linus Torvalds committed Apr 1, 2009
1 parent 93d456d commit 05439f1
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions drivers/rtc/rtc-parisc.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,13 @@
/* as simple as can be, and no simpler. */
struct parisc_rtc {
struct rtc_device *rtc;
spinlock_t lock;
};

static int parisc_get_time(struct device *dev, struct rtc_time *tm)
{
struct parisc_rtc *p = dev_get_drvdata(dev);
unsigned long flags, ret;
unsigned long ret;

spin_lock_irqsave(&p->lock, flags);
ret = get_rtc_time(tm);
spin_unlock_irqrestore(&p->lock, flags);

if (ret & RTC_BATT_BAD)
return -EOPNOTSUPP;
Expand All @@ -34,13 +30,9 @@ static int parisc_get_time(struct device *dev, struct rtc_time *tm)

static int parisc_set_time(struct device *dev, struct rtc_time *tm)
{
struct parisc_rtc *p = dev_get_drvdata(dev);
unsigned long flags;
int ret;

spin_lock_irqsave(&p->lock, flags);
ret = set_rtc_time(tm);
spin_unlock_irqrestore(&p->lock, flags);

if (ret < 0)
return -EOPNOTSUPP;
Expand All @@ -61,8 +53,6 @@ static int __devinit parisc_rtc_probe(struct platform_device *dev)
if (!p)
return -ENOMEM;

spin_lock_init(&p->lock);

p->rtc = rtc_device_register("rtc-parisc", &dev->dev, &parisc_rtc_ops,
THIS_MODULE);
if (IS_ERR(p->rtc)) {
Expand Down

0 comments on commit 05439f1

Please sign in to comment.