@@ -426,6 +426,14 @@ static ssize_t state_show(struct device *dev,
return sprintf(buf, "%s\n", state_str[mgr->state]);
}
+static u64 fpga_mgr_status(struct fpga_manager *mgr)
+{
+ if (mgr->mops && mgr->mops->status)
+ return mgr->mops->status(mgr);
+
+ return 0;
+}
+
static ssize_t status_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
@@ -433,10 +441,7 @@ static ssize_t status_show(struct device *dev,
u64 status;
int len = 0;
- if (!mgr->mops->status)
- return -ENOENT;
-
- status = mgr->mops->status(mgr);
+ status = fpga_mgr_status(mgr);
if (status & FPGA_MGR_STATUS_OPERATION_ERR)
len += sprintf(buf + len, "reconfig operation error\n");