From patchwork Mon Nov 27 10:16:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gan, Yi Fang" X-Patchwork-Id: 13469308 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="I1kG75vg" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30C90EA; Mon, 27 Nov 2023 02:18:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701080307; x=1732616307; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=EHjb8a4oKENRdIROHVOuLNb1REGASuIrFu/8GnwvA6M=; b=I1kG75vgCflcYYI6RvFpQfTH38L7BxKPxmXkrwQmnaquDw59v+IykMSE YuNHABUUXb0JE3owaK0uKNeyR9k9B7SE2CpG5WJsw2/RFulit+Ai8C2Tz /68udVlruIfa91OvW7iCCGuaueMHA6wsKY0KanqQMhFcrGjaYFjl7rXJT nvSwbluj0e2QsLhMKBycrEXtVzaTB1/9oP8DZXwzsi3ewl3IfUeCgfVB9 ZJYRlon795lF1/VpcR9Z9i4TcBPFhlkWth860YKOf/uyVHBAxskxK/PwU K5Ab72XTX5b2quK/nV5CYILT842dhp7FCkBGlW7a9W8GKCaceU++Hs1bu Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10906"; a="11372970" X-IronPort-AV: E=Sophos;i="6.04,230,1695711600"; d="scan'208";a="11372970" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Nov 2023 02:18:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10906"; a="891690067" X-IronPort-AV: E=Sophos;i="6.04,230,1695711600"; d="scan'208";a="891690067" Received: from ssid-ilbpg3-teeminta.png.intel.com (HELO localhost.localdomain) ([10.88.227.74]) by orsmga004.jf.intel.com with ESMTP; 27 Nov 2023 02:18:21 -0800 From: Gan Yi Fang To: Russell King , Andrew Lunn , Heiner Kallweit , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , =?utf-8?q?Marek_Beh=C3=BAn?= , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Looi Hong Aun , Voon Weifeng , Song Yoong Siang , Gan Yi Fang , Lai Peter Jun Ann Subject: [PATCH net 1/1] net: phylink: Add module_exit() Date: Mon, 27 Nov 2023 18:16:03 +0800 Message-Id: <20231127101603.807593-1-yi.fang.gan@intel.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org From: "Gan, Yi Fang" In free_module(), if mod->init callback is defined but mod->exit callback is not defined, it will assume the module cannot be removed and return EBUSY. The module_exit() is missing from current phylink module drive causing failure while unloading it. This patch introduces phylink_exit() for phylink module removal. Fixes: eca68a3c7d05 ("net: phylink: pass supported host PHY interface modes to phylib for SFP's PHYs") Cc: # 6.1+ Signed-off-by: Lai Peter Jun Ann Signed-off-by: Gan, Yi Fang --- drivers/net/phy/phylink.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index 25c19496a336..7121503c9259 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -3724,7 +3724,10 @@ static int __init phylink_init(void) return 0; } +static void __exit phylink_exit(void){} + module_init(phylink_init); +module_exit(phylink_exit); MODULE_LICENSE("GPL v2"); MODULE_DESCRIPTION("phylink models the MAC to optional PHY connection");