From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752192AbcGUS3o (ORCPT ); Thu, 21 Jul 2016 14:29:44 -0400 Received: from mxout1.idt.com ([157.165.5.25]:59940 "EHLO mxout1.idt.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750884AbcGUS3l (ORCPT ); Thu, 21 Jul 2016 14:29:41 -0400 From: Alexandre Bounine To: Andrew Morton Cc: Alexandre Bounine , Matt Porter , Andre van Herk , Barry Wood , linux-kernel@vger.kernel.org Subject: [PATCH 09/13] rapidio/idt_gen2: fix locking warning Date: Thu, 21 Jul 2016 14:18:50 -0400 Message-Id: <1469125134-16523-10-git-send-email-alexandre.bounine@idt.com> X-Mailer: git-send-email 1.7.8.4 In-Reply-To: <1469125134-16523-1-git-send-email-alexandre.bounine@idt.com> References: <1469125134-16523-1-git-send-email-alexandre.bounine@idt.com> X-TM-AS-MML: disable Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix lockdep warning during device probing: move sysfs initialization out of code protected by a spin lock. Signed-off-by: Alexandre Bounine Cc: Matt Porter Cc: Andre van Herk Cc: Barry Wood Cc: linux-kernel@vger.kernel.org --- drivers/rapidio/switches/idt_gen2.c | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/rapidio/switches/idt_gen2.c b/drivers/rapidio/switches/idt_gen2.c index 9f7fe21..e67b923 100644 --- a/drivers/rapidio/switches/idt_gen2.c +++ b/drivers/rapidio/switches/idt_gen2.c @@ -436,10 +436,11 @@ static int idtg2_probe(struct rio_dev *rdev, const struct rio_device_id *id) 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_dev *rdev) return; } rdev->rswitch->ops = NULL; - + spin_unlock(&rdev->rswitch->lock); /* Remove device-specific sysfs attributes */ idtg2_sysfs(rdev, false); - - spin_unlock(&rdev->rswitch->lock); } static struct rio_device_id idtg2_id_table[] = { -- 1.7.8.4