From nobody Mon May 25 08:11:33 2026 Received: from smtp.smtpout.orange.fr (smtp-65.smtpout.orange.fr [80.12.242.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BFB8D3B6C15 for ; Fri, 15 May 2026 14:51:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.12.242.65 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778856720; cv=none; b=UUoE4rLivMrvTmCCYpBq3e4bs5LCxPB+K6VK2XKkUrVtXViZBxqXfx1Wb7+Idh8WqzIUFBz73/Oz0oTmCBTkuhcSG3e+PtoKg9M9hcvYuBoARgZovtY4q2NQU15Pdn6jDcoNMhlLc516UDdgusgtBVR06Omo5jObQln1C8bc698= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778856720; c=relaxed/simple; bh=c22ZD/MmN/a4onHgNs0fnMFUToNJkqc4sbq7xQCnCEY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EdxZ13DwDeDq4kmcEd7hJNLMof0FHeN8/daED6ARZXt+ts8l2Pb8eN903qroaog05JRnNXOUx7J1OwORjvBU7PkDRWaXiYkVW/ha+6ApopuBIH4Yl57nflUBaQKvFM2rkGUb18KAoraixHet/ZDTZsMevKfcaBsBJpGVqSth6+c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr; spf=pass smtp.mailfrom=wanadoo.fr; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b=TerWnb0B; arc=none smtp.client-ip=80.12.242.65 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b="TerWnb0B" Received: from fedora.home ([IPv6:2a01:cb10:785:b00:8347:f260:7456:7662]) by smtp.orange.fr with ESMTP id NtsFwUeFnNMP0NtsIwHqbH; Fri, 15 May 2026 16:50:50 +0200 Received: from fedora.home ([IPv6:2a01:cb10:785:b00:8347:f260:7456:7662]) by smtp.orange.fr with ESMTPSA id Nts1wguySDTmsNtsAwk1zC; Fri, 15 May 2026 16:50:43 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1778856643; bh=lcPXlx4BAkS4tA31+H7qeGyoefUdwpUgtRh2zR4stAU=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=TerWnb0BY6h+hk4+lJf3aTqgXGBL9lQD648pQv8dN23IW196zfdMXA/1q/AxRmF0c DnWInTIXquUd0WkhbNovYZL9Cq3p213xoWmAAP9f0p03eqKGHXcs25jXphcbUK/A/D KBEdzhS4tmurXHwf0hR7vGLpF0YsDjhtrxqJ5J7/wO8xzUzmgXz6sis7VoaxAH5eAN n//dK2sI8TtHQNQyrfk5uY8fR92+9Nx18uoRie7Afm2/DlNpkVfePWzc/lOE9RXcCG jYcz4mj8J9Ans1qWzog/q+HlQPW6PKU19LhVTdoGsnP6yGBQo9HbgzPTODtX8Zhz+W I6+Hq8eL7v5tA== X-ME-Helo: fedora.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Fri, 15 May 2026 16:50:43 +0200 X-ME-IP: 2a01:cb10:785:b00:8347:f260:7456:7662 From: Christophe JAILLET To: andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH 1/3 net-next] net: mdio: mscc-miim: Remove some redundant code Date: Fri, 15 May 2026 16:50:24 +0200 Message-ID: <11209c6c6485656cc9a841c495381c540783798a.1778856199.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.54.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" *pbus is assign twice with the same value. Remove one of the redundant assignment. Signed-off-by: Christophe JAILLET Reviewed-by: Maxime Chevallier --- drivers/net/mdio/mdio-mscc-miim.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/net/mdio/mdio-mscc-miim.c b/drivers/net/mdio/mdio-mscc= -miim.c index 259944d37fbd..03878bd9091d 100644 --- a/drivers/net/mdio/mdio-mscc-miim.c +++ b/drivers/net/mdio/mdio-mscc-miim.c @@ -233,8 +233,6 @@ int mscc_miim_setup(struct device *dev, struct mii_bus = **pbus, const char *name, =20 miim =3D bus->priv; =20 - *pbus =3D bus; - miim->regs =3D mii_regmap; miim->mii_status_offset =3D status_offset; miim->ignore_read_errors =3D ignore_read_errors; --=20 2.54.0 From nobody Mon May 25 08:11:33 2026 Received: from smtp.smtpout.orange.fr (smtp-74.smtpout.orange.fr [80.12.242.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 552333B9D84 for ; Fri, 15 May 2026 14:59:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.12.242.74 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778857180; cv=none; b=phroesGWAQjbdDvk470SlI9porf4sh0rPPWoOmjmUNFqh3cWnufftwdhwyt+raItJK/YvAs0byMtQ5pzRt9EAnuZCk6iXVY+IdxnKyXW5MHJ+QYhjcuevef2i5L6Ar7L2VLtNKy6aczvT7JPhjCLXNcZJEh2LUNcPwj27k3GBRs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778857180; c=relaxed/simple; bh=dSiK2d5HHGG4axsv3+vMzoiypN5x6RYhvbf7IPwT4eI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XrWzBA+XzU4iH+IAoEdmNPaUkYF/wPe19QwqoFTL/zAY1svDurAZlkTXcGRXZ9zGsIltuVRvJHBSIa4DEfKZ0IqXyRVgKw/lJ3dqv9rIoqAfga7RMx6Arp5Z+5UfmDEVw21FsLL6uG5U9ShDhu90hZhP7N9bLsf3RmDdkzQ/OkY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr; spf=pass smtp.mailfrom=wanadoo.fr; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b=BmodFq+n; arc=none smtp.client-ip=80.12.242.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b="BmodFq+n" Received: from fedora.home ([10.65.86.62]) by smtp.orange.fr with ESMTP id NtsDwswgI1Er0NtsDwHTU5; Fri, 15 May 2026 16:50:45 +0200 Received: from fedora.home ([IPv6:2a01:cb10:785:b00:8347:f260:7456:7662]) by smtp.orange.fr with ESMTPSA id Nts1wguySDTmsNtsDwk26Z; Fri, 15 May 2026 16:50:45 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1778856645; bh=4OQ0NNNNJoZiPc0P+s+xkhSrdNg3Aq027Eag1qLTTHY=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=BmodFq+nHLpH+b+RGwAPftM3d69ZrVc7RKX+H4ReDSnEMWkBs+APfJ9kI/c4evFpA bLfRBsAms3m5LwNIkaKtL4d+GBZcx6OiPnVJ7VdorS4amFN6fV+qnFosZ1dBtT7w2a YTZJoOSybkvHmX69zTzm4ow4GiGHIYwSArjogimWpfTSNaS1Arw/R6pXBw8UaLIa5W T+BPnBAbNcpkagPVJfAcd9zM1vB0VumSCLHT/KN0R/CQxlJCr/9/EN4TtIw0jNlZlg ppjiH7V9dCD7WOlicUtlYNdnKTGGYFQ1kWDd6TaAr4NsuRuMUthiawjlWP2aP09ydJ OVnruDa/v9/8A== X-ME-Helo: fedora.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Fri, 15 May 2026 16:50:45 +0200 X-ME-IP: 2a01:cb10:785:b00:8347:f260:7456:7662 From: Christophe JAILLET To: andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH 2/3 net-next] net: mdio: mscc-miim: Use devm_clk_get_optional_enabled() Date: Fri, 15 May 2026 16:50:25 +0200 Message-ID: <542f88aee5de2ac24fca58001eab24ac817abee9.1778856199.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.54.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use devm_clk_get_optional_enabled() instead of clk_prepare_enable() and clk_disable_unprepare(). This saves some lines of code and simplifies error handling in the probe. Signed-off-by: Christophe JAILLET Reviewed-by: Maxime Chevallier --- Compile tested only. In the remove sequence, clk_disable_unprepare() and mdiobus_unregister() are not called with the same order anymore. I don't think that it matters. --- drivers/net/mdio/mdio-mscc-miim.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/drivers/net/mdio/mdio-mscc-miim.c b/drivers/net/mdio/mdio-mscc= -miim.c index 03878bd9091d..4d8f60d458b8 100644 --- a/drivers/net/mdio/mdio-mscc-miim.c +++ b/drivers/net/mdio/mdio-mscc-miim.c @@ -307,7 +307,7 @@ static int mscc_miim_probe(struct platform_device *pdev) if (!miim->info) return -EINVAL; =20 - miim->clk =3D devm_clk_get_optional(dev, NULL); + miim->clk =3D devm_clk_get_optional_enabled(dev, NULL); if (IS_ERR(miim->clk)) return PTR_ERR(miim->clk); =20 @@ -318,35 +318,23 @@ static int mscc_miim_probe(struct platform_device *pd= ev) return -EINVAL; } =20 - ret =3D clk_prepare_enable(miim->clk); - if (ret) - return ret; - ret =3D mscc_miim_clk_set(bus); if (ret) - goto out_disable_clk; + return ret; =20 ret =3D of_mdiobus_register(bus, np); - if (ret < 0) { - dev_err_probe(dev, ret, "Cannot register MDIO bus\n"); - goto out_disable_clk; - } + if (ret < 0) + return dev_err_probe(dev, ret, "Cannot register MDIO bus\n"); =20 platform_set_drvdata(pdev, bus); =20 return 0; - -out_disable_clk: - clk_disable_unprepare(miim->clk); - return ret; } =20 static void mscc_miim_remove(struct platform_device *pdev) { struct mii_bus *bus =3D platform_get_drvdata(pdev); - struct mscc_miim_dev *miim =3D bus->priv; =20 - clk_disable_unprepare(miim->clk); mdiobus_unregister(bus); } =20 --=20 2.54.0 From nobody Mon May 25 08:11:33 2026 Received: from smtp.smtpout.orange.fr (smtp-68.smtpout.orange.fr [80.12.242.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 834433BB699 for ; Fri, 15 May 2026 14:52:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.12.242.68 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778856723; cv=none; b=ke2y5CTqSBBNxs2O/7UP566vqxAQNHq1Fs0FFHQ8CGbhSxt8jcfpG2L5cFAU1OE+He7uIe43b3s5+0+NP+np5Ohtn2NSOR7kJ8Ey4T0RW1Jw4W5zPT6KwfjDqbzgcPX52uXClhDxXpWgz6El4L/OPY6RSwV+XE+qX8X94A8/Noc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778856723; c=relaxed/simple; bh=g3ptDJxJxQCUv+cK1mS6Te2bzjyh2+ToCFQDd0hFbUM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IPY9Pkr1MC3iYCRa3KYh9Urqg4OvIa5lIw/SEiyhPdB2BpzHgD9VljA1NKoik33MDv25RI2lA6w9m7Mf+ijjGNOCsnJLu0nUfikUxCr3td7dnL8Cw9iom1aFAfjpQVSAhzePrTKvt0HDiIhLkTUlpghkTQsM6a3OoYvvvIiKThU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr; spf=pass smtp.mailfrom=wanadoo.fr; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b=UKKih3mK; arc=none smtp.client-ip=80.12.242.68 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b="UKKih3mK" Received: from fedora.home ([IPv6:2a01:cb10:785:b00:8347:f260:7456:7662]) by smtp.orange.fr with ESMTP id NtsDw1tER778NNtsFwfXiP; Fri, 15 May 2026 16:50:47 +0200 Received: from fedora.home ([IPv6:2a01:cb10:785:b00:8347:f260:7456:7662]) by smtp.orange.fr with ESMTPSA id Nts1wguySDTmsNtsFwk2Cc; Fri, 15 May 2026 16:50:47 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1778856647; bh=FmW+Of738giidRlcAYcxTdkOQ9EHS9blbA9sumeTjtk=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=UKKih3mKCkNqBb0MLmPJQYd9i9Zgyk34y2Do4mHTZQCKpf/nIK56C9leZtAXc9QJi NIX1azAmDH/8W0zds0ujNnjWD67D1EY46ofCnl4JEITVtAfdcZpBSu18u6qLtvi6Vl 3VsC3L7+OwxrdMRJFibiM34CJP7IomoQz+Uw1sapUb7T8cpVufESXB6BElC8z4Kcne ejKpesqBFenpdvx+PeOoCZPOtn5dyw/Cu8kkYyOEqR6Ty7XJHTXE2agDi41sscobxF +KVH310Wg5PW473ZgecCxR920OM0g/tYSq1ydDNOnexjQdI38rzysBOujJtulk83l7 pDVFNU6SEzl3A== X-ME-Helo: fedora.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Fri, 15 May 2026 16:50:47 +0200 X-ME-IP: 2a01:cb10:785:b00:8347:f260:7456:7662 From: Christophe JAILLET To: andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH 3/3 net-next] net: mdio: mscc-miim: Use devm_of_mdiobus_register() Date: Fri, 15 May 2026 16:50:26 +0200 Message-ID: <139ebd0e3698de5e785bb0c70a4d4da43925a7ae.1778856199.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.54.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use devm_of_mdiobus_register() instead of hand writing it. This saves some lines of code. The remove function can be removed completely and the platform_set_drvdata() call at the end of the probe is now also useless and can be removed as-well. Signed-off-by: Christophe JAILLET Reviewed-by: Maxime Chevallier --- Compile tested only. --- drivers/net/mdio/mdio-mscc-miim.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/net/mdio/mdio-mscc-miim.c b/drivers/net/mdio/mdio-mscc= -miim.c index 4d8f60d458b8..7bdcf3e9baa0 100644 --- a/drivers/net/mdio/mdio-mscc-miim.c +++ b/drivers/net/mdio/mdio-mscc-miim.c @@ -322,22 +322,13 @@ static int mscc_miim_probe(struct platform_device *pd= ev) if (ret) return ret; =20 - ret =3D of_mdiobus_register(bus, np); + ret =3D devm_of_mdiobus_register(dev, bus, np); if (ret < 0) return dev_err_probe(dev, ret, "Cannot register MDIO bus\n"); =20 - platform_set_drvdata(pdev, bus); - return 0; } =20 -static void mscc_miim_remove(struct platform_device *pdev) -{ - struct mii_bus *bus =3D platform_get_drvdata(pdev); - - mdiobus_unregister(bus); -} - static const struct mscc_miim_info mscc_ocelot_miim_info =3D { .phy_reset_offset =3D MSCC_PHY_REG_PHY_CFG, .phy_reset_bits =3D PHY_CFG_PHY_ENA | PHY_CFG_PHY_COMMON_RESET | @@ -363,7 +354,6 @@ MODULE_DEVICE_TABLE(of, mscc_miim_match); =20 static struct platform_driver mscc_miim_driver =3D { .probe =3D mscc_miim_probe, - .remove =3D mscc_miim_remove, .driver =3D { .name =3D "mscc-miim", .of_match_table =3D mscc_miim_match, --=20 2.54.0