Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b741ab9d authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

USB: usbtouchscreen.c: remove dbg() usage



dbg() was a very old USB-specific macro that should no longer
be used. This patch removes it from being used in the driver
and uses dev_dbg() instead.

CC: Dmitry Torokhov <dmitry.torokhov@gmail.com>
CC: Henrik Rydberg <rydberg@euromail.se>
CC: Rusty Russell <rusty@rustcorp.com.au>
CC: Viresh Kumar <viresh.kumar@st.com>
CC: Armando Visconti <armando.visconti@st.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6d0f7dcb
Loading
Loading
Loading
Loading
+42 −26
Original line number Diff line number Diff line
@@ -269,7 +269,8 @@ static int e2i_init(struct usbtouch_usb *usbtouch)
	                      0x01, 0x02, 0x0000, 0x0081,
	                      NULL, 0, USB_CTRL_SET_TIMEOUT);

	dbg("%s - usb_control_msg - E2I_RESET - bytes|err: %d",
	dev_dbg(&usbtouch->input->dev,
		"%s - usb_control_msg - E2I_RESET - bytes|err: %d\n",
		__func__, ret);
	return ret;
}
@@ -425,7 +426,8 @@ static int mtouch_init(struct usbtouch_usb *usbtouch)
	                      MTOUCHUSB_RESET,
	                      USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
	                      1, 0, NULL, 0, USB_CTRL_SET_TIMEOUT);
	dbg("%s - usb_control_msg - MTOUCHUSB_RESET - bytes|err: %d",
	dev_dbg(&usbtouch->input->dev,
		"%s - usb_control_msg - MTOUCHUSB_RESET - bytes|err: %d\n",
		__func__, ret);
	if (ret < 0)
		return ret;
@@ -436,7 +438,8 @@ static int mtouch_init(struct usbtouch_usb *usbtouch)
				      MTOUCHUSB_ASYNC_REPORT,
				      USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
				      1, 1, NULL, 0, USB_CTRL_SET_TIMEOUT);
		dbg("%s - usb_control_msg - MTOUCHUSB_ASYNC_REPORT - bytes|err: %d",
		dev_dbg(&usbtouch->input->dev,
			"%s - usb_control_msg - MTOUCHUSB_ASYNC_REPORT - bytes|err: %d\n",
			__func__, ret);
		if (ret >= 0)
			break;
@@ -737,27 +740,29 @@ static int jastec_read_data(struct usbtouch_usb *dev, unsigned char *pkt)
#ifdef CONFIG_TOUCHSCREEN_USB_ZYTRONIC
static int zytronic_read_data(struct usbtouch_usb *dev, unsigned char *pkt)
{
	struct input_dev *input = dev->input;

	switch (pkt[0]) {
	case 0x3A: /* command response */
		dbg("%s: Command response %d", __func__, pkt[1]);
		dev_dbg(&input->dev, "%s: Command response %d\n", __func__, pkt[1]);
		break;

	case 0xC0: /* down */
		dev->x = (pkt[1] & 0x7f) | ((pkt[2] & 0x07) << 7);
		dev->y = (pkt[3] & 0x7f) | ((pkt[4] & 0x07) << 7);
		dev->touch = 1;
		dbg("%s: down %d,%d", __func__, dev->x, dev->y);
		dev_dbg(&input->dev, "%s: down %d,%d\n", __func__, dev->x, dev->y);
		return 1;

	case 0x80: /* up */
		dev->x = (pkt[1] & 0x7f) | ((pkt[2] & 0x07) << 7);
		dev->y = (pkt[3] & 0x7f) | ((pkt[4] & 0x07) << 7);
		dev->touch = 0;
		dbg("%s: up %d,%d", __func__, dev->x, dev->y);
		dev_dbg(&input->dev, "%s: up %d,%d\n", __func__, dev->x, dev->y);
		return 1;

	default:
		dbg("%s: Unknown return %d", __func__, pkt[0]);
		dev_dbg(&input->dev, "%s: Unknown return %d\n", __func__, pkt[0]);
		break;
	}

@@ -812,7 +817,8 @@ static int nexio_alloc(struct usbtouch_usb *usbtouch)

	priv->ack = usb_alloc_urb(0, GFP_KERNEL);
	if (!priv->ack) {
		dbg("%s - usb_alloc_urb failed: usbtouch->ack", __func__);
		dev_dbg(&usbtouch->input->dev,
			"%s - usb_alloc_urb failed: usbtouch->ack\n", __func__);
		goto err_ack_buf;
	}

@@ -1349,6 +1355,7 @@ static void usbtouch_process_multi(struct usbtouch_usb *usbtouch,
static void usbtouch_irq(struct urb *urb)
{
	struct usbtouch_usb *usbtouch = urb->context;
	struct device *dev = &usbtouch->input->dev;
	int retval;

	switch (urb->status) {
@@ -1357,7 +1364,8 @@ static void usbtouch_irq(struct urb *urb)
		break;
	case -ETIME:
		/* this urb is timing out */
		dbg("%s - urb timed out - was the device unplugged?",
		dev_dbg(dev,
			"%s - urb timed out - was the device unplugged?\n",
			__func__);
		return;
	case -ECONNRESET:
@@ -1365,11 +1373,11 @@ static void usbtouch_irq(struct urb *urb)
	case -ESHUTDOWN:
	case -EPIPE:
		/* this urb is terminated, clean up */
		dbg("%s - urb shutting down with status: %d",
		dev_dbg(dev, "%s - urb shutting down with status: %d\n",
			__func__, urb->status);
		return;
	default:
		dbg("%s - nonzero urb status received: %d",
		dev_dbg(dev, "%s - nonzero urb status received: %d\n",
			__func__, urb->status);
		goto exit;
	}
@@ -1457,7 +1465,8 @@ static int usbtouch_reset_resume(struct usb_interface *intf)
	if (usbtouch->type->init) {
		err = usbtouch->type->init(usbtouch);
		if (err) {
			dbg("%s - type->init() failed, err: %d",
			dev_dbg(&input->dev,
				"%s - type->init() failed, err: %d\n",
				__func__, err);
			return err;
		}
@@ -1533,7 +1542,8 @@ static int usbtouch_probe(struct usb_interface *intf,

	usbtouch->irq = usb_alloc_urb(0, GFP_KERNEL);
	if (!usbtouch->irq) {
		dbg("%s - usb_alloc_urb failed: usbtouch->irq", __func__);
		dev_dbg(&intf->dev,
			"%s - usb_alloc_urb failed: usbtouch->irq\n", __func__);
		goto out_free_buffers;
	}

@@ -1595,7 +1605,9 @@ static int usbtouch_probe(struct usb_interface *intf,
	if (type->alloc) {
		err = type->alloc(usbtouch);
		if (err) {
			dbg("%s - type->alloc() failed, err: %d", __func__, err);
			dev_dbg(&intf->dev,
				"%s - type->alloc() failed, err: %d\n",
				__func__, err);
			goto out_free_urb;
		}
	}
@@ -1604,14 +1616,18 @@ static int usbtouch_probe(struct usb_interface *intf,
	if (type->init) {
		err = type->init(usbtouch);
		if (err) {
			dbg("%s - type->init() failed, err: %d", __func__, err);
			dev_dbg(&intf->dev,
				"%s - type->init() failed, err: %d\n",
				__func__, err);
			goto out_do_exit;
		}
	}

	err = input_register_device(usbtouch->input);
	if (err) {
		dbg("%s - input_register_device failed, err: %d", __func__, err);
		dev_dbg(&intf->dev,
			"%s - input_register_device failed, err: %d\n",
			__func__, err);
		goto out_do_exit;
	}

@@ -1652,12 +1668,12 @@ static void usbtouch_disconnect(struct usb_interface *intf)
{
	struct usbtouch_usb *usbtouch = usb_get_intfdata(intf);

	dbg("%s - called", __func__);

	if (!usbtouch)
		return;

	dbg("%s - usbtouch is initialized, cleaning up", __func__);
	dev_dbg(&usbtouch->input->dev,
		"%s - usbtouch is initialized, cleaning up\n", __func__);

	usb_set_intfdata(intf, NULL);
	/* this will stop IO via close */
	input_unregister_device(usbtouch->input);