summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget/function/u_printer.h
diff options
context:
space:
mode:
authorKrzysztof Opasiak <k.opasiak@samsung.com>2016-12-21 09:48:45 +0100
committerFelipe Balbi <felipe.balbi@linux.intel.com>2017-01-24 11:04:08 +0200
commitfdc01cc286be9d32140631469b7608f3f58c2db3 (patch)
tree4e16bc3744f4e5a4e1751d08a4b5a80f0eab44f4 /drivers/usb/gadget/function/u_printer.h
parent00b6c62eb74d665caa7e399ffd5da55572b61c50 (diff)
usb: gadget: printer: Remove pnp_string static buffer
pnp string is usually much shorter than 1k so let's stop wasting 1k of memory for its buffer and make it dynamically alocated. This also removes 1k len limitation for pnp_string and adds a new line after string content if required. Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb/gadget/function/u_printer.h')
-rw-r--r--drivers/usb/gadget/function/u_printer.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/usb/gadget/function/u_printer.h b/drivers/usb/gadget/function/u_printer.h
index 0e2c49d4274e..8d30b7577f87 100644
--- a/drivers/usb/gadget/function/u_printer.h
+++ b/drivers/usb/gadget/function/u_printer.h
@@ -18,12 +18,11 @@
#include <linux/usb/composite.h>
-#define PNP_STRING_LEN 1024
-
struct f_printer_opts {
struct usb_function_instance func_inst;
int minor;
- char pnp_string[PNP_STRING_LEN];
+ char *pnp_string;
+ bool pnp_string_allocated;
unsigned q_len;
/*