|
@@ -559,6 +559,21 @@ int xenbus_scanf(struct xenbus_transaction t,
|
|
|
}
|
|
|
EXPORT_SYMBOL_GPL(xenbus_scanf);
|
|
|
|
|
|
+/* Read an (optional) unsigned value. */
|
|
|
+unsigned int xenbus_read_unsigned(const char *dir, const char *node,
|
|
|
+ unsigned int default_val)
|
|
|
+{
|
|
|
+ unsigned int val;
|
|
|
+ int ret;
|
|
|
+
|
|
|
+ ret = xenbus_scanf(XBT_NIL, dir, node, "%u", &val);
|
|
|
+ if (ret <= 0)
|
|
|
+ val = default_val;
|
|
|
+
|
|
|
+ return val;
|
|
|
+}
|
|
|
+EXPORT_SYMBOL_GPL(xenbus_read_unsigned);
|
|
|
+
|
|
|
/* Single printf and write: returns -errno or 0. */
|
|
|
int xenbus_printf(struct xenbus_transaction t,
|
|
|
const char *dir, const char *node, const char *fmt, ...)
|