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 <haojl2@motorola.com>
Reviewed-on: https://gerrit.mot.com/1354629
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1356392
This commit is contained in:
haojl2 2019-05-15 14:42:34 +08:00 • committed by Jialei Hao
commit 53483bf12b

View file

@ -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;
}