whack-a-mole: don't open-code iminor/imajor
[sfrench/cifs-2.6.git] / drivers / rtc / rtc-m41t80.c
index 160dcf68e64ebdf0fae40b57075b3d7e1a207b1d..1e5873261e7e27280a487211f8fa65386e3f1e72 100644 (file)
@@ -783,7 +783,7 @@ static long wdt_unlocked_ioctl(struct file *file, unsigned int cmd,
  */
 static int wdt_open(struct inode *inode, struct file *file)
 {
-       if (MINOR(inode->i_rdev) == WATCHDOG_MINOR) {
+       if (iminor(inode) == WATCHDOG_MINOR) {
                mutex_lock(&m41t80_rtc_mutex);
                if (test_and_set_bit(0, &wdt_is_open)) {
                        mutex_unlock(&m41t80_rtc_mutex);
@@ -807,7 +807,7 @@ static int wdt_open(struct inode *inode, struct file *file)
  */
 static int wdt_release(struct inode *inode, struct file *file)
 {
-       if (MINOR(inode->i_rdev) == WATCHDOG_MINOR)
+       if (iminor(inode) == WATCHDOG_MINOR)
                clear_bit(0, &wdt_is_open);
        return 0;
 }