mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-27 04:22:58 +00:00
devlink: Allow control devlink ops behavior through feature mask
Introduce new devlink call to set feature mask to control devlink behavior during device initialization phase after devlink_alloc() is already called. This allows us to set reload ops based on device property which is not known at the beginning of driver initialization. For the sake of simplicity, this API lacks any type of locking and needs to be called before devlink_register() to make sure that no parallel access to the ops is possible at this stage. Signed-off-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
b88f7b1203
commit
bd032e35c5
@@ -1511,6 +1511,7 @@ int nsim_dev_probe(struct nsim_bus_dev *nsim_bus_dev)
|
||||
goto err_psample_exit;
|
||||
|
||||
nsim_dev->esw_mode = DEVLINK_ESWITCH_MODE_LEGACY;
|
||||
devlink_set_features(devlink, DEVLINK_F_RELOAD);
|
||||
devlink_register(devlink);
|
||||
devlink_reload_enable(devlink);
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user