From patchwork Mon Aug 7 18:05:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 13344691 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 56B92C04A6A for ; Mon, 7 Aug 2023 18:05:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229777AbjHGSFR (ORCPT ); Mon, 7 Aug 2023 14:05:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229775AbjHGSFQ (ORCPT ); Mon, 7 Aug 2023 14:05:16 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01040171E for ; Mon, 7 Aug 2023 11:05:14 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 86D19620B6 for ; Mon, 7 Aug 2023 18:05:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E0E8FC433C9; Mon, 7 Aug 2023 18:05:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691431514; bh=mzk71NWb88xS7VyuFnDy5cLjpTsU/+dCWG/qpNuLc20=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pbH0T0EUr9EOEFuCGdvN0xKqcybFsdQ/MEryb95ofTOyxnbKkR5kN+YuZk45OOUk2 f1sIoe6P21gi52/aBlKkfey+Xpvhct+2XKKklFsvLDJ+labtGibXCwLKSTfa7w0OX8 kpRiVy+I7X50NJ8Z3f8p+Hc1FFfrKn2Cb159xLFJFBCdi65UvNzpw+KU4G9R+rYxjR fVfqpBPjHSK3IFMqxf9ABJW+90GsjxHaFnSwqDA83EaOgOVfY8lQg1FbksLOaVsbwY VB579fN7sxxpuOtKfnXuyjwXO4s48QzuGFqF14yp5yK9NiwN+3X8RbF8tki0L+zQ9l FruIgDqkX8D8Q== From: Saeed Mahameed To: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet Cc: Saeed Mahameed , netdev@vger.kernel.org, Tariq Toukan , linux-hwmon@vger.kernel.org, Jean Delvare , Guenter Roeck , Adham Faris , Gal Pressman Subject: [PATCH net-next V2 1/2] net/mlx5: Expose port.c/mlx5_query_module_num() function Date: Mon, 7 Aug 2023 11:05:06 -0700 Message-ID: <20230807180507.22984-2-saeed@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230807180507.22984-1-saeed@kernel.org> References: <20230807180507.22984-1-saeed@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org From: Adham Faris Make mlx5_query_module_num() defined in port.c, a non-static, so it can be used by other files. CC: linux-hwmon@vger.kernel.org CC: Jean Delvare CC: Guenter Roeck Signed-off-by: Adham Faris Reviewed-by: Tariq Toukan Reviewed-by: Gal Pressman Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h | 1 + drivers/net/ethernet/mellanox/mlx5/core/port.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h b/drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h index 43b0144121ca..d54afb07d972 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h @@ -176,6 +176,7 @@ static inline int mlx5_flexible_inlen(struct mlx5_core_dev *dev, size_t fixed, int mlx5_query_hca_caps(struct mlx5_core_dev *dev); int mlx5_query_board_id(struct mlx5_core_dev *dev); +int mlx5_query_module_num(struct mlx5_core_dev *dev, int *module_num); int mlx5_cmd_init(struct mlx5_core_dev *dev); void mlx5_cmd_cleanup(struct mlx5_core_dev *dev); int mlx5_cmd_enable(struct mlx5_core_dev *dev); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/port.c b/drivers/net/ethernet/mellanox/mlx5/core/port.c index 0daeb4b72cca..be70d1f23a5d 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/port.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/port.c @@ -271,7 +271,7 @@ void mlx5_query_port_oper_mtu(struct mlx5_core_dev *dev, u16 *oper_mtu, } EXPORT_SYMBOL_GPL(mlx5_query_port_oper_mtu); -static int mlx5_query_module_num(struct mlx5_core_dev *dev, int *module_num) +int mlx5_query_module_num(struct mlx5_core_dev *dev, int *module_num) { u32 in[MLX5_ST_SZ_DW(pmlp_reg)] = {0}; u32 out[MLX5_ST_SZ_DW(pmlp_reg)];