From 53483bf12b9f1bf5dc99f264a94128ca4e491db6 Mon Sep 17 00:00:00 2001 From: haojl2 Date: Wed, 15 May 2019 14:42:34 +0800 Subject: [PATCH] fpc1020: Create sysfs before irq enabled. IRQ handler will notify sys entry. So must create sys entries before irq requested and enabled. Change-Id: I6596866a19bMontana779536eb71147810cd13c9528f Signed-off-by: haojl2 Reviewed-on: https://gerrit.mot.com/1354629 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Jianqi Yang Submit-Approved: Jira Key Reviewed-on: https://gerrit.mot.com/1356392 --- drivers/input/misc/fpc_fps_mmi/fpc1020_tee.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/drivers/input/misc/fpc_fps_mmi/fpc1020_tee.c b/drivers/input/misc/fpc_fps_mmi/fpc1020_tee.c index 6fde1070a218..338b0b3a4d6c 100644 --- a/drivers/input/misc/fpc_fps_mmi/fpc1020_tee.c +++ b/drivers/input/misc/fpc_fps_mmi/fpc1020_tee.c @@ -296,6 +296,12 @@ static int fpc1020_probe(struct platform_device *pdev) if (rc) goto exit; + rc = fpc1020_create_sysfs(fpc1020, true); + if (rc) { + dev_err(dev, "could not create sysfs\n"); + goto exit; + } + fpc1020->irq_cnt = 0; irqf = IRQF_TRIGGER_RISING | IRQF_ONESHOT; @@ -305,21 +311,19 @@ static int fpc1020_probe(struct platform_device *pdev) if (rc) { dev_err(dev, "could not request irq %d\n", gpio_to_irq(fpc1020->irq_gpio)); - goto exit; + goto irq_exit; } dev_dbg(dev, "requested irq %d\n", gpio_to_irq(fpc1020->irq_gpio)); /* Request that the interrupt should be wakeable */ enable_irq_wake(gpio_to_irq(fpc1020->irq_gpio)); - - rc = fpc1020_create_sysfs(fpc1020, true); - if (rc) { - dev_err(dev, "could not create sysfs\n"); - goto exit; - } - dev_info(dev, "%s: ok\n", __func__); + + return 0; + +irq_exit: + fpc1020_create_sysfs(fpc1020, false); exit: return rc; }