From patchwork Thu Jan 4 10:12:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gan, Yi Fang" X-Patchwork-Id: 13510972 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3C14DC47073 for ; Thu, 4 Jan 2024 10:17:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=XX3/4Qdd4jOXk21I4kxsl3CnrzXwvnmd0YXPpmB91Ks=; b=Oasj1YI1yYX6lg Y8YeWCth7o7fH0IGbDAetzY0umNsZldnz1l+In9MK+bs6gRAtCZ8tfEw2lGF//cw/97pu/6XDeB29 p5vRN6mc9PDspsDFknjQ1DUr/fxwq/BnTpAxTqxuJiGi0xYNElug8qdS76VDJIcu00Ui2DikYhYkQ dv6KhL5tQT2LcIGgJjHxA8E4HxFsNtUlya5PIoVZxQPkBVc7d6YrCN0/j9iRVUhvEZtiQZe+vrE7H Ct4aqAnIPEEzf2odAo/IBXt8orQz8eS+p4fCUbAYcNqWvZL3+dysaBSEK1EAbkZA48KVJcNX6Myq9 O83gf2iTejEXkdrFGKbw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rLKm8-00DUT1-1Z; Thu, 04 Jan 2024 10:16:32 +0000 Received: from mgamail.intel.com ([198.175.65.9]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rLKm4-00DUQh-2e for linux-arm-kernel@lists.infradead.org; Thu, 04 Jan 2024 10:16:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1704363389; x=1735899389; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=HCrXfWmSxLvasPVqx5bvaAF0h2FNR5wLkTJHVmOM0RI=; b=anSLVSSLdsosOAaafvgmKaRpaPINcMMadQmjhIC/S7H3qn9bal3i/2Dd B+7tQTWH3Cz8t6Gi3kUtNYYl6uYPaqXZDtKhXKe7m1yVhOf4iNUdCFOE6 LnO0+fpNU+2CeTOWi5s6pvt/Qizxg/IZEJP7NyGCJxV8Br9g6pnwuEwKI 6iqP3+LOFj6IrZ7b1Bbem8kmJIfwWKTKaGlSXzd2h9Oo5PxDqEF+X4KtQ QV2ykdNhi/q2R4uH061BMArge6sZZfZMU5FIc7ozdhbdl2mAIXgAVPJTh +h+HHZrHOjzMmXw7GIieLhWz9mHU1D6J/nnENltsbMsnFqutB0N3HBmNN w==; X-IronPort-AV: E=McAfee;i="6600,9927,10942"; a="15831373" X-IronPort-AV: E=Sophos;i="6.04,330,1695711600"; d="scan'208";a="15831373" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jan 2024 02:16:12 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10942"; a="903761717" X-IronPort-AV: E=Sophos;i="6.04,330,1695711600"; d="scan'208";a="903761717" Received: from ssid-ilbpg3-teeminta.png.intel.com (HELO localhost.localdomain) ([10.88.227.74]) by orsmga004.jf.intel.com with ESMTP; 04 Jan 2024 02:16:06 -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-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Looi Hong Aun , Voon Weifeng , Song Yoong Siang , Choong Yong Liang , Gan Yi Fang Subject: [PATCH net v3 1/1] net: phylink: Add module_exit() Date: Thu, 4 Jan 2024 18:12:55 +0800 Message-Id: <20240104101255.3056090-1-yi.fang.gan@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240104_021628_899004_821BF499 X-CRM114-Status: GOOD ( 10.91 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org In delete_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 --- v1 -> v2: Introduce a macro function to reduce the boilerplate v2 -> v3: Remove the macro function as it is rejected and fix the format issue suggested from v1 drivers/net/phy/phylink.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index 25c19496a336..4a05cda74d42 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -3726,5 +3726,11 @@ static int __init phylink_init(void) module_init(phylink_init); +static void __exit phylink_exit(void) +{ +} + +module_exit(phylink_exit); + MODULE_LICENSE("GPL v2"); MODULE_DESCRIPTION("phylink models the MAC to optional PHY connection");