Message ID | 20221127081604.5242-5-mailhol.vincent@wanadoo.fr |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp5014704wrr; Sun, 27 Nov 2022 00:37:58 -0800 (PST) X-Google-Smtp-Source: AA0mqf5Uu32fF/XMjEUI/i/9HSPq+PpmjdfSrgOQKlJJiQU37LnY1Va/6B5Es7venx76uNN/m7eo X-Received: by 2002:a17:902:ee55:b0:189:69cf:9ea0 with SMTP id 21-20020a170902ee5500b0018969cf9ea0mr9910449plo.37.1669538278598; Sun, 27 Nov 2022 00:37:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669538278; cv=none; d=google.com; s=arc-20160816; b=v1IBYTTWAWbB2DOxG5LX6WA+HIkSiu8MQInouZCwINJOxR9qUGcmePyDEk8T45QHe3 mvgGBclugTd7a941ERBqArJhGc+Sx8/8bgqYV0gga88Yadq6qM3Lj2EdZtADAho7njrO tbMA/Q67VhSTGYiFYOnRQs1mOZhO91AdMzcCZVpOuw71UTn2qaDGbXF0k7luBrctvVAw hUM+5P7iy1IJsWXgzJ4ybbw5ziiWW4sWm76ifOy+DBkL2GjZqUVr4Ke+KdvXA0iKzEHU UlQefRWbWbVB4r9zhJKOf62SVU/FS2nqea4Yep/rseIyCNcANe3ey5/VZdpni15htAnw /GBg== 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=OxNviUPHTCGHIw1xqWHS/MPtnV3RpWOBq4yIBMcYMgw=; b=b6Yp3M5wTL7zV+w9hr6DNVgwMvTdHwuGWlR6R/hxCcJGBagPT68PWR7Ie559/4mNna sPRlLlJdvaLwDwhr6TlAbptrLSSji4VwyMKKYVM54f6fg2cO+LEOtsBzihpwO7J3ffVD aFC/KM8xeXoicqSZCr0pRooBYShiJ601MySiDyRndbmIh9Mtv6k9U1fkRl/a7iDWeP01 bPOOkEI57U3hZl6xXIJJ/Zo2x/zJraIBdEa9pO83zptd9dY+xS2yPRBToBZyuQLR9tIu RXvxE3cnYKAaa2E+Z3o83aEdUQQztnccKIP22GdzEe+v4xzxQdfKob2Z8nOPg0NrjkBw G8rQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=eetLQF5U; 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 x5-20020a654145000000b00476e21bc1bdsi4022746pgp.162.2022.11.27.00.37.36; Sun, 27 Nov 2022 00:37:58 -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=eetLQF5U; 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 S229730AbiK0ISV (ORCPT <rfc822;chrisjones.unixmen@gmail.com> + 99 others); Sun, 27 Nov 2022 03:18:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229563AbiK0IRU (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 27 Nov 2022 03:17:20 -0500 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 18C2513E9A; Sun, 27 Nov 2022 00:17:03 -0800 (PST) Received: by mail-pj1-x102d.google.com with SMTP id b11so6883632pjp.2; Sun, 27 Nov 2022 00:17:03 -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=OxNviUPHTCGHIw1xqWHS/MPtnV3RpWOBq4yIBMcYMgw=; b=eetLQF5UODffxdiWFfOUJ5V4jEbJDflupjuyH8LBZdfHVWyl8GtBDfs47imz2/w1Ac r66dRHi/VUwY0i1SSYFvVAOgkRQWkWFrNFs2GxutGJ4PtJBCtwSzc91hJaZakzsuSSXr kluV/KoBcwQfC+aRTmuQmb0amOmSVvdgKRFspB8LWrihiPvpBBYY8Pebno7RcDphFLwU DDONZA1BKxs2jKU5hBMPWHp+Iw19R1aAX416kSVs4ab4Dl/Au17ETkW8cs+CCpJXUmqC K11/HcAEWmPB3v8c6Vrh+wtz00n+vr6dIPpL1uniILBFZI0Eus1lKC+4pUdbKNlKDY9S s0fg== 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=OxNviUPHTCGHIw1xqWHS/MPtnV3RpWOBq4yIBMcYMgw=; b=TcVb4hWEeGNv7p7fHB6rYyX2sxoFj7rFjRgR0kiMl4y9o5RP/Te/gRCyElgBy6YPV8 BC++3+vbHlX3EJRESdYsyYeobHBuOpL9ZJxxjCeG43RV5Ds/5zWlRIDOyywGQ7yK6lZk YfXkvIBkRzc+TDE/wPJoUl4RqgS7n2cwUcUSUFZ7nIT7ImZ+5I/cHCPbta2NNIbVfrWQ qVehHumaq6Zz6buST+YGdtfXLs+5cAr8dUy5Z+ZHKhbytGu4RTTw59tEasTUYSEoOWdR /m1fdPrPQisCQiYKSw1EEH4KQE+1lQjRfddOIBN4LB7jU74C4BVrDAY3RO2RNtbHVAdC fErQ== X-Gm-Message-State: ANoB5pm4nBb/o3jXZ7syZBaaiEj5/x93TNx4/gBrj1tOEQN+ABdXzJlx 2Heg4JQqRV+HypTex58HRNs= X-Received: by 2002:a17:902:f80b:b0:188:4e75:7365 with SMTP id ix11-20020a170902f80b00b001884e757365mr28594068plb.102.1669537023058; Sun, 27 Nov 2022 00:17:03 -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.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Nov 2022 00:17:02 -0800 (PST) Sender: Vincent Mailhol <vincent.mailhol@gmail.com> From: Vincent Mailhol <mailhol.vincent@wanadoo.fr> To: Jiri Pirko <jiri@nvidia.com>, netdev@vger.kernel.org, Jakub Kicinski <kuba@kernel.org> Cc: "David S . Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Paolo Abeni <pabeni@redhat.com>, linux-kernel@vger.kernel.org, Boris Brezillon <bbrezillon@kernel.org>, Arnaud Ebalard <arno@natisbad.org>, Srujana Challa <schalla@marvell.com>, Kurt Kanzenbach <kurt@linutronix.de>, Andrew Lunn <andrew@lunn.ch>, Florian Fainelli <f.fainelli@gmail.com>, Vladimir Oltean <olteanv@gmail.com>, Michael Chan <michael.chan@broadcom.com>, Ioana Ciornei <ioana.ciornei@nxp.com>, Dimitris Michailidis <dmichail@fungible.com>, Yisen Zhuang <yisen.zhuang@huawei.com>, Salil Mehta <salil.mehta@huawei.com>, Jesse Brandeburg <jesse.brandeburg@intel.com>, Tony Nguyen <anthony.l.nguyen@intel.com>, Sunil Goutham <sgoutham@marvell.com>, Linu Cherian <lcherian@marvell.com>, Geetha sowjanya <gakula@marvell.com>, Jerin Jacob <jerinj@marvell.com>, hariprasad <hkelam@marvell.com>, Subbaraya Sundeep <sbhatta@marvell.com>, Taras Chornyi <tchornyi@marvell.com>, Saeed Mahameed <saeedm@nvidia.com>, Leon Romanovsky <leon@kernel.org>, Ido Schimmel <idosch@nvidia.com>, Petr Machata <petrm@nvidia.com>, Simon Horman <simon.horman@corigine.com>, Shannon Nelson <snelson@pensando.io>, drivers@pensando.io, Ariel Elior <aelior@marvell.com>, Manish Chopra <manishc@marvell.com>, Jonathan Lemon <jonathan.lemon@gmail.com>, Vadim Fedorenko <vadfed@fb.com>, Richard Cochran <richardcochran@gmail.com>, Vadim Pasternak <vadimp@mellanox.com>, Shalom Toledo <shalomt@mellanox.com>, linux-crypto@vger.kernel.org, intel-wired-lan@lists.osuosl.org, linux-rdma@vger.kernel.org, oss-drivers@corigine.com, Vincent Mailhol <mailhol.vincent@wanadoo.fr> Subject: [PATCH net-next v2 4/5] net: devlink: remove devlink_info_driver_name_put() Date: Sun, 27 Nov 2022 17:16:03 +0900 Message-Id: <20221127081604.5242-5-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 Content-Transfer-Encoding: 8bit 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750637770146323061?= X-GMAIL-MSGID: =?utf-8?q?1750637770146323061?= |
Series |
net: devlink: return the driver name in devlink_nl_info_fill
|
|
Commit Message
Vincent Mailhol
Nov. 27, 2022, 8:16 a.m. UTC
Now that the core sets the driver name attribute, drivers are not
supposed to call devlink_info_driver_name_put() anymore. Remove it.
Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
---
include/net/devlink.h | 2 --
net/core/devlink.c | 11 ++---------
2 files changed, 2 insertions(+), 11 deletions(-)
Comments
Hi Vincent,
I love your patch! Yet something to improve:
[auto build test ERROR on net-next/master]
url: https://github.com/intel-lab-lkp/linux/commits/Vincent-Mailhol/mlxsw-minimal-fix-mlxsw_m_module_get_drvinfo-to-correctly-report-driver-name/20221127-171657
patch link: https://lore.kernel.org/r/20221127081604.5242-5-mailhol.vincent%40wanadoo.fr
patch subject: [PATCH net-next v2 4/5] net: devlink: remove devlink_info_driver_name_put()
config: x86_64-randconfig-a016
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/intel-lab-lkp/linux/commit/32018f68afc2b6dca866e1cdf0e5417ef4413d75
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Vincent-Mailhol/mlxsw-minimal-fix-mlxsw_m_module_get_drvinfo-to-correctly-report-driver-name/20221127-171657
git checkout 32018f68afc2b6dca866e1cdf0e5417ef4413d75
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
>> drivers/net/ethernet/mellanox/mlxsw/core.c:1463:8: error: implicit declaration of function 'devlink_info_driver_name_put' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
err = devlink_info_driver_name_put(req,
^
drivers/net/ethernet/mellanox/mlxsw/core.c:1463:8: note: did you mean 'devlink_info_serial_number_put'?
include/net/devlink.h:1747:5: note: 'devlink_info_serial_number_put' declared here
int devlink_info_serial_number_put(struct devlink_info_req *req,
^
1 error generated.
vim +/devlink_info_driver_name_put +1463 drivers/net/ethernet/mellanox/mlxsw/core.c
1ceecc88d29bbb Jiri Pirko 2016-04-14 1450
a9c8336f65446b Shalom Toledo 2019-04-08 1451 static int
a9c8336f65446b Shalom Toledo 2019-04-08 1452 mlxsw_devlink_info_get(struct devlink *devlink, struct devlink_info_req *req,
a9c8336f65446b Shalom Toledo 2019-04-08 1453 struct netlink_ext_ack *extack)
a9c8336f65446b Shalom Toledo 2019-04-08 1454 {
a9c8336f65446b Shalom Toledo 2019-04-08 1455 struct mlxsw_core *mlxsw_core = devlink_priv(devlink);
92f165ec5b1e76 Vincent Mailhol 2022-11-27 1456 struct device *dev = mlxsw_core->bus_info->dev;
a9c8336f65446b Shalom Toledo 2019-04-08 1457 char fw_info_psid[MLXSW_REG_MGIR_FW_INFO_PSID_SIZE];
a9c8336f65446b Shalom Toledo 2019-04-08 1458 u32 hw_rev, fw_major, fw_minor, fw_sub_minor;
a9c8336f65446b Shalom Toledo 2019-04-08 1459 char mgir_pl[MLXSW_REG_MGIR_LEN];
a9c8336f65446b Shalom Toledo 2019-04-08 1460 char buf[32];
a9c8336f65446b Shalom Toledo 2019-04-08 1461 int err;
a9c8336f65446b Shalom Toledo 2019-04-08 1462
a9c8336f65446b Shalom Toledo 2019-04-08 @1463 err = devlink_info_driver_name_put(req,
92f165ec5b1e76 Vincent Mailhol 2022-11-27 1464 dev_driver_string(dev->parent));
a9c8336f65446b Shalom Toledo 2019-04-08 1465 if (err)
a9c8336f65446b Shalom Toledo 2019-04-08 1466 return err;
a9c8336f65446b Shalom Toledo 2019-04-08 1467
a9c8336f65446b Shalom Toledo 2019-04-08 1468 mlxsw_reg_mgir_pack(mgir_pl);
a9c8336f65446b Shalom Toledo 2019-04-08 1469 err = mlxsw_reg_query(mlxsw_core, MLXSW_REG(mgir), mgir_pl);
a9c8336f65446b Shalom Toledo 2019-04-08 1470 if (err)
a9c8336f65446b Shalom Toledo 2019-04-08 1471 return err;
a9c8336f65446b Shalom Toledo 2019-04-08 1472 mlxsw_reg_mgir_unpack(mgir_pl, &hw_rev, fw_info_psid, &fw_major,
a9c8336f65446b Shalom Toledo 2019-04-08 1473 &fw_minor, &fw_sub_minor);
a9c8336f65446b Shalom Toledo 2019-04-08 1474
a9c8336f65446b Shalom Toledo 2019-04-08 1475 sprintf(buf, "%X", hw_rev);
a9c8336f65446b Shalom Toledo 2019-04-08 1476 err = devlink_info_version_fixed_put(req, "hw.revision", buf);
a9c8336f65446b Shalom Toledo 2019-04-08 1477 if (err)
a9c8336f65446b Shalom Toledo 2019-04-08 1478 return err;
a9c8336f65446b Shalom Toledo 2019-04-08 1479
7dafcc4c9dfb41 Jiri Pirko 2021-05-26 1480 err = devlink_info_version_fixed_put(req,
7dafcc4c9dfb41 Jiri Pirko 2021-05-26 1481 DEVLINK_INFO_VERSION_GENERIC_FW_PSID,
7dafcc4c9dfb41 Jiri Pirko 2021-05-26 1482 fw_info_psid);
a9c8336f65446b Shalom Toledo 2019-04-08 1483 if (err)
a9c8336f65446b Shalom Toledo 2019-04-08 1484 return err;
a9c8336f65446b Shalom Toledo 2019-04-08 1485
a9c8336f65446b Shalom Toledo 2019-04-08 1486 sprintf(buf, "%d.%d.%d", fw_major, fw_minor, fw_sub_minor);
a9c8336f65446b Shalom Toledo 2019-04-08 1487 err = devlink_info_version_running_put(req, "fw.version", buf);
a9c8336f65446b Shalom Toledo 2019-04-08 1488 if (err)
a9c8336f65446b Shalom Toledo 2019-04-08 1489 return err;
a9c8336f65446b Shalom Toledo 2019-04-08 1490
f55c998c274e3b Jiri Pirko 2021-05-26 1491 return devlink_info_version_running_put(req,
f55c998c274e3b Jiri Pirko 2021-05-26 1492 DEVLINK_INFO_VERSION_GENERIC_FW,
f55c998c274e3b Jiri Pirko 2021-05-26 1493 buf);
a9c8336f65446b Shalom Toledo 2019-04-08 1494 }
a9c8336f65446b Shalom Toledo 2019-04-08 1495
Hi Vincent,
I love your patch! Yet something to improve:
[auto build test ERROR on net-next/master]
url: https://github.com/intel-lab-lkp/linux/commits/Vincent-Mailhol/mlxsw-minimal-fix-mlxsw_m_module_get_drvinfo-to-correctly-report-driver-name/20221127-171657
patch link: https://lore.kernel.org/r/20221127081604.5242-5-mailhol.vincent%40wanadoo.fr
patch subject: [PATCH net-next v2 4/5] net: devlink: remove devlink_info_driver_name_put()
config: x86_64-allyesconfig
compiler: gcc-11 (Debian 11.3.0-8) 11.3.0
reproduce (this is a W=1 build):
# https://github.com/intel-lab-lkp/linux/commit/32018f68afc2b6dca866e1cdf0e5417ef4413d75
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Vincent-Mailhol/mlxsw-minimal-fix-mlxsw_m_module_get_drvinfo-to-correctly-report-driver-name/20221127-171657
git checkout 32018f68afc2b6dca866e1cdf0e5417ef4413d75
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
drivers/net/ethernet/mellanox/mlxsw/core.c: In function 'mlxsw_devlink_info_get':
>> drivers/net/ethernet/mellanox/mlxsw/core.c:1463:15: error: implicit declaration of function 'devlink_info_driver_name_put'; did you mean 'devlink_info_serial_number_put'? [-Werror=implicit-function-declaration]
1463 | err = devlink_info_driver_name_put(req,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
| devlink_info_serial_number_put
cc1: some warnings being treated as errors
vim +1463 drivers/net/ethernet/mellanox/mlxsw/core.c
1ceecc88d29bbb Jiri Pirko 2016-04-14 1450
a9c8336f65446b Shalom Toledo 2019-04-08 1451 static int
a9c8336f65446b Shalom Toledo 2019-04-08 1452 mlxsw_devlink_info_get(struct devlink *devlink, struct devlink_info_req *req,
a9c8336f65446b Shalom Toledo 2019-04-08 1453 struct netlink_ext_ack *extack)
a9c8336f65446b Shalom Toledo 2019-04-08 1454 {
a9c8336f65446b Shalom Toledo 2019-04-08 1455 struct mlxsw_core *mlxsw_core = devlink_priv(devlink);
92f165ec5b1e76 Vincent Mailhol 2022-11-27 1456 struct device *dev = mlxsw_core->bus_info->dev;
a9c8336f65446b Shalom Toledo 2019-04-08 1457 char fw_info_psid[MLXSW_REG_MGIR_FW_INFO_PSID_SIZE];
a9c8336f65446b Shalom Toledo 2019-04-08 1458 u32 hw_rev, fw_major, fw_minor, fw_sub_minor;
a9c8336f65446b Shalom Toledo 2019-04-08 1459 char mgir_pl[MLXSW_REG_MGIR_LEN];
a9c8336f65446b Shalom Toledo 2019-04-08 1460 char buf[32];
a9c8336f65446b Shalom Toledo 2019-04-08 1461 int err;
a9c8336f65446b Shalom Toledo 2019-04-08 1462
a9c8336f65446b Shalom Toledo 2019-04-08 @1463 err = devlink_info_driver_name_put(req,
92f165ec5b1e76 Vincent Mailhol 2022-11-27 1464 dev_driver_string(dev->parent));
a9c8336f65446b Shalom Toledo 2019-04-08 1465 if (err)
a9c8336f65446b Shalom Toledo 2019-04-08 1466 return err;
a9c8336f65446b Shalom Toledo 2019-04-08 1467
a9c8336f65446b Shalom Toledo 2019-04-08 1468 mlxsw_reg_mgir_pack(mgir_pl);
a9c8336f65446b Shalom Toledo 2019-04-08 1469 err = mlxsw_reg_query(mlxsw_core, MLXSW_REG(mgir), mgir_pl);
a9c8336f65446b Shalom Toledo 2019-04-08 1470 if (err)
a9c8336f65446b Shalom Toledo 2019-04-08 1471 return err;
a9c8336f65446b Shalom Toledo 2019-04-08 1472 mlxsw_reg_mgir_unpack(mgir_pl, &hw_rev, fw_info_psid, &fw_major,
a9c8336f65446b Shalom Toledo 2019-04-08 1473 &fw_minor, &fw_sub_minor);
a9c8336f65446b Shalom Toledo 2019-04-08 1474
a9c8336f65446b Shalom Toledo 2019-04-08 1475 sprintf(buf, "%X", hw_rev);
a9c8336f65446b Shalom Toledo 2019-04-08 1476 err = devlink_info_version_fixed_put(req, "hw.revision", buf);
a9c8336f65446b Shalom Toledo 2019-04-08 1477 if (err)
a9c8336f65446b Shalom Toledo 2019-04-08 1478 return err;
a9c8336f65446b Shalom Toledo 2019-04-08 1479
7dafcc4c9dfb41 Jiri Pirko 2021-05-26 1480 err = devlink_info_version_fixed_put(req,
7dafcc4c9dfb41 Jiri Pirko 2021-05-26 1481 DEVLINK_INFO_VERSION_GENERIC_FW_PSID,
7dafcc4c9dfb41 Jiri Pirko 2021-05-26 1482 fw_info_psid);
a9c8336f65446b Shalom Toledo 2019-04-08 1483 if (err)
a9c8336f65446b Shalom Toledo 2019-04-08 1484 return err;
a9c8336f65446b Shalom Toledo 2019-04-08 1485
a9c8336f65446b Shalom Toledo 2019-04-08 1486 sprintf(buf, "%d.%d.%d", fw_major, fw_minor, fw_sub_minor);
a9c8336f65446b Shalom Toledo 2019-04-08 1487 err = devlink_info_version_running_put(req, "fw.version", buf);
a9c8336f65446b Shalom Toledo 2019-04-08 1488 if (err)
a9c8336f65446b Shalom Toledo 2019-04-08 1489 return err;
a9c8336f65446b Shalom Toledo 2019-04-08 1490
f55c998c274e3b Jiri Pirko 2021-05-26 1491 return devlink_info_version_running_put(req,
f55c998c274e3b Jiri Pirko 2021-05-26 1492 DEVLINK_INFO_VERSION_GENERIC_FW,
f55c998c274e3b Jiri Pirko 2021-05-26 1493 buf);
a9c8336f65446b Shalom Toledo 2019-04-08 1494 }
a9c8336f65446b Shalom Toledo 2019-04-08 1495
diff --git a/include/net/devlink.h b/include/net/devlink.h index 074a79b8933f..52d5fb67e9b8 100644 --- a/include/net/devlink.h +++ b/include/net/devlink.h @@ -1746,8 +1746,6 @@ int devlink_region_snapshot_create(struct devlink_region *region, u8 *data, u32 snapshot_id); int devlink_info_serial_number_put(struct devlink_info_req *req, const char *sn); -int devlink_info_driver_name_put(struct devlink_info_req *req, - const char *name); int devlink_info_board_serial_number_put(struct devlink_info_req *req, const char *bsn); diff --git a/net/core/devlink.c b/net/core/devlink.c index 6478135d9ba1..3babc16eeb6b 100644 --- a/net/core/devlink.c +++ b/net/core/devlink.c @@ -6633,14 +6633,6 @@ static int devlink_nl_cmd_region_read_dumpit(struct sk_buff *skb, return err; } -int devlink_info_driver_name_put(struct devlink_info_req *req, const char *name) -{ - if (!req->msg) - return 0; - return nla_put_string(req->msg, DEVLINK_ATTR_INFO_DRIVER_NAME, name); -} -EXPORT_SYMBOL_GPL(devlink_info_driver_name_put); - int devlink_info_serial_number_put(struct devlink_info_req *req, const char *sn) { if (!req->msg) @@ -6756,7 +6748,8 @@ static int devlink_nl_driver_info_get(struct device_driver *drv, return 0; if (drv->name[0]) - return devlink_info_driver_name_put(req, drv->name); + return nla_put_string(req->msg, DEVLINK_ATTR_INFO_DRIVER_NAME, + drv->name); return 0; }