From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0D51FC433F5 for ; Mon, 9 May 2022 17:05:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239482AbiEIRJN (ORCPT ); Mon, 9 May 2022 13:09:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239505AbiEIRJL (ORCPT ); Mon, 9 May 2022 13:09:11 -0400 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam08on2090.outbound.protection.outlook.com [40.107.100.90]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 411022D572E; Mon, 9 May 2022 10:05:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=a619xj4W1uBPbGh0hVP/PvhgIONu9T5Q+a9ZWjOEGfrjfqwk9OTPmWeF8Jw7Nocdq4oLd2m+l0UjIcEKfFWLCTDqTBQGD20cfvBQC5hHFunOz9hWSfENl8nXmv5fOfj3G9nF8p4Nq1qiw7UJGt1/v1EJ0m3GxAxiyR6wMxyY9c7X6GzmOTUI7OL59dP06aVPtt0p+iYZ/ZeY7xANj/PKY6STky4ksId1PHyfkH/X3b4yEUd0HUSnwJLtSW/cnE54M2EtOodcwT3Fq0K8U3dEhcFTf8zGWsfy1VCjtR1Rdo4zqpEloPsT3mjcXVESDUe1WlZCQVFADnfv3Itlsr8Z1w== 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=4ua/rd01XKu1/g96NDxmvClYCeZdS+A3hZ/jPdk15Mw=; b=ErPCa9PMrQD4fARcqAlw+gE8+ZfT6eQe/WJPjR3Ls6dKa0zygNMVWjPNT5o9lWg+UrsdCPNDB0eamExz517gxJXiO6SJWrwM4o7xjKSiZVO4BJF0EnLDH4uzfVlaPfhmz2IN/lQqVFceptvo9RSFMyBoyGOEU7ofGxeCgZfxrW0O7N4lG5iDIc1XP+8fITw6jtR17DX9DktwMsy9/5VjRViNFZdtk2+PTS5Dy0i4KDnO5eFukGbY/X6iQn4+fRAyIwnsgLn1rzQCXgaFTHkT5bLCgn5uSjkNNQVpmd3RBfeL7lnp+659Iu0LydI34lnMnETPPxn0483lLG2auKvV3A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=in-advantage.com; dmarc=pass action=none header.from=in-advantage.com; dkim=pass header.d=in-advantage.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inadvantage.onmicrosoft.com; s=selector2-inadvantage-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4ua/rd01XKu1/g96NDxmvClYCeZdS+A3hZ/jPdk15Mw=; b=CHhH1hww3K1k/Zrdp3qblueijXVmMxWg1zQonQNoldBaEMk3DcgimgnZJQKEQNr14k0D/AwJMVqfJX1Di8rEWN6fkZVWCAN1UZw2f8LT3zgf5aI5LbxkYTRtKMhv0COD4CRTVWXZU47CHCSnndUJQ6b1VfCGdidt5Nm9OeZ1YuQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=in-advantage.com; Received: from MWHPR1001MB2351.namprd10.prod.outlook.com (2603:10b6:301:35::37) by SN4PR10MB5573.namprd10.prod.outlook.com (2603:10b6:806:204::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.25; Mon, 9 May 2022 17:05:14 +0000 Received: from MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::4581:787c:1a7a:873e]) by MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::4581:787c:1a7a:873e%3]) with mapi id 15.20.5227.020; Mon, 9 May 2022 17:05:14 +0000 Date: Mon, 9 May 2022 17:05:16 -0700 From: Colin Foster To: Vladimir Oltean Cc: "linux-arm-kernel@lists.infradead.org" , "linux-gpio@vger.kernel.org" , "netdev@vger.kernel.org" , Terry Bowman , Wolfram Sang , Andy Shevchenko , Steen Hegelund , Lars Povlsen , Linus Walleij , Russell King , Heiner Kallweit , Paolo Abeni , Jakub Kicinski , Eric Dumazet , "David S. Miller" , Florian Fainelli , Vivien Didelot , Andrew Lunn , "UNGLinuxDriver@microchip.com" , Alexandre Belloni , Claudiu Manoil , Lee Jones Subject: Re: [RFC v8 net-next 11/16] net: mscc: ocelot: expose regfield definition to be used by other drivers Message-ID: <20220510000516.GE895@COLIN-DESKTOP1.localdomain> References: <20220508185313.2222956-1-colin.foster@in-advantage.com> <20220508185313.2222956-12-colin.foster@in-advantage.com> <20220509105638.btfgdr4wt427ewip@skbuf> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220509105638.btfgdr4wt427ewip@skbuf> X-ClientProxiedBy: BY5PR17CA0032.namprd17.prod.outlook.com (2603:10b6:a03:1b8::45) To MWHPR1001MB2351.namprd10.prod.outlook.com (2603:10b6:301:35::37) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2ad3208f-f02d-4e77-dcbf-08da31de158e X-MS-TrafficTypeDiagnostic: SN4PR10MB5573:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: B1bOQ9nQUTXuXBP7NOEt7t1kZ4CBD6WU3jKpU0GZp+4toFN2j4/EXjqm55T/P2d4foNWG+EdTyaSVh3kbMrKfhqpRzJfFI+MfENDNfmwpxE+gp+oE5aNAwEmveDpj3lxU4jGemBobhaFSJe0JOpqXkGUSV1PMj0vJ0Mi2KXaRkj8e8NqI93Kac6GX8PLFoutGd7xikBwx1ZpB8dWKnTZ4bSzPTwG6BvW6oAwmvbDm3hEO8H9TWT/AsbCjjmlLaLujxnnMaDBvEyh1k9PBKv5CekOm3bfXOf/dIKDkA4znGa/KywWJ7U6BFhafgb6cvckOiH7ULSePicebX5Sc75E2JvG6GuHFDKvztDPa232Zy8MID9KmWD6Psv6fk7/WYyrlcnQGUhIiJZVPWQbcHaQbhQl09SgAaMwsTj2Fj/i89GFjYozwEOWH1BStI31D8J1FIaz7YQAWVj2rMrpqA+SANz1oLJ0793lCk/m81kMzrUmYig4ZMY0eRPCU04XXA88sEzKraKsAnKEHPZrQ2Xj/s2uL6TJXLE3REV6bvOtbeM00J+1qwd8dsuFpn4VZuEZJwtkrZpAApgT3IUvNmEbTd48JBbzqwO3nlj49XALezCO4QYXLz34M6aOxX6DGPnU1Bbstt4edREEQRLEvJN427d3p6zFVokEkIK82XGRkPXeueahJj4fPZY8h3lSp1lmgtVtZQPz/SE8R8k6WqdYkg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR1001MB2351.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(376002)(136003)(366004)(396003)(39830400003)(346002)(83380400001)(9686003)(26005)(316002)(38100700002)(5660300002)(6512007)(86362001)(38350700002)(6916009)(4326008)(7416002)(1076003)(54906003)(186003)(66556008)(66476007)(52116002)(44832011)(508600001)(8676002)(66946007)(6486002)(2906002)(33656002)(8936002)(6506007);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?hHHlMwmzSfG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dMA4tCKYx2P8eUw3Cj?= X-OriginatorOrg: in-advantage.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2ad3208f-f02d-4e77-dcbf-08da31de158e X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2351.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 May 2022 17:05:14.3499 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 48e842ca-fbd8-4633-a79d-0c955a7d3aae X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: k+Qg6DUl7zGuzrmlZY68RlTZMIjpY1OTRAKuEZuA5k2X3K0i5pT/2HCrxtDPRZ/4XtA0YHmZTJKb0T/QTmLkMpCVNiqHDV9g62BhccBiIEM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR10MB5573 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org On Mon, May 09, 2022 at 10:56:39AM +0000, Vladimir Oltean wrote: > On Sun, May 08, 2022 at 11:53:08AM -0700, Colin Foster wrote: > > The ocelot_regfields struct is common between several different chips, some > > of which can only be controlled externally. Export this structure so it > > doesn't have to be duplicated in these other drivers. > > > > Rename the structure as well, to follow the conventions of other shared > > resources. > > > > Signed-off-by: Colin Foster > > --- > > Doesn't the symbol need to be actually _exported_ (EXPORT_SYMBOL) to > work when CONFIG_MSCC_OCELOT_SWITCH_LIB is a module? Yes. I'll test the module configurations again before future rounds - I admittedly haven't tested those cases in a while. > > > drivers/net/ethernet/mscc/ocelot_vsc7514.c | 60 +--------------------- > > drivers/net/ethernet/mscc/vsc7514_regs.c | 59 +++++++++++++++++++++ > > include/soc/mscc/vsc7514_regs.h | 2 + > > 3 files changed, 62 insertions(+), 59 deletions(-) > > > > diff --git a/drivers/net/ethernet/mscc/ocelot_vsc7514.c b/drivers/net/ethernet/mscc/ocelot_vsc7514.c > > index 68d205088665..a13fec7247d6 100644 > > --- a/drivers/net/ethernet/mscc/ocelot_vsc7514.c > > +++ b/drivers/net/ethernet/mscc/ocelot_vsc7514.c > > @@ -38,64 +38,6 @@ static const u32 *ocelot_regmap[TARGET_MAX] = { > > [DEV_GMII] = vsc7514_dev_gmii_regmap, > > }; > > > > -static const struct reg_field ocelot_regfields[REGFIELD_MAX] = { > > -}; > > - > > static const struct ocelot_stat_layout ocelot_stats_layout[] = { > > { .name = "rx_octets", .offset = 0x00, }, > > { .name = "rx_unicast", .offset = 0x01, }, > > @@ -231,7 +173,7 @@ static int ocelot_chip_init(struct ocelot *ocelot, const struct ocelot_ops *ops) > > ocelot->num_mact_rows = 1024; > > ocelot->ops = ops; > > > > - ret = ocelot_regfields_init(ocelot, ocelot_regfields); > > + ret = ocelot_regfields_init(ocelot, vsc7514_regfields); > > if (ret) > > return ret; > > > > diff --git a/drivers/net/ethernet/mscc/vsc7514_regs.c b/drivers/net/ethernet/mscc/vsc7514_regs.c > > index c2af4eb8ca5d..847e64d11075 100644 > > --- a/drivers/net/ethernet/mscc/vsc7514_regs.c > > +++ b/drivers/net/ethernet/mscc/vsc7514_regs.c > > @@ -9,6 +9,65 @@ > > #include > > #include "ocelot.h" > > > > +const struct reg_field vsc7514_regfields[REGFIELD_MAX] = { > > +}; > > + > > const u32 vsc7514_ana_regmap[] = { > > REG(ANA_ADVLEARN, 0x009000), > > REG(ANA_VLANMASK, 0x009004), > > diff --git a/include/soc/mscc/vsc7514_regs.h b/include/soc/mscc/vsc7514_regs.h > > index ceee26c96959..9b40e7d00ec5 100644 > > --- a/include/soc/mscc/vsc7514_regs.h > > +++ b/include/soc/mscc/vsc7514_regs.h > > @@ -10,6 +10,8 @@ > > > > #include > > > > +extern const struct reg_field vsc7514_regfields[REGFIELD_MAX]; > > + > > extern const u32 vsc7514_ana_regmap[]; > > extern const u32 vsc7514_qs_regmap[]; > > extern const u32 vsc7514_qsys_regmap[]; > > -- > > 2.25.1 > > From mboxrd@z Thu Jan 1 00:00:00 1970 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 BC617C433EF for ; Mon, 9 May 2022 17:06:37 +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:In-Reply-To:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=bGwYUEVyAZI1U6gy5FtiE4jJz1/3pwZf1nxFoPvnDEE=; b=hCSPqGalmi31nG ImcTDnGt43/700M4bNR/BiCYuzQRWr5zv8S/r2mY1Ugr4IjrrokeSAGWrl2pMy4cqtx6+Exk4Mc+W Mgf374XQQxaC068mvkJ9kLPQbuULdzTrUDUA7wvbagmP9RuT7x6wXI0hncgx7HAyDYb5NdAxH4h79 n+JmXibrt18EtIf89YHjy/7azb7EnyjWQz7DyS/uwLaanx8uRC6+s435d9k62ZLX4qIt6eeiigmXg P6Tn3W0mu+UqWwetY5Bhllgikw9/WobnDNRtKL+Pxpi1EpasXOLd+BvQkjjJ4xPmI0Lxz0Y5fCsfj e2M55HkNwrcwI06vJ0eg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1no6p2-00FVzr-S9; Mon, 09 May 2022 17:05:25 +0000 Received: from mail-bn8nam08on20726.outbound.protection.outlook.com ([2a01:111:f400:7e8d::726] helo=NAM04-BN8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1no6oy-00FVxL-5p for linux-arm-kernel@lists.infradead.org; Mon, 09 May 2022 17:05:22 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=a619xj4W1uBPbGh0hVP/PvhgIONu9T5Q+a9ZWjOEGfrjfqwk9OTPmWeF8Jw7Nocdq4oLd2m+l0UjIcEKfFWLCTDqTBQGD20cfvBQC5hHFunOz9hWSfENl8nXmv5fOfj3G9nF8p4Nq1qiw7UJGt1/v1EJ0m3GxAxiyR6wMxyY9c7X6GzmOTUI7OL59dP06aVPtt0p+iYZ/ZeY7xANj/PKY6STky4ksId1PHyfkH/X3b4yEUd0HUSnwJLtSW/cnE54M2EtOodcwT3Fq0K8U3dEhcFTf8zGWsfy1VCjtR1Rdo4zqpEloPsT3mjcXVESDUe1WlZCQVFADnfv3Itlsr8Z1w== 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=4ua/rd01XKu1/g96NDxmvClYCeZdS+A3hZ/jPdk15Mw=; b=ErPCa9PMrQD4fARcqAlw+gE8+ZfT6eQe/WJPjR3Ls6dKa0zygNMVWjPNT5o9lWg+UrsdCPNDB0eamExz517gxJXiO6SJWrwM4o7xjKSiZVO4BJF0EnLDH4uzfVlaPfhmz2IN/lQqVFceptvo9RSFMyBoyGOEU7ofGxeCgZfxrW0O7N4lG5iDIc1XP+8fITw6jtR17DX9DktwMsy9/5VjRViNFZdtk2+PTS5Dy0i4KDnO5eFukGbY/X6iQn4+fRAyIwnsgLn1rzQCXgaFTHkT5bLCgn5uSjkNNQVpmd3RBfeL7lnp+659Iu0LydI34lnMnETPPxn0483lLG2auKvV3A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=in-advantage.com; dmarc=pass action=none header.from=in-advantage.com; dkim=pass header.d=in-advantage.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inadvantage.onmicrosoft.com; s=selector2-inadvantage-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4ua/rd01XKu1/g96NDxmvClYCeZdS+A3hZ/jPdk15Mw=; b=CHhH1hww3K1k/Zrdp3qblueijXVmMxWg1zQonQNoldBaEMk3DcgimgnZJQKEQNr14k0D/AwJMVqfJX1Di8rEWN6fkZVWCAN1UZw2f8LT3zgf5aI5LbxkYTRtKMhv0COD4CRTVWXZU47CHCSnndUJQ6b1VfCGdidt5Nm9OeZ1YuQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=in-advantage.com; Received: from MWHPR1001MB2351.namprd10.prod.outlook.com (2603:10b6:301:35::37) by SN4PR10MB5573.namprd10.prod.outlook.com (2603:10b6:806:204::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.25; Mon, 9 May 2022 17:05:14 +0000 Received: from MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::4581:787c:1a7a:873e]) by MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::4581:787c:1a7a:873e%3]) with mapi id 15.20.5227.020; Mon, 9 May 2022 17:05:14 +0000 Date: Mon, 9 May 2022 17:05:16 -0700 From: Colin Foster To: Vladimir Oltean Cc: "linux-arm-kernel@lists.infradead.org" , "linux-gpio@vger.kernel.org" , "netdev@vger.kernel.org" , Terry Bowman , Wolfram Sang , Andy Shevchenko , Steen Hegelund , Lars Povlsen , Linus Walleij , Russell King , Heiner Kallweit , Paolo Abeni , Jakub Kicinski , Eric Dumazet , "David S. Miller" , Florian Fainelli , Vivien Didelot , Andrew Lunn , "UNGLinuxDriver@microchip.com" , Alexandre Belloni , Claudiu Manoil , Lee Jones Subject: Re: [RFC v8 net-next 11/16] net: mscc: ocelot: expose regfield definition to be used by other drivers Message-ID: <20220510000516.GE895@COLIN-DESKTOP1.localdomain> References: <20220508185313.2222956-1-colin.foster@in-advantage.com> <20220508185313.2222956-12-colin.foster@in-advantage.com> <20220509105638.btfgdr4wt427ewip@skbuf> Content-Disposition: inline In-Reply-To: <20220509105638.btfgdr4wt427ewip@skbuf> X-ClientProxiedBy: BY5PR17CA0032.namprd17.prod.outlook.com (2603:10b6:a03:1b8::45) To MWHPR1001MB2351.namprd10.prod.outlook.com (2603:10b6:301:35::37) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2ad3208f-f02d-4e77-dcbf-08da31de158e X-MS-TrafficTypeDiagnostic: SN4PR10MB5573:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: B1bOQ9nQUTXuXBP7NOEt7t1kZ4CBD6WU3jKpU0GZp+4toFN2j4/EXjqm55T/P2d4foNWG+EdTyaSVh3kbMrKfhqpRzJfFI+MfENDNfmwpxE+gp+oE5aNAwEmveDpj3lxU4jGemBobhaFSJe0JOpqXkGUSV1PMj0vJ0Mi2KXaRkj8e8NqI93Kac6GX8PLFoutGd7xikBwx1ZpB8dWKnTZ4bSzPTwG6BvW6oAwmvbDm3hEO8H9TWT/AsbCjjmlLaLujxnnMaDBvEyh1k9PBKv5CekOm3bfXOf/dIKDkA4znGa/KywWJ7U6BFhafgb6cvckOiH7ULSePicebX5Sc75E2JvG6GuHFDKvztDPa232Zy8MID9KmWD6Psv6fk7/WYyrlcnQGUhIiJZVPWQbcHaQbhQl09SgAaMwsTj2Fj/i89GFjYozwEOWH1BStI31D8J1FIaz7YQAWVj2rMrpqA+SANz1oLJ0793lCk/m81kMzrUmYig4ZMY0eRPCU04XXA88sEzKraKsAnKEHPZrQ2Xj/s2uL6TJXLE3REV6bvOtbeM00J+1qwd8dsuFpn4VZuEZJwtkrZpAApgT3IUvNmEbTd48JBbzqwO3nlj49XALezCO4QYXLz34M6aOxX6DGPnU1Bbstt4edREEQRLEvJN427d3p6zFVokEkIK82XGRkPXeueahJj4fPZY8h3lSp1lmgtVtZQPz/SE8R8k6WqdYkg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR1001MB2351.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(376002)(136003)(366004)(396003)(39830400003)(346002)(83380400001)(9686003)(26005)(316002)(38100700002)(5660300002)(6512007)(86362001)(38350700002)(6916009)(4326008)(7416002)(1076003)(54906003)(186003)(66556008)(66476007)(52116002)(44832011)(508600001)(8676002)(66946007)(6486002)(2906002)(33656002)(8936002)(6506007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?hHHlMwmzSfGM1UZRi/Isxjml+gPngZS7yZUeCMJ/2o0hio+632v0D63CSAwG?= =?us-ascii?Q?GWe95CCtryYHTGAmca08j+eanbaUji/8U1WxutD14qpmS1s++erCt8cYmWol?= =?us-ascii?Q?0a7VmSY8AGwYVP73Sao9YgZKA74/N6OLRe0JIx+aoirZUEPgE1Xx9ahenvUA?= =?us-ascii?Q?m36vpVUAlgRwts6WEukwbVHUt7G7VRwB3cnf6Cv/6ujHj9RyIYLjcy/AVIN0?= =?us-ascii?Q?qfi4oGLNVzl7H3yYpD5BWJG7x+hZC4cWUfd7gtYevH4FE1InUqFhNX6DRPlC?= =?us-ascii?Q?SjmD33Rj4kH5RC6U9F5oN0vStCpD6Zk6EC6owQeEZP3cB7LAbXhdbxRy1rIR?= =?us-ascii?Q?XHPbnyj+5A1Ei7lZplP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VA?= =?us-ascii?Q?u4SnQZnrejtPCbmn8HE9NEeQiTkOsqElYgLGu0mfFXmytaOc0HswvFAuzbb6?= =?us-ascii?Q?lJnu4znhA0OueDk9a+sFpL69qTXteYf36g0d5Zio8SchK0XLmeUs2jVYw1PV?= =?us-ascii?Q?1/C72N9bX9RqmBpCiLwx/pX912h1gUmOYUY7ilzl7scRxmcaQxsjUQWijT7/?= =?us-ascii?Q?gnDsaINe2xVwaWPAQGRD56uA2VQGae7mWFLZQooRE+g8PGAHz/x2S9ft+WvG?= =?us-ascii?Q?LhsHmNnsvyHLrHJCmcztlSXOv4KxhbixakL76KA1psJzQqEua/smxUykIOuV?= =?us-ascii?Q?Oc+tx+K6kZb7cZF4v7NqJfAboBbLnypJ+gdeQwe7Lb7ckq5rr+PAnX8IJrrT?= =?us-ascii?Q?6GSmVk43qQitOV3vEJJd6PWYZ3xLD286XcE5fJ3AUJRs96ZjdoK5AW8yLydR?= =?us-ascii?Q?9Z8o5ECYTiu/1Kkk78BDjHm+3Urp4R9TM7mELkC9fZjFtcU94ecPFR2ZWwJO?= =?us-ascii?Q?P9ShTBTIUeQR8beJvl0UCiClNBK7Rhgi02dMA4tCKYx2P8eUw3Cj?= X-OriginatorOrg: in-advantage.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2ad3208f-f02d-4e77-dcbf-08da31de158e X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2351.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 May 2022 17:05:14.3499 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 48e842ca-fbd8-4633-a79d-0c955a7d3aae X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: k+Qg6DUl7zGuzrmlZY68RlTZMIjpY1OTRAKuEZuA5k2X3K0i5pT/2HCrxtDPRZ/4XtA0YHmZTJKb0T/QTmLkMpCVNiqHDV9g62BhccBiIEM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR10MB5573 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220509_100520_259635_CAF3F713 X-CRM114-Status: GOOD ( 23.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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, May 09, 2022 at 10:56:39AM +0000, Vladimir Oltean wrote: > On Sun, May 08, 2022 at 11:53:08AM -0700, Colin Foster wrote: > > The ocelot_regfields struct is common between several different chips, some > > of which can only be controlled externally. Export this structure so it > > doesn't have to be duplicated in these other drivers. > > > > Rename the structure as well, to follow the conventions of other shared > > resources. > > > > Signed-off-by: Colin Foster > > --- > > Doesn't the symbol need to be actually _exported_ (EXPORT_SYMBOL) to > work when CONFIG_MSCC_OCELOT_SWITCH_LIB is a module? Yes. I'll test the module configurations again before future rounds - I admittedly haven't tested those cases in a while. > > > drivers/net/ethernet/mscc/ocelot_vsc7514.c | 60 +--------------------- > > drivers/net/ethernet/mscc/vsc7514_regs.c | 59 +++++++++++++++++++++ > > include/soc/mscc/vsc7514_regs.h | 2 + > > 3 files changed, 62 insertions(+), 59 deletions(-) > > > > diff --git a/drivers/net/ethernet/mscc/ocelot_vsc7514.c b/drivers/net/ethernet/mscc/ocelot_vsc7514.c > > index 68d205088665..a13fec7247d6 100644 > > --- a/drivers/net/ethernet/mscc/ocelot_vsc7514.c > > +++ b/drivers/net/ethernet/mscc/ocelot_vsc7514.c > > @@ -38,64 +38,6 @@ static const u32 *ocelot_regmap[TARGET_MAX] = { > > [DEV_GMII] = vsc7514_dev_gmii_regmap, > > }; > > > > -static const struct reg_field ocelot_regfields[REGFIELD_MAX] = { > > -}; > > - > > static const struct ocelot_stat_layout ocelot_stats_layout[] = { > > { .name = "rx_octets", .offset = 0x00, }, > > { .name = "rx_unicast", .offset = 0x01, }, > > @@ -231,7 +173,7 @@ static int ocelot_chip_init(struct ocelot *ocelot, const struct ocelot_ops *ops) > > ocelot->num_mact_rows = 1024; > > ocelot->ops = ops; > > > > - ret = ocelot_regfields_init(ocelot, ocelot_regfields); > > + ret = ocelot_regfields_init(ocelot, vsc7514_regfields); > > if (ret) > > return ret; > > > > diff --git a/drivers/net/ethernet/mscc/vsc7514_regs.c b/drivers/net/ethernet/mscc/vsc7514_regs.c > > index c2af4eb8ca5d..847e64d11075 100644 > > --- a/drivers/net/ethernet/mscc/vsc7514_regs.c > > +++ b/drivers/net/ethernet/mscc/vsc7514_regs.c > > @@ -9,6 +9,65 @@ > > #include > > #include "ocelot.h" > > > > +const struct reg_field vsc7514_regfields[REGFIELD_MAX] = { > > +}; > > + > > const u32 vsc7514_ana_regmap[] = { > > REG(ANA_ADVLEARN, 0x009000), > > REG(ANA_VLANMASK, 0x009004), > > diff --git a/include/soc/mscc/vsc7514_regs.h b/include/soc/mscc/vsc7514_regs.h > > index ceee26c96959..9b40e7d00ec5 100644 > > --- a/include/soc/mscc/vsc7514_regs.h > > +++ b/include/soc/mscc/vsc7514_regs.h > > @@ -10,6 +10,8 @@ > > > > #include > > > > +extern const struct reg_field vsc7514_regfields[REGFIELD_MAX]; > > + > > extern const u32 vsc7514_ana_regmap[]; > > extern const u32 vsc7514_qs_regmap[]; > > extern const u32 vsc7514_qsys_regmap[]; > > -- > > 2.25.1 > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel