rapidio/idt_gen2: fix locking warning
PATCH 97/111 rapidio/idt_gen2: fix locking warning
From: Alexandre Bounine <[email protected]>
Subject: rapidio/idt_gen2: fix locking warning
Fix lockdep warning during device probing: move sysfs initialization out of code protected by a spin lock.
Signed-off-by Alexandre Bounine <[email protected]>
Cc Matt Porter <[email protected]>
Cc Andre van Herk <[email protected]>
Cc Barry Wood <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
drivers/rapidio/switches/idt_gen2.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/rapidio/switches/idt_gen2.c renamed from drivers/rapidio/switches/idt_gen2.c~rapidio-idt_gen2-fix-locking-warning +3 -2
@@ -436,10 +436,11 @@ static int idtg2_probe(struct rio_dev *r RIO_STD_RTE_DEFAULT_PORT, IDT_NO_ROUTE); } +spin_unlock (&rdev->rswitch->lock); +/* Create device-specific sysfs attributes */ idtg2_sysfs (rdev, true); -spin_unlock (&rdev->rswitch->lock);return 0 ; }
@@ -452,11 +453,9 @@ static void idtg2_remove(struct rio_devreturn ; } rdev->rswitch->ops =NULL ; - +spin_unlock (&rdev->rswitch->lock);/* Remove device-specific sysfs attributes */ idtg2_sysfs (rdev, false);