Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp2292530rwi; Thu, 3 Nov 2022 15:20:50 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7q+ceECCHelQN6Du5QoDSttUaCA3S0sw4A9wU4DB3U6bZz2GiArPyHATXTY+nyNdVEZGHf X-Received: by 2002:a17:907:97d5:b0:7ae:2c4d:9e72 with SMTP id js21-20020a17090797d500b007ae2c4d9e72mr1503206ejc.503.1667514050383; Thu, 03 Nov 2022 15:20:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1667514050; cv=pass; d=google.com; s=arc-20160816; b=RZkD2p8zjXcqj0yne6fL9pDDDyYP2no115FVqf5YBrA+GrKQfqiVEXvQFUggTBq2wT vf6JEyI4hU7SpjVZXwrgxIj1tlisJcC83SFAWdsDNTBXiAf3p3mZAyozarnRRKNgNFDX tRbIBT8P4fdHDvhKAswCeJHoGQ2EZvgVGuOnPkzBl96KOGZILSBVQYP76j9Ukm0QjSeV 1DmkB3b5GdwZx6Fm5hGzQ+6ZmYFEKBxD5syO60dk+51g6RyUiwu1i5DDQKe13BKWgXvm y/bStgif8NCw1etUoFCM8gR853R4tw5h+vjTcvp+zBF6U0Hl1TyB56981iuf7+M6Xv8H h9mQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=SuCtP7RlVuZsya4mFYQPAm/vwU+6Ay7rGbjbFvrDQf4=; b=iKxAq2JX9Tjo2XzAmu0U9rOr7/mWK9cHOYrr2FbEtSKr0PhSApdHa1+Det37hC4ZW+ kK1FQFsbznzKpn1Wm4omCmISFUjDFKcdQWF0vtnNWCGWffdfb74EBwhfLt7f4+UiedhL ed/tB5DmBR5I0ZeO2mZzGk4mtfGMKaZjkaesoF5P/QFuC3Ms7jQqEmLOWZIkk1iD0BSK wVi9nGxeKTSODjUdiRYkLDXj24T+f2J1AxM2vzkHZQNu7UEETqQtVgQeQlmaU3yOoAKX fehS0TyBjpIxLDTKWIFhd/ipPQi3og/xuT/SpMkvnUukn1Vt47m2Yr5UvklyhMQmEQEr iBqw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@seco.com header.s=selector1 header.b=WgJ+Z89P; arc=pass (i=1 spf=pass spfdomain=seco.com dkim=pass dkdomain=seco.com dmarc=pass fromdomain=seco.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=seco.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j11-20020aa7c40b000000b004511d552be3si2543668edq.4.2022.11.03.15.20.26; Thu, 03 Nov 2022 15:20:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@seco.com header.s=selector1 header.b=WgJ+Z89P; arc=pass (i=1 spf=pass spfdomain=seco.com dkim=pass dkdomain=seco.com dmarc=pass fromdomain=seco.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=seco.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230209AbiKCVHi (ORCPT + 98 others); Thu, 3 Nov 2022 17:07:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231433AbiKCVHR (ORCPT ); Thu, 3 Nov 2022 17:07:17 -0400 Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140053.outbound.protection.outlook.com [40.107.14.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE357CE01; Thu, 3 Nov 2022 14:07:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Swqp3LtK9xTImVQk7xI5EYsGBk90+eAY3K3jPhWtDP/TLycEZigAxJDqHO96J+maAbSPfEcywnxMAGJH9E/lXQF17TJLOoS8s4CSBYb3aw/vcPz9QKAsA2xbYF6iXC6wtgYZbBUlGhV3XmKR9BBQ7mOUZMDBHcAOhBsb01W8mu8MvKbP9+GmIdgqK2S6AR3F1FG8JO4K1yuKiEFVPslbIe19hpnXfUct66UFae71nRuPaVSO5/We73BqOmLPShCxzGfuRRBTSQSFxdMha+3sW2h6bTqWxRYI7TnsORF+PnnahA/TUnNEUSDNTTNLIWThG39LUjxikL1gLOHYu3cKLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=SuCtP7RlVuZsya4mFYQPAm/vwU+6Ay7rGbjbFvrDQf4=; b=LxlBd29ZEuaR+XRK43u5EyQWunsDthJ5RVhiWEFxOGfKfw+jVCRqchCNTsIqJBqaQ15zSXC9i/myLFdKfcUCEamZs13ofG2xM0Ayss7VZXrR0o4PDi4bEY5+R+gdpSaQy3PhnXKl5zbd/EEllkdNgT4OpWYLMR1kAm54NiCBxyBKh2hXAv0ZoBy88SUppG4cVb5fmDg8eDk7M7Qqqsex1fFUIhKOrt5av71muFcYZ2eWDFMF+zW+xGVGPZEP1QM7o/z0w7+RJN/sPoaYPytl+4QluKysj8ScgaX+ZDPVR4GfPJ1VAs31n4VJo++vYXFDdV+MtHqWgtzQmwrZybvCsg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SuCtP7RlVuZsya4mFYQPAm/vwU+6Ay7rGbjbFvrDQf4=; b=WgJ+Z89P83ys0kaKgtxxDvSzMkNivh+oAKb8tPw9/nJPpNRTutIfiNaeR3FjpP3gXO2+MtgJlWXQtaHo9ZCxKeG75oSQGtcr20yfIGVgR666eatNJbn8VJqD4FOIkG+AzUBRz8aMDm3wA9jXEw76ORVSYqyDkhfOpE/5Fl9ZGPQc5m7H1zR+n63TAfKwgY+MZYOxNdZC6yuSUBh382GSKZl/0rhtw5Q3vpfyAofrgmSS83LfWke+plhzLFkZvaglbr8mXl2tUx+pTKocpR7Do8i38PiIqZIGgY+gPDZW+EBUtMRdYZ9WcD/sAfvRq4LLFB/zSngFY5f1NgZ2ygctOQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by PAXPR03MB7746.eurprd03.prod.outlook.com (2603:10a6:102:208::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.15; Thu, 3 Nov 2022 21:07:13 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::e9d6:22e1:489a:c23d]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::e9d6:22e1:489a:c23d%4]) with mapi id 15.20.5791.022; Thu, 3 Nov 2022 21:07:13 +0000 From: Sean Anderson To: Heiner Kallweit , Russell King , netdev@vger.kernel.org Cc: Vladimir Oltean , Eric Dumazet , Paolo Abeni , Jakub Kicinski , linux-kernel@vger.kernel.org, Andrew Lunn , Ioana Ciornei , Madalin Bucur , "David S . Miller" , Sean Anderson Subject: [PATCH net-next v2 06/11] net: enetc: Convert to use PCS subsystem Date: Thu, 3 Nov 2022 17:06:45 -0400 Message-Id: <20221103210650.2325784-7-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20221103210650.2325784-1-sean.anderson@seco.com> References: <20221103210650.2325784-1-sean.anderson@seco.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: BLAP220CA0002.NAMP220.PROD.OUTLOOK.COM (2603:10b6:208:32c::7) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB7PR03MB4972:EE_|PAXPR03MB7746:EE_ X-MS-Office365-Filtering-Correlation-Id: 3a990866-a9ba-4519-2a4e-08dabddf6143 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: b1pdKAUyqHYwsHafKX5+4fIJJLdYNc+w6UL751T0GjKKfGFv+sIwQUqCiV04ROiEeBThLmMp3Ojc3hbsbfE6tZ/BYfvy9A2c7NHOz5KgY+5z+h1FQJFIGfIyCbmEFy5Xj2wvJaBK7cn+QooFVxw756e2oE6gC17PE4skUgIWBXa8Y4UFLHhI4eVVtfIrxBSMhp+KfQhZ0PpzdX/LZmzukdQIxd4hmWR+PTmIXdNfD6zHC5ZbXiPmva6N8EZ7KoRMQm5bUstQpFNhX+4eNVYfie7xtXc4XbIG2pu6UBI91H86t8uysY8zA3aomJCY9whLuPH+IuCM8bR5M2ZbH9CzX9zOc12go3+MkSQfeEmvhIJXgANiKICgOvdpWjZAkQSSzM+ggi++cJoic/DIlJv/yjexjVPzIC0o11xftwp4T8jakQpK/662fOyT0tNRI+ipCxYiUXovpot0pGBU8bm9BwVpY2ynacx3ov6xtWagYv1BRvXxvXWmwKzpnBu1MNUBw38WVjnppzCtjVk3+AK/9c61I96jldJJHrq2X7H0P3U4pEa/cLurCaDUUsNw5C/u54TF9SZbeXPmS1POOAp6hFUeKiFR3EJNRhPVXgCfJjxIDxXNvYsV83paAGdHTYgYXBrhl6hhtvMOPaL8teTdXmB6QfIKC1UNQWxfXYyMObQLnnYmcYeDavHRFNxAyd6Zfg7y51y5D0rVdv8DCkrBG+pBJ1O+LM5FiV7rxMGD/gsdcAiTMvCxEL7Gv85D0RMv1HyVZGcH5SxIOaco6qlZNg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4972.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(136003)(366004)(39850400004)(376002)(346002)(396003)(451199015)(8936002)(86362001)(36756003)(107886003)(478600001)(6486002)(44832011)(5660300002)(2906002)(52116002)(26005)(6512007)(6506007)(1076003)(38350700002)(38100700002)(186003)(83380400001)(2616005)(7416002)(41300700001)(6666004)(66946007)(66556008)(4326008)(66476007)(8676002)(316002)(54906003)(110136005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?Mjka91DDSZQSJMSopz79IWT+58rbKSNayLgydFCrkLtGPvlob/LzzYbWgece?= =?us-ascii?Q?3VwBCF76inov45yQ+BXXuzbRy17C1aoLfwM5IPOcNusNFIxkfTatmOYBp3Nn?= =?us-ascii?Q?/klbk6AZQ5xms1EbqFitK/PH/MSgw6V7Ijh9iYiqaQ5H48j8fxyPJsfvrUv9?= =?us-ascii?Q?aHZpnNb6FAe8TzNYxLLdjLBaDDWqnkfADV7DsGgKFv/XhWQ7HPbUTYL9tuRZ?= =?us-ascii?Q?FJ9P8rxZLlyGab+M0UoWFCjgAdYYkPXkDOHcIHA6u2C+qVEZl+WIFwxwk5dI?= =?us-ascii?Q?RdPGH3Fx5sLK5DpRGgCftwqEhJy0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ascii?Q?bcNzUSDBk1yvMjxznZs6vgtFc5oJCqaS42MxiUpqlliacnyrbgRA16wWxx+E?= =?us-ascii?Q?GBq/BfKMco8B9sqEYCBHqZcv/fgbIHI945i3r4iA5qKg312SstFgZRrQiDDP?= =?us-ascii?Q?6e94tgBsVekq8UovvvrJNPmD3N6x6MhyS09tSsip8AmlQzfQYNaf47ZlbuOm?= =?us-ascii?Q?wDEb0+OCFSUgoV7pItc2wdFlV29JZXX5i+ebl7KnOJ7fLG6sAzq42RbvllMx?= =?us-ascii?Q?RfENNEdQ81x/5JPIxWlRNlUzg3UtPvzzFXSB2jIoO24KMt+yr+1/kno5PIh9?= =?us-ascii?Q?Fp4Wvncb/b1thMnz9QkxTO+LNbkxcnVeBF3kXgDdoP9C/OxPv/cAJWwnpWjr?= =?us-ascii?Q?US2/FHaTEi+TmYcnAJh4YS+d6drW4m2Ck70NGYy0hN7M/NN+VSSKJ8i/Oy7t?= =?us-ascii?Q?mA=3D=3D?= X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3a990866-a9ba-4519-2a4e-08dabddf6143 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Nov 2022 21:07:13.4901 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: DSk/oVzKyJYZUz0wyGssBY4FNP+ukViHhKmwqJPkPiOqtnTSAVaHt6Tp/KIbVp+wJONdpeXZoZ4wLcJtbDqeEw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR03MB7746 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This converts the ENETC driver to use the Lynx PCS subsystem, instead of attaching the Lynx library to an MDIO device. Signed-off-by: Sean Anderson --- Changes in v2: - Split off from the lynx PCS patch drivers/net/ethernet/freescale/enetc/Kconfig | 1 + .../net/ethernet/freescale/enetc/enetc_pf.c | 23 ++++--------------- 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/drivers/net/ethernet/freescale/enetc/Kconfig b/drivers/net/ethernet/freescale/enetc/Kconfig index cdc0ff89388a..c7dcdeb9a333 100644 --- a/drivers/net/ethernet/freescale/enetc/Kconfig +++ b/drivers/net/ethernet/freescale/enetc/Kconfig @@ -5,6 +5,7 @@ config FSL_ENETC select FSL_ENETC_IERB select FSL_ENETC_MDIO select PHYLINK + select PCS select PCS_LYNX select DIMLIB help diff --git a/drivers/net/ethernet/freescale/enetc/enetc_pf.c b/drivers/net/ethernet/freescale/enetc/enetc_pf.c index bdf94335ee99..c7034230d7c0 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc_pf.c +++ b/drivers/net/ethernet/freescale/enetc/enetc_pf.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include "enetc_ierb.h" #include "enetc_pf.h" @@ -876,7 +877,6 @@ static int enetc_imdio_create(struct enetc_pf *pf) struct device *dev = &pf->si->pdev->dev; struct enetc_mdio_priv *mdio_priv; struct phylink_pcs *phylink_pcs; - struct mdio_device *mdio_device; struct mii_bus *bus; int err; @@ -900,17 +900,9 @@ static int enetc_imdio_create(struct enetc_pf *pf) goto free_mdio_bus; } - mdio_device = mdio_device_create(bus, 0); - if (IS_ERR(mdio_device)) { - err = PTR_ERR(mdio_device); - dev_err(dev, "cannot create mdio device (%d)\n", err); - goto unregister_mdiobus; - } - - phylink_pcs = lynx_pcs_create(mdio_device); - if (!phylink_pcs) { - mdio_device_free(mdio_device); - err = -ENOMEM; + phylink_pcs = lynx_pcs_create_on_bus(dev, bus, 0); + if (IS_ERR(phylink_pcs)) { + err = PTR_ERR(phylink_pcs); dev_err(dev, "cannot create lynx pcs (%d)\n", err); goto unregister_mdiobus; } @@ -929,13 +921,6 @@ static int enetc_imdio_create(struct enetc_pf *pf) static void enetc_imdio_remove(struct enetc_pf *pf) { - struct mdio_device *mdio_device; - - if (pf->pcs) { - mdio_device = lynx_get_mdio_device(pf->pcs); - mdio_device_free(mdio_device); - lynx_pcs_destroy(pf->pcs); - } if (pf->imdio) { mdiobus_unregister(pf->imdio); mdiobus_free(pf->imdio); -- 2.35.1.1320.gc452695387.dirty