]> Git Repo - linux.git/blobdiff - drivers/fpga/fpga-bridge.c
Merge tag 'ceph-for-6.3-rc1' of https://github.com/ceph/ceph-client
[linux.git] / drivers / fpga / fpga-bridge.c
index 727704431f618411a4172842a4e81b2ce4f39c56..5cd40acab5bfb85f52302ea244c2906af1213f1f 100644 (file)
@@ -293,12 +293,15 @@ static ssize_t state_show(struct device *dev,
                          struct device_attribute *attr, char *buf)
 {
        struct fpga_bridge *bridge = to_fpga_bridge(dev);
-       int enable = 1;
+       int state = 1;
 
-       if (bridge->br_ops && bridge->br_ops->enable_show)
-               enable = bridge->br_ops->enable_show(bridge);
+       if (bridge->br_ops && bridge->br_ops->enable_show) {
+               state = bridge->br_ops->enable_show(bridge);
+               if (state < 0)
+                       return state;
+       }
 
-       return sprintf(buf, "%s\n", enable ? "enabled" : "disabled");
+       return sysfs_emit(buf, "%s\n", state ? "enabled" : "disabled");
 }
 
 static DEVICE_ATTR_RO(name);
This page took 0.045022 seconds and 4 git commands to generate.