@@ -731,6 +731,12 @@ int fpga_mgr_register(struct fpga_manager *mgr)
}
EXPORT_SYMBOL_GPL(fpga_mgr_register);
+static void fpga_mgr_fpga_remove(struct fpga_manager *mgr)
+{
+ if (mgr->mops && mgr->mops->fpga_remove)
+ mgr->mops->fpga_remove(mgr);
+}
+
/**
* fpga_mgr_unregister - unregister a FPGA manager
* @mgr: fpga manager struct
@@ -745,8 +751,7 @@ void fpga_mgr_unregister(struct fpga_manager *mgr)
* If the low level driver provides a method for putting fpga into
* a desired state upon unregister, do it.
*/
- if (mgr->mops->fpga_remove)
- mgr->mops->fpga_remove(mgr);
+ fpga_mgr_fpga_remove(mgr);
device_unregister(&mgr->dev);
}