You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Add a bunch of cycle_kernel_lock() calls
All of the open() functions which don't need the BKL on their face may still depend on its acquisition to serialize opens against driver initialization. So make those functions acquire then release the BKL to be on the safe side. Signed-off-by: Jonathan Corbet <corbet@lwn.net>
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/nsc_gpio.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include <asm/uaccess.h>
|
||||
|
||||
#define DEVNAME "pc8736x_gpio"
|
||||
@@ -212,12 +213,12 @@ static struct nsc_gpio_ops pc8736x_gpio_ops = {
|
||||
.gpio_current = pc8736x_gpio_current
|
||||
};
|
||||
|
||||
/* No BKL needed here; no global resources accessed */
|
||||
static int pc8736x_gpio_open(struct inode *inode, struct file *file)
|
||||
{
|
||||
unsigned m = iminor(inode);
|
||||
file->private_data = &pc8736x_gpio_ops;
|
||||
|
||||
cycle_kernel_lock();
|
||||
dev_dbg(&pdev->dev, "open %d\n", m);
|
||||
|
||||
if (m >= PC8736X_GPIO_CT)
|
||||
|
||||
Reference in New Issue
Block a user