From aeb168f77c745fa4964e217400c9d43685e46705 Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Wed, 22 May 2013 13:20:10 +0300 Subject: gpio-langwell: initialize lock before usage Otherwise we will end up with traceback from LOCKDEP: INFO: trying to register non-static key. the code is fine but needs lockdep annotation. turning off the locking correctness validator. CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.10.0-rc2-next-20130521-00028-g09aa9fc #487 00000000 00000000 f6c55c54 c1541fe4 f6040bf8 f6c55c8c c1069ef1 c1726bc1 c1726cc8 c1726c9e 00000000 f6c584e0 f6c58000 f6c55ce8 00000000 f6040bf8 f6040bf8 00000046 f6c58000 f6c55d00 c106a18d 00000a2b 00000003 00004f02 Call Trace: [] dump_stack+0x49/0x77 [] register_lock_class+0x58/0x260 [] __lock_acquire+0x94/0xcff [] ? __lock_acquire+0xccf/0xcff [] lock_acquire+0xcc/0x10d [] ? lnw_irq_type+0x63/0xe9 [] _raw_spin_lock_irqsave+0x32/0x42 [] ? lnw_irq_type+0x63/0xe9 [] lnw_irq_type+0x63/0xe9 [] __irq_set_trigger+0x98/0x123 [] irq_set_irq_type+0x2f/0x51 [] ? irq_set_irq_type+0x2f/0x51 [] ? lnw_irq_type+0xe9/0xe9 [] lnw_gpio_irq_map+0x32/0x3b [] irq_domain_add_legacy+0xe2/0x107 [] irq_domain_add_simple+0x47/0x60 [] lnw_gpio_probe+0x119/0x217 [] pci_device_probe+0x5a/0x92 ... Signed-off-by: Andy Shevchenko Acked-by: Mika Westerberg Acked-by: David Cohen Signed-off-by: Linus Walleij --- drivers/gpio/gpio-langwell.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/gpio') diff --git a/drivers/gpio/gpio-langwell.c b/drivers/gpio/gpio-langwell.c index b8a5729ca4f6..a0190de14371 100644 --- a/drivers/gpio/gpio-langwell.c +++ b/drivers/gpio/gpio-langwell.c @@ -380,6 +380,8 @@ static int lnw_gpio_probe(struct pci_dev *pdev, lnw->chip.can_sleep = 0; lnw->pdev = pdev; + spin_lock_init(&lnw->lock); + lnw->domain = irq_domain_add_simple(pdev->dev.of_node, ngpio, irq_base, &lnw_gpio_irq_ops, lnw); if (!lnw->domain) { @@ -399,8 +401,6 @@ static int lnw_gpio_probe(struct pci_dev *pdev, irq_set_handler_data(pdev->irq, lnw); irq_set_chained_handler(pdev->irq, lnw_irq_handler); - spin_lock_init(&lnw->lock); - pm_runtime_put_noidle(&pdev->dev); pm_runtime_allow(&pdev->dev); -- cgit v1.2.1