From patchwork Sun Nov 27 08:16:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Mailhol X-Patchwork-Id: 26320 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp5008790wrr; Sun, 27 Nov 2022 00:18:12 -0800 (PST) X-Google-Smtp-Source: AA0mqf5xgSRgBezEMiYYcDZrJqGl/2fpXFL3YP/6Axe0wkpXosI6C77OVRi2fIUjhl3y5hSWDN4H X-Received: by 2002:a17:90a:f104:b0:218:bd1d:37ad with SMTP id cc4-20020a17090af10400b00218bd1d37admr30702969pjb.39.1669537092685; Sun, 27 Nov 2022 00:18:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669537092; cv=none; d=google.com; s=arc-20160816; b=WRp8LtmwoyhdN8CuH2cLXoFnz1M69v+jv0YDnmBxi03urM6UZ3cJen9MiMVp3Y+ESJ 1L3CrbG8l+YyAqoQx1vOo/uR9fambFNTfLRw0RS7WehyZWBpYLlal5rSVLgh6ZLWZKMP P3vW7PINv5AXnfOhAyfqB5AfRfvZYnkRCgJ1iz8YNJw5WKaB74qA7Ji9cWO+/zlVT2XL aV1/8VVz1/gXQB65LHcQu4GnKcBMKMVdLIBAR0GqhJsSUVAWuFSFVAXv4FhKyFkVz06b 0L0N3OtJpd38otcQBRkUo6igUGxiI1kV7tCEW35ITvwveo2SeQDaXSGS7zz9hUIw3wpM bzRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from:sender :dkim-signature; bh=O3+WXaZIvwYScbYyJSTwVsoviigX0ePJBx5g3Z25JEw=; b=dmaSWX5BpzYoMEnsZMT6Ku33kaia/ruOm0KXmWwUuE1y++CwydOwgauAJDcVj4cZ8j V7s9miQJpV7H8Bl3B0DjE3/n7K/6U6AlVDxUeKm6bg6CiJPE24WHzAD6Tfdm2VlNWgU2 5iB4KVMH1zwZu3XUQCxLzxWdiU3JHWr745jwzEUuQPCjMVL/dqYw7+5KUAxFLQdmRVGj fRsddoRDGxYgkwb72AF0eEKPMnyOr0laIuHQi/131zKynCdQe6yRrHJb8hJ1JjEwx7va 2Pyi4wlslqEAwERytDqrHjubrPyvPLzDZFuGQJSCxGzoAksfRm/3qYc7Cfuls+gWxLKR GVFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="SzYATP/W"; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x125-20020a633183000000b0042b49305d68si9298957pgx.194.2022.11.27.00.17.55; Sun, 27 Nov 2022 00:18:12 -0800 (PST) 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=@gmail.com header.s=20210112 header.b="SzYATP/W"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229621AbiK0IQz (ORCPT + 99 others); Sun, 27 Nov 2022 03:16:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229575AbiK0IQo (ORCPT ); Sun, 27 Nov 2022 03:16:44 -0500 Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D7C910063; Sun, 27 Nov 2022 00:16:38 -0800 (PST) Received: by mail-pj1-x102c.google.com with SMTP id mv18so6905458pjb.0; Sun, 27 Nov 2022 00:16:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=O3+WXaZIvwYScbYyJSTwVsoviigX0ePJBx5g3Z25JEw=; b=SzYATP/WvbrMPMeCmP13X7/vxMj9pdZXQOcaUDB61TKbTZD2j/3L/fcK89A5FdCNDB beyDVDaBw/Orpqr9oVtEOHrXHffe1lMYorIUUfNX5wisADjYBwBjvKLDRWltJ3iM7hGt j6Ur3plBe2qiKKzLGyyDNF+6c69LNJtw7woa6EkXwcKvuIrhq7Y4ppByK3LgaRHtOElv bhvswFat/v3oISyh03365opnwQRRkaFlOyEuoXaVpXik0GGSz4BDtvTVsiq4VpaIJhnp lwY7CoBZ/q3hW/AwPaE6a+gzbEea+cRSlAljPpT4rOCTjblu21Mg12GI2G+XlzIforVh Ya3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=O3+WXaZIvwYScbYyJSTwVsoviigX0ePJBx5g3Z25JEw=; b=JaQRNdoRDHX9YVF/fr2WYwtOFYjttsd8viXfZu3lbI5V1FEE0gOfL/mTWgfm4Dy788 GRwDsgJPkEbuN/H4/TZfSft+6OVmtt4NtgqwgeSvoMzCTPxmzXMo33bmmNiakHw48gGR v9VHyZeO4nVF1XoQ+w2V+x/svSjERK6XOtjfKwozTZEgOv59CcfpnZJMf4ZTCHD4Qsc2 K2rWaDZAQDMJXFaLi0vfXyEjcQl+1Y/hbSuUon5PVCLXvnygfIz2KrviC5B4fhmNGyLG o9LRSm5H6jr9kvQ6ENR2V6vDhMwsPjvl0akn/avcKoF1TzNRYS4g41e37RFxhV4jm4Uh Vj0w== X-Gm-Message-State: ANoB5pltArZasdi7IVBgooZOXU/oiRedPso7B0P8osUWhDQACAlXNcIf bBV6zsJSwPxXpCrompALhL8= X-Received: by 2002:a17:902:a601:b0:189:8001:b54f with SMTP id u1-20020a170902a60100b001898001b54fmr3122555plq.37.1669536998039; Sun, 27 Nov 2022 00:16:38 -0800 (PST) Received: from localhost.localdomain (124x33x176x97.ap124.ftth.ucom.ne.jp. [124.33.176.97]) by smtp.gmail.com with ESMTPSA id a3-20020aa794a3000000b00572c12a1e91sm5799915pfl.48.2022.11.27.00.16.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Nov 2022 00:16:37 -0800 (PST) Sender: Vincent Mailhol From: Vincent Mailhol To: Jiri Pirko , netdev@vger.kernel.org, Jakub Kicinski Cc: "David S . Miller" , Eric Dumazet , Paolo Abeni , linux-kernel@vger.kernel.org, Boris Brezillon , Arnaud Ebalard , Srujana Challa , Kurt Kanzenbach , Andrew Lunn , Florian Fainelli , Vladimir Oltean , Michael Chan , Ioana Ciornei , Dimitris Michailidis , Yisen Zhuang , Salil Mehta , Jesse Brandeburg , Tony Nguyen , Sunil Goutham , Linu Cherian , Geetha sowjanya , Jerin Jacob , hariprasad , Subbaraya Sundeep , Taras Chornyi , Saeed Mahameed , Leon Romanovsky , Ido Schimmel , Petr Machata , Simon Horman , Shannon Nelson , drivers@pensando.io, Ariel Elior , Manish Chopra , Jonathan Lemon , Vadim Fedorenko , Richard Cochran , Vadim Pasternak , Shalom Toledo , linux-crypto@vger.kernel.org, intel-wired-lan@lists.osuosl.org, linux-rdma@vger.kernel.org, oss-drivers@corigine.com, Vincent Mailhol , Ido Schimmel Subject: [PATCH net-next v2 1/5] mlxsw: minimal: fix mlxsw_m_module_get_drvinfo() to correctly report driver name Date: Sun, 27 Nov 2022 17:16:00 +0900 Message-Id: <20221127081604.5242-2-mailhol.vincent@wanadoo.fr> X-Mailer: git-send-email 2.37.4 In-Reply-To: <20221127081604.5242-1-mailhol.vincent@wanadoo.fr> References: <20221122154934.13937-1-mailhol.vincent@wanadoo.fr> <20221127081604.5242-1-mailhol.vincent@wanadoo.fr> MIME-Version: 1.0 X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS autolearn=no 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750636526891677544?= X-GMAIL-MSGID: =?utf-8?q?1750636526891677544?= Currently, mlxsw_m_module_get_drvinfo() reports the device_kind. The device_kind is not necessarily the same as the device_name. For example, the mlxsw_i2c implementation sets up the device_kind as ic2_client::name in [1] which indicates the type of the device (e.g. chip name), not the actual driver name. Fix it so that it correctly reports the driver name. [1] https://elixir.bootlin.com/linux/v6.1-rc1/source/drivers/net/ethernet/mellanox/mlxsw/i2c.c#L714 Fixes: 9bbd7efbc055 ("mlxsw: i2c: Extend initialization with querying firmware info") CC: Shalom Toledo CC: Ido Schimmel CC: Vadim Pasternak Signed-off-by: Vincent Mailhol --- drivers/net/ethernet/mellanox/mlxsw/minimal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/minimal.c b/drivers/net/ethernet/mellanox/mlxsw/minimal.c index 6b56eadd736e..9b37ddbe0cba 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/minimal.c +++ b/drivers/net/ethernet/mellanox/mlxsw/minimal.c @@ -92,7 +92,7 @@ static void mlxsw_m_module_get_drvinfo(struct net_device *dev, struct mlxsw_m_port *mlxsw_m_port = netdev_priv(dev); struct mlxsw_m *mlxsw_m = mlxsw_m_port->mlxsw_m; - strscpy(drvinfo->driver, mlxsw_m->bus_info->device_kind, + strscpy(drvinfo->driver, dev_driver_string(dev->dev.parent), sizeof(drvinfo->driver)); snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version), "%d.%d.%d",