-# Copyright (c) 2024 Cisco and/or its affiliates.
+# Copyright (c) 2025 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
:type pci_addrs: list
"""
for pci_addr in pci_addrs:
- DUTSetup.pci_driver_unbind(node, pci_addr)
+ cur_driver = DUTSetup.get_pci_dev_driver(node, pci_addr)
+ if cur_driver:
+ DUTSetup.pci_driver_unbind(node, pci_addr)
DUTSetup.pci_driver_bind(node, pci_addr, driver)
@staticmethod