aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget
diff options
context:
space:
mode:
authorAndrzej Pietrasiewicz <andrzej.p@samsung.com>2015-03-03 04:52:30 -0500
committerFelipe Balbi <balbi@ti.com>2015-03-10 16:33:41 -0400
commitd85dc4824c5793f4b71225d7ba5b50e737045830 (patch)
tree4c69bf6aa782b5e09b83b9022e61c62e7f93c71d /drivers/usb/gadget
parent69504f808d6770940f1404b6f6f43c50cfe0be72 (diff)
usb: gadget: f_printer: remove compatibility layer
There are no old interface users left, so it can be removed. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r--drivers/usb/gadget/function/f_printer.c113
1 files changed, 0 insertions, 113 deletions
diff --git a/drivers/usb/gadget/function/f_printer.c b/drivers/usb/gadget/function/f_printer.c
index 93f4d4e61fef..7afe17d76f17 100644
--- a/drivers/usb/gadget/function/f_printer.c
+++ b/drivers/usb/gadget/function/f_printer.c
@@ -57,10 +57,8 @@
57 57
58static int major, minors; 58static int major, minors;
59static struct class *usb_gadget_class; 59static struct class *usb_gadget_class;
60#ifndef USBF_PRINTER_INCLUDED
61static DEFINE_IDA(printer_ida); 60static DEFINE_IDA(printer_ida);
62static DEFINE_MUTEX(printer_ida_lock); /* protects access do printer_ida */ 61static DEFINE_MUTEX(printer_ida_lock); /* protects access do printer_ida */
63#endif
64 62
65/*-------------------------------------------------------------------------*/ 63/*-------------------------------------------------------------------------*/
66 64
@@ -1118,53 +1116,6 @@ fail_tx_reqs:
1118 1116
1119} 1117}
1120 1118
1121#ifdef USBF_PRINTER_INCLUDED
1122static void printer_func_unbind(struct usb_configuration *c,
1123 struct usb_function *f)
1124{
1125 struct printer_dev *dev;
1126 struct usb_request *req;
1127
1128 dev = func_to_printer(f);
1129
1130 device_destroy(usb_gadget_class, MKDEV(major, dev->minor));
1131
1132 /* Remove Character Device */
1133 cdev_del(&dev->printer_cdev);
1134
1135 /* we must already have been disconnected ... no i/o may be active */
1136 WARN_ON(!list_empty(&dev->tx_reqs_active));
1137 WARN_ON(!list_empty(&dev->rx_reqs_active));
1138
1139 /* Free all memory for this driver. */
1140 while (!list_empty(&dev->tx_reqs)) {
1141 req = container_of(dev->tx_reqs.next, struct usb_request,
1142 list);
1143 list_del(&req->list);
1144 printer_req_free(dev->in_ep, req);
1145 }
1146
1147 if (dev->current_rx_req != NULL)
1148 printer_req_free(dev->out_ep, dev->current_rx_req);
1149
1150 while (!list_empty(&dev->rx_reqs)) {
1151 req = container_of(dev->rx_reqs.next,
1152 struct usb_request, list);
1153 list_del(&req->list);
1154 printer_req_free(dev->out_ep, req);
1155 }
1156
1157 while (!list_empty(&dev->rx_buffers)) {
1158 req = container_of(dev->rx_buffers.next,
1159 struct usb_request, list);
1160 list_del(&req->list);
1161 printer_req_free(dev->out_ep, req);
1162 }
1163 usb_free_all_descriptors(f);
1164 kfree(dev);
1165}
1166#endif
1167
1168static int printer_func_set_alt(struct usb_function *f, 1119static int printer_func_set_alt(struct usb_function *f,
1169 unsigned intf, unsigned alt) 1120 unsigned intf, unsigned alt)
1170{ 1121{
@@ -1189,68 +1140,6 @@ static void printer_func_disable(struct usb_function *f)
1189 spin_unlock_irqrestore(&dev->lock, flags); 1140 spin_unlock_irqrestore(&dev->lock, flags);
1190} 1141}
1191 1142
1192#ifdef USBF_PRINTER_INCLUDED
1193static int f_printer_bind_config(struct usb_configuration *c, char *pnp_str,
1194 char *pnp_string, unsigned q_len, int minor)
1195{
1196 struct printer_dev *dev;
1197 int status = -ENOMEM;
1198 size_t len;
1199
1200 if (minor >= minors)
1201 return -ENOENT;
1202
1203 dev = kzalloc(sizeof(*dev), GFP_KERNEL);
1204 if (!dev)
1205 return -ENOMEM;
1206
1207 dev->pnp_string = pnp_string;
1208 dev->minor = minor;
1209
1210 dev->function.name = shortname;
1211 dev->function.bind = printer_func_bind;
1212 dev->function.setup = printer_func_setup;
1213 dev->function.unbind = printer_func_unbind;
1214 dev->function.set_alt = printer_func_set_alt;
1215 dev->function.disable = printer_func_disable;
1216 dev->function.req_match = gprinter_req_match;
1217 INIT_LIST_HEAD(&dev->tx_reqs);
1218 INIT_LIST_HEAD(&dev->rx_reqs);
1219 INIT_LIST_HEAD(&dev->rx_buffers);
1220
1221 if (pnp_str)
1222 strlcpy(&dev->pnp_string[2], pnp_str, PNP_STRING_LEN - 2);
1223
1224 len = strlen(pnp_string);
1225 pnp_string[0] = (len >> 8) & 0xFF;
1226 pnp_string[1] = len & 0xFF;
1227
1228 spin_lock_init(&dev->lock);
1229 mutex_init(&dev->lock_printer_io);
1230 INIT_LIST_HEAD(&dev->tx_reqs_active);
1231 INIT_LIST_HEAD(&dev->rx_reqs_active);
1232 init_waitqueue_head(&dev->rx_wait);
1233 init_waitqueue_head(&dev->tx_wait);
1234 init_waitqueue_head(&dev->tx_flush_wait);
1235
1236 dev->interface = -1;
1237 dev->printer_cdev_open = 0;
1238 dev->printer_status = PRINTER_NOT_ERROR;
1239 dev->current_rx_req = NULL;
1240 dev->current_rx_bytes = 0;
1241 dev->current_rx_buf = NULL;
1242 dev->q_len = q_len;
1243
1244 status = usb_add_function(c, &dev->function);
1245 if (status) {
1246 kfree(dev);
1247 return status;
1248 }
1249
1250 INFO(dev, "%s, version: " DRIVER_VERSION "\n", driver_desc);
1251 return 0;
1252}
1253#else
1254static inline int gprinter_get_minor(void) 1143static inline int gprinter_get_minor(void)
1255{ 1144{
1256 return ida_simple_get(&printer_ida, 0, 0, GFP_KERNEL); 1145 return ida_simple_get(&printer_ida, 0, 0, GFP_KERNEL);
@@ -1422,8 +1311,6 @@ DECLARE_USB_FUNCTION_INIT(printer, gprinter_alloc_inst, gprinter_alloc);
1422MODULE_LICENSE("GPL"); 1311MODULE_LICENSE("GPL");
1423MODULE_AUTHOR("Craig Nadler"); 1312MODULE_AUTHOR("Craig Nadler");
1424 1313
1425#endif
1426
1427static int gprinter_setup(int count) 1314static int gprinter_setup(int count)
1428{ 1315{
1429 int status; 1316 int status;