X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Frtc%2Frtc-m41t80.c;h=24bc1689fc74c095d88641cb7c78755e5ee0b9f8;hb=3fde80e94c2bbffbb13f5faa3340cf438440ebea;hp=a3e0880b38fb2cdb0116b4168664566fdab84ab4;hpb=28638ea4f8adb63f837e4436560ab16ab0388587;p=linux-2.6 diff --git a/drivers/rtc/rtc-m41t80.c b/drivers/rtc/rtc-m41t80.c index a3e0880b38..24bc1689fc 100644 --- a/drivers/rtc/rtc-m41t80.c +++ b/drivers/rtc/rtc-m41t80.c @@ -13,20 +13,21 @@ * */ -#include +#include +#include #include #include +#include +#include #include +#include #include -#include -#include -#include #ifdef CONFIG_RTC_DRV_M41T80_WDT -#include -#include -#include #include #include +#include +#include +#include #endif #define M41T80_REG_SSEC 0 @@ -630,14 +631,12 @@ static int wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, return -EFAULT; if (rv & WDIOS_DISABLECARD) { - printk(KERN_INFO - "rtc-m41t80: disable watchdog\n"); + pr_info("rtc-m41t80: disable watchdog\n"); wdt_disable(); } if (rv & WDIOS_ENABLECARD) { - printk(KERN_INFO - "rtc-m41t80: enable watchdog\n"); + pr_info("rtc-m41t80: enable watchdog\n"); wdt_ping(); } @@ -655,12 +654,16 @@ static int wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, static int wdt_open(struct inode *inode, struct file *file) { if (MINOR(inode->i_rdev) == WATCHDOG_MINOR) { - if (test_and_set_bit(0, &wdt_is_open)) + lock_kernel(); + if (test_and_set_bit(0, &wdt_is_open)) { + unlock_kernel(); return -EBUSY; + } /* * Activate */ wdt_is_open = 1; + unlock_kernel(); return 0; } return -ENODEV;