aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/huawei/hinic
diff options
context:
space:
mode:
authorJacob Keller <jacob.e.keller@intel.com>2020-09-25 13:46:05 -0700
committerDavid S. Miller <davem@davemloft.net>2020-09-25 17:20:57 -0700
commit22ec3d232f8511b21355fcdb6fb2a4eced3decd8 (patch)
treea7c44209404f8e2692712fce2600ab041264c7a9 /drivers/net/ethernet/huawei/hinic
parentMerge branch 'simplify-TCP-loss-marking-code' (diff)
downloadlinux-dev-22ec3d232f8511b21355fcdb6fb2a4eced3decd8.tar.xz
linux-dev-22ec3d232f8511b21355fcdb6fb2a4eced3decd8.zip
devlink: check flash_update parameter support in net core
When implementing .flash_update, drivers which do not support per-component update are manually checking the component parameter to verify that it is NULL. Without this check, the driver might accept an update request with a component specified even though it will not honor such a request. Instead of having each driver check this, move the logic into net/core/devlink.c, and use a new `supported_flash_update_params` field in the devlink_ops. Drivers which will support per-component update must now specify this by setting DEVLINK_SUPPORT_FLASH_UPDATE_COMPONENT in the supported_flash_update_params in their devlink_ops. This helps ensure that drivers do not forget to check for a NULL component if they do not support per-component update. This also enables a slightly better error message by enabling the core stack to set the netlink bad attribute message to indicate precisely the unsupported attribute in the message. Going forward, any new additional parameter to flash update will require a bit in the supported_flash_update_params bitfield. Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Reviewed-by: Jakub Kicinski <kuba@kernel.org> Cc: Jiri Pirko <jiri@mellanox.com> Cc: Jonathan Corbet <corbet@lwn.net> Cc: Michael Chan <michael.chan@broadcom.com> Cc: Bin Luo <luobin9@huawei.com> Cc: Saeed Mahameed <saeedm@mellanox.com> Cc: Leon Romanovsky <leon@kernel.org> Cc: Ido Schimmel <idosch@mellanox.com> Cc: Danielle Ratson <danieller@mellanox.com> Cc: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/huawei/hinic')
-rw-r--r--drivers/net/ethernet/huawei/hinic/hinic_devlink.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/drivers/net/ethernet/huawei/hinic/hinic_devlink.c b/drivers/net/ethernet/huawei/hinic/hinic_devlink.c
index 16bda7381ba0..662a27a514ae 100644
--- a/drivers/net/ethernet/huawei/hinic/hinic_devlink.c
+++ b/drivers/net/ethernet/huawei/hinic/hinic_devlink.c
@@ -289,9 +289,6 @@ static int hinic_devlink_flash_update(struct devlink *devlink,
const struct firmware *fw;
int err;
- if (component)
- return -EOPNOTSUPP;
-
err = request_firmware_direct(&fw, file_name,
&priv->hwdev->hwif->pdev->dev);
if (err)