Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp6420337ybx; Mon, 11 Nov 2019 08:52:19 -0800 (PST) X-Google-Smtp-Source: APXvYqzMK1ZEJNJnqIYoZi5BLuomCi9zo77kYr7QPQfW5jzxIjer5Ezh020eN1e81VD1X35t4P+6 X-Received: by 2002:a50:9930:: with SMTP id k45mr27081920edb.134.1573491136933; Mon, 11 Nov 2019 08:52:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573491136; cv=none; d=google.com; s=arc-20160816; b=wnRi7Kx6YhCVcvJ88wV2ygE8g2Q0OGy/QRkxqFbFqSgHtpI+bPMbAn3nox4JU8OolK A7UAmTmoxCigD6CrcwmjolK5GDG5wy7GOER5z4tzkbM2hiEeqB5Cip1BBdGgPGGL1F6k ohG+Xgmgdm5qSg0BuEM9yQZo+i2gmz91N2kbPMWDuFuiOxNa50bTPQX5Nb7LPTDOLhbc 7d+jiuQcrixJfLqUaeu1cAZAnOUE7T0Oz73s8Mlsy47ltc4x0wzhJTvqCSR2/M3N91WS +2LgRhrhNR05YBl26RGhTyiB0zdieDvOHmfG/2EKvxN6Fa44qReeGBuemCce+xD05S8H 075A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:reply-to:references:in-reply-to :message-id:date:subject:cc:to:from; bh=r7ETNos9OWWHllW3aUbf2aRW/ZeO/OKoZXGXTV0uQtM=; b=xHe395yY+xiDoHHTw76x7dOpqw2Akg2WeE+zOiK+vjmkEfkuM18vj/k+kUbRWKVl2r PEoR69vSuJWRfN5X7nb9/LqagGw2y2lik4NHuvRygQKQN/IOL8pHqEueIO+4ql62HEk2 HwAt6o8slOhMPHUOPyk3MQTKph34HXXKYh51WUVWSah6RHyJ09uZQQ+ioEMiNicc0AOR bs/bRGNSNJ7BM1yH42WQ0xBuHR43+a+A+78u+6FawnRDR8fnqlb0lMJ5I1bfIY86XJfC d0MG7BRMD08zp1Bbb3bxc+yV+OScIqDjvNoate53bw6EO/BjjhN6yikT2I7JSzr9Lg9E cjdA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c8si9777661eja.67.2019.11.11.08.51.52; Mon, 11 Nov 2019 08:52:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727100AbfKKQvM (ORCPT + 99 others); Mon, 11 Nov 2019 11:51:12 -0500 Received: from inva021.nxp.com ([92.121.34.21]:44286 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726950AbfKKQvL (ORCPT ); Mon, 11 Nov 2019 11:51:11 -0500 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id AEF1E200638; Mon, 11 Nov 2019 17:51:09 +0100 (CET) Received: from inva024.eu-rdc02.nxp.com (inva024.eu-rdc02.nxp.com [134.27.226.22]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id A1D05200629; Mon, 11 Nov 2019 17:51:09 +0100 (CET) Received: from fsr-ub1464-137.ea.freescale.net (fsr-ub1464-137.ea.freescale.net [10.171.82.114]) by inva024.eu-rdc02.nxp.com (Postfix) with ESMTP id 7D070205FE; Mon, 11 Nov 2019 17:51:09 +0100 (CET) From: Ioana Ciornei To: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org Cc: Ioana Ciornei Subject: [PATCH 2/4] staging: dpaa2-ethsw: move port switchdev notifier per ethsw Date: Mon, 11 Nov 2019 18:50:56 +0200 Message-Id: <1573491058-24766-3-git-send-email-ioana.ciornei@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1573491058-24766-1-git-send-email-ioana.ciornei@nxp.com> References: <1573491058-24766-1-git-send-email-ioana.ciornei@nxp.com> Reply-to: ioana.ciornei@nxp.com X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Register a different switchdev notifier block per ethsw instance. When probing multiple dpaa2-ethsw instances, without this the register will fail. Signed-off-by: Ioana Ciornei --- drivers/staging/fsl-dpaa2/ethsw/ethsw.c | 11 ++++------- drivers/staging/fsl-dpaa2/ethsw/ethsw.h | 1 + 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/staging/fsl-dpaa2/ethsw/ethsw.c b/drivers/staging/fsl-dpaa2/ethsw/ethsw.c index b25520173fec..abbfcbf81241 100644 --- a/drivers/staging/fsl-dpaa2/ethsw/ethsw.c +++ b/drivers/staging/fsl-dpaa2/ethsw/ethsw.c @@ -1314,10 +1314,6 @@ static int port_switchdev_blocking_event(struct notifier_block *unused, return NOTIFY_DONE; } -static struct notifier_block port_switchdev_nb = { - .notifier_call = port_switchdev_event, -}; - static struct notifier_block port_switchdev_blocking_nb = { .notifier_call = port_switchdev_blocking_event, }; @@ -1334,7 +1330,8 @@ static int ethsw_register_notifier(struct device *dev) return err; } - err = register_switchdev_notifier(&port_switchdev_nb); + ethsw->port_switchdev_nb.notifier_call = port_switchdev_event; + err = register_switchdev_notifier(ðsw->port_switchdev_nb); if (err) { dev_err(dev, "Failed to register switchdev notifier\n"); goto err_switchdev_nb; @@ -1349,7 +1346,7 @@ static int ethsw_register_notifier(struct device *dev) return 0; err_switchdev_blocking_nb: - unregister_switchdev_notifier(&port_switchdev_nb); + unregister_switchdev_notifier(ðsw->port_switchdev_nb); err_switchdev_nb: unregister_netdevice_notifier(ðsw->port_nb); return err; @@ -1499,7 +1496,7 @@ static void ethsw_unregister_notifier(struct device *dev) dev_err(dev, "Failed to unregister switchdev blocking notifier (%d)\n", err); - err = unregister_switchdev_notifier(&port_switchdev_nb); + err = unregister_switchdev_notifier(ðsw->port_switchdev_nb); if (err) dev_err(dev, "Failed to unregister switchdev notifier (%d)\n", err); diff --git a/drivers/staging/fsl-dpaa2/ethsw/ethsw.h b/drivers/staging/fsl-dpaa2/ethsw/ethsw.h index 39a3f542c8ee..e050589758b1 100644 --- a/drivers/staging/fsl-dpaa2/ethsw/ethsw.h +++ b/drivers/staging/fsl-dpaa2/ethsw/ethsw.h @@ -68,6 +68,7 @@ struct ethsw_core { bool learning; struct notifier_block port_nb; + struct notifier_block port_switchdev_nb; }; #endif /* __ETHSW_H */ -- 1.9.1