summaryrefslogtreecommitdiff
path: root/drivers/usb
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2025-04-03 16:54:59 -0600
committerTom Rini <[email protected]>2025-04-03 16:54:59 -0600
commit1aa8b03c01f72cefee31039571f2de2f4ccfe0eb (patch)
tree06e5b9076311df8043ff67124427c1dee11e952c /drivers/usb
parent1f2a3d066c99f57675162ce09586e9de30407f1b (diff)
parentda8694a7d2cc9fdfd67e8a039ba1e70bdd543d0b (diff)
Merge patch series "membuff: Add tests and update to support a flag for empty/full"
Simon Glass <[email protected]> says: The membuff implementation curently has no tests. It also assumes that head and tail can never correspond unless the buffer is empty. This series provides a compile-time flag to support a 'full' flag. It also adds some tests of the main routines. The data structure is also renamed to membuf which fits better with U-Boot. There may be some cases in the code which could be optimised a little, but the implementation is functional. Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/emul/sandbox_keyb.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/usb/emul/sandbox_keyb.c b/drivers/usb/emul/sandbox_keyb.c
index db769883ba3..5ed8c2c799a 100644
--- a/drivers/usb/emul/sandbox_keyb.c
+++ b/drivers/usb/emul/sandbox_keyb.c
@@ -38,7 +38,7 @@ enum {
*
*/
struct sandbox_keyb_priv {
- struct membuff in;
+ struct membuf in;
};
struct sandbox_keyb_plat {
@@ -167,7 +167,7 @@ int sandbox_usb_keyb_add_string(struct udevice *dev,
struct sandbox_keyb_priv *priv = dev_get_priv(dev);
int ret;
- ret = membuff_put(&priv->in, scancode, USB_KBD_BOOT_REPORT_SIZE);
+ ret = membuf_put(&priv->in, scancode, USB_KBD_BOOT_REPORT_SIZE);
if (ret != USB_KBD_BOOT_REPORT_SIZE)
return -ENOSPC;
@@ -194,7 +194,7 @@ static int sandbox_keyb_interrupt(struct udevice *dev, struct usb_device *udev,
if (length < USB_KBD_BOOT_REPORT_SIZE)
return 0;
- membuff_get(&priv->in, buffer, USB_KBD_BOOT_REPORT_SIZE);
+ membuf_get(&priv->in, buffer, USB_KBD_BOOT_REPORT_SIZE);
return 0;
}
@@ -220,7 +220,7 @@ static int sandbox_keyb_probe(struct udevice *dev)
struct sandbox_keyb_priv *priv = dev_get_priv(dev);
/* Provide an 80 character keyboard buffer */
- return membuff_new(&priv->in, 80 * USB_KBD_BOOT_REPORT_SIZE);
+ return membuf_new(&priv->in, 80 * USB_KBD_BOOT_REPORT_SIZE);
}
static const struct dm_usb_ops sandbox_usb_keyb_ops = {