Skip to content

Commit c7e4c6e

Browse files
author
Fox Snowpatch
committed
1 parent a2f7734 commit c7e4c6e

1 file changed

Lines changed: 3 additions & 13 deletions

File tree

drivers/char/nvram.c

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
#include <asm/nvram.h>
5454
#endif
5555

56-
static DEFINE_MUTEX(nvram_mutex);
5756
static DEFINE_SPINLOCK(nvram_state_lock);
5857
static int nvram_open_cnt; /* #times opened */
5958
static int nvram_open_mode; /* special open modes */
@@ -310,11 +309,8 @@ static long nvram_misc_ioctl(struct file *file, unsigned int cmd,
310309
break;
311310
#ifdef CONFIG_PPC32
312311
case IOC_NVRAM_SYNC:
313-
if (ppc_md.nvram_sync != NULL) {
314-
mutex_lock(&nvram_mutex);
312+
if (ppc_md.nvram_sync)
315313
ppc_md.nvram_sync();
316-
mutex_unlock(&nvram_mutex);
317-
}
318314
ret = 0;
319315
break;
320316
#endif
@@ -324,23 +320,17 @@ static long nvram_misc_ioctl(struct file *file, unsigned int cmd,
324320
if (!capable(CAP_SYS_ADMIN))
325321
return -EACCES;
326322

327-
if (arch_nvram_ops.initialize != NULL) {
328-
mutex_lock(&nvram_mutex);
323+
if (arch_nvram_ops.initialize)
329324
ret = arch_nvram_ops.initialize();
330-
mutex_unlock(&nvram_mutex);
331-
}
332325
break;
333326
case NVRAM_SETCKS:
334327
/* just set checksum, contents unchanged (maybe useful after
335328
* checksum garbaged somehow...) */
336329
if (!capable(CAP_SYS_ADMIN))
337330
return -EACCES;
338331

339-
if (arch_nvram_ops.set_checksum != NULL) {
340-
mutex_lock(&nvram_mutex);
332+
if (arch_nvram_ops.set_checksum)
341333
ret = arch_nvram_ops.set_checksum();
342-
mutex_unlock(&nvram_mutex);
343-
}
344334
break;
345335
#endif /* CONFIG_X86 || CONFIG_M68K */
346336
}

0 commit comments

Comments
 (0)