From 95c90bc02e0a313e606fec8e49eceef27078e500 Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Sat, 11 May 2024 14:27:22 +0800 Subject: [PATCH] input: sensors: mc3230: Call filp_open() only when CONFIG_NO_GKI Signed-off-by: Tao Huang Change-Id: Ic125f35520517ef99b985dc5936ab3b2e7191957 --- drivers/input/sensors/accel/mc3230.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/input/sensors/accel/mc3230.c b/drivers/input/sensors/accel/mc3230.c index a2278b452b38..1f15eae18953 100644 --- a/drivers/input/sensors/accel/mc3230.c +++ b/drivers/input/sensors/accel/mc3230.c @@ -179,10 +179,13 @@ static int mc3230_active(struct i2c_client *client, int enable); static void MC32X0_rbm(struct i2c_client *client, int enable); static int init_3230_ctl_data(struct i2c_client *client); -struct file *openFile(const char *path, int flag, int mode) +static struct file *openFile(const char *path, int flag, int mode) { struct file *fp; + if (!IS_ENABLED(CONFIG_NO_GKI)) + return NULL; + fp = filp_open(path, flag, mode); if (IS_ERR(fp) || !fp->f_op) return NULL;