diff options
author | Tony Lindgren <tony@atomide.com> | 2018-08-28 12:58:03 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2018-08-28 12:58:03 -0400 |
commit | ea4d65f14f6aaa53e379b93c5544245ef081b3e7 (patch) | |
tree | a15485f4f1cf547a52b31fa8e16e14b9579b7200 /drivers/fpga/fpga-mgr.c | |
parent | ce32d59ee2cd036f6e8a6ed17a06a0b0bec5c67c (diff) | |
parent | 496f3347d834aec91c38b45d6249ed00f58ad233 (diff) |
Merge branch 'perm-fix' into omap-for-v4.19/fixes-v2
Diffstat (limited to 'drivers/fpga/fpga-mgr.c')
-rw-r--r-- | drivers/fpga/fpga-mgr.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/fpga/fpga-mgr.c b/drivers/fpga/fpga-mgr.c index c1564cf827fe..a41b07e37884 100644 --- a/drivers/fpga/fpga-mgr.c +++ b/drivers/fpga/fpga-mgr.c | |||
@@ -406,12 +406,40 @@ static ssize_t state_show(struct device *dev, | |||
406 | return sprintf(buf, "%s\n", state_str[mgr->state]); | 406 | return sprintf(buf, "%s\n", state_str[mgr->state]); |
407 | } | 407 | } |
408 | 408 | ||
409 | static ssize_t status_show(struct device *dev, | ||
410 | struct device_attribute *attr, char *buf) | ||
411 | { | ||
412 | struct fpga_manager *mgr = to_fpga_manager(dev); | ||
413 | u64 status; | ||
414 | int len = 0; | ||
415 | |||
416 | if (!mgr->mops->status) | ||
417 | return -ENOENT; | ||
418 | |||
419 | status = mgr->mops->status(mgr); | ||
420 | |||
421 | if (status & FPGA_MGR_STATUS_OPERATION_ERR) | ||
422 | len += sprintf(buf + len, "reconfig operation error\n"); | ||
423 | if (status & FPGA_MGR_STATUS_CRC_ERR) | ||
424 | len += sprintf(buf + len, "reconfig CRC error\n"); | ||
425 | if (status & FPGA_MGR_STATUS_INCOMPATIBLE_IMAGE_ERR) | ||
426 | len += sprintf(buf + len, "reconfig incompatible image\n"); | ||
427 | if (status & FPGA_MGR_STATUS_IP_PROTOCOL_ERR) | ||
428 | len += sprintf(buf + len, "reconfig IP protocol error\n"); | ||
429 | if (status & FPGA_MGR_STATUS_FIFO_OVERFLOW_ERR) | ||
430 | len += sprintf(buf + len, "reconfig fifo overflow error\n"); | ||
431 | |||
432 | return len; | ||
433 | } | ||
434 | |||
409 | static DEVICE_ATTR_RO(name); | 435 | static DEVICE_ATTR_RO(name); |
410 | static DEVICE_ATTR_RO(state); | 436 | static DEVICE_ATTR_RO(state); |
437 | static DEVICE_ATTR_RO(status); | ||
411 | 438 | ||
412 | static struct attribute *fpga_mgr_attrs[] = { | 439 | static struct attribute *fpga_mgr_attrs[] = { |
413 | &dev_attr_name.attr, | 440 | &dev_attr_name.attr, |
414 | &dev_attr_state.attr, | 441 | &dev_attr_state.attr, |
442 | &dev_attr_status.attr, | ||
415 | NULL, | 443 | NULL, |
416 | }; | 444 | }; |
417 | ATTRIBUTE_GROUPS(fpga_mgr); | 445 | ATTRIBUTE_GROUPS(fpga_mgr); |