speedtch usbatm.c,1.16,1.17

Duncan Sands duncan at infradead.org
Thu Apr 7 18:10:16 EDT 2005


Update of /home/cvs/speedtch
In directory phoenix.infradead.org:/tmp/cvs-serv22932

Modified Files:
	usbatm.c 
Log Message:
Use the new output macros.  Also, rename dev to usb_dev in some places, and
some other small tweaks.


Index: usbatm.c
===================================================================
RCS file: /home/cvs/speedtch/usbatm.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- usbatm.c	1 Apr 2005 10:16:22 -0000	1.16
+++ usbatm.c	7 Apr 2005 22:10:14 -0000	1.17
@@ -249,7 +249,7 @@
 		vci = ((source[1] & 0x0f) << 12) | (source[2] << 4) | (source[3] >> 4);
 		pti = (source[3] & 0x2) != 0;
 
-		vdbg("usbatm_extract_cells: vpi %hd, vci %d, pti %d", vpi, vci, pti);
+		vdbg("%s: vpi %hd, vci %d, pti %d", __func__, vpi, vci, pti);
 
 		if (cached_vcc && (vci == cached_vci) && (vpi == cached_vpi))
 			vcc_data = cached_vcc;
@@ -258,7 +258,7 @@
 			cached_vpi = vpi;
 			cached_vci = vci;
 		} else {
-			dbg("usbatm_extract_cells: unknown vpi/vci (%hd/%d)!", vpi, vci);
+			atm_dbg(instance, "%s: unknown vpi/vci (%hd/%d)!\n", __func__, vpi, vci);
 			continue;
 		}
 
@@ -266,7 +266,8 @@
 		sarb = vcc_data->sarb;
 
 		if (sarb->tail + ATM_CELL_PAYLOAD > sarb->end) {
-			dbg("usbatm_extract_cells: buffer overrun (sarb->len %u, vcc: 0x%p)!", sarb->len, vcc);
+			atm_dbg(instance, "%s: buffer overrun (sarb->len %u, vcc: 0x%p)!\n",
+					__func__, sarb->len, vcc);
 			/* discard cells already received */
 			skb_trim(sarb, 0);
 		}
@@ -283,7 +284,8 @@
 
 			/* guard against overflow */
 			if (length > ATM_MAX_AAL5_PDU) {
-				dbg("usbatm_extract_cells: bogus length %u (vcc: 0x%p)!", length, vcc);
+				atm_dbg(instance, "%s: bogus length %u (vcc: 0x%p)!\n",
+						__func__, length, vcc);
 				atomic_inc(&vcc->stats->rx_err);
 				goto out;
 			}
@@ -291,29 +293,31 @@
 			pdu_length = UDSL_NUM_CELLS(length) * ATM_CELL_PAYLOAD;
 
 			if (sarb->len < pdu_length) {
-				dbg("usbatm_extract_cells: bogus pdu_length %u (sarb->len: %u, vcc: 0x%p)!", pdu_length, sarb->len, vcc);
+				atm_dbg(instance, "%s: bogus pdu_length %u (sarb->len: %u, vcc: 0x%p)!\n",
+						__func__, pdu_length, sarb->len, vcc);
 				atomic_inc(&vcc->stats->rx_err);
 				goto out;
 			}
 
 			if (crc32_be(~0, sarb->tail - pdu_length, pdu_length) != 0xc704dd7b) {
-				dbg("usbatm_extract_cells: packet failed crc check (vcc: 0x%p)!", vcc);
+				atm_dbg(instance, "%s: packet failed crc check (vcc: 0x%p)!\n",
+						__func__, vcc);
 				atomic_inc(&vcc->stats->rx_err);
 				goto out;
 			}
 
-			vdbg("usbatm_extract_cells: got packet (length: %u, pdu_length: %u, vcc: 0x%p)", length, pdu_length, vcc);
+			vdbg("%s: got packet (length: %u, pdu_length: %u, vcc: 0x%p)", __func__, length, pdu_length, vcc);
 
 			if (!(skb = dev_alloc_skb(length))) {
-				dbg("usbatm_extract_cells: no memory for skb (length: %u)!", length);
+				atm_dbg(instance, "%s: no memory for skb (length: %u)!\n", __func__, length);
 				atomic_inc(&vcc->stats->rx_drop);
 				goto out;
 			}
 
-			vdbg("usbatm_extract_cells: allocated new sk_buff (skb: 0x%p, skb->truesize: %u)", skb, skb->truesize);
+			vdbg("%s: allocated new sk_buff (skb: 0x%p, skb->truesize: %u)", __func__, skb, skb->truesize);
 
 			if (!atm_charge(vcc, skb->truesize)) {
-				dbg("usbatm_extract_cells: failed atm_charge (skb->truesize: %u)!", skb->truesize);
+				atm_dbg(instance, "%s: failed atm_charge (skb->truesize: %u)!\n", __func__, skb->truesize);
 				dev_kfree_skb(skb);
 				goto out;	/* atm_charge increments rx_drop */
 			}
@@ -321,7 +325,8 @@
 			memcpy(skb->data, sarb->tail - pdu_length, length);
 			__skb_put(skb, length);
 
-			vdbg("usbatm_extract_cells: sending skb 0x%p, skb->len %u, skb->truesize %u", skb, skb->len, skb->truesize);
+			vdbg("%s: sending skb 0x%p, skb->len %u, skb->truesize %u",
+					__func__, skb, skb->len, skb->truesize);
 
 			PACKETDEBUG(skb->data, skb->len);
 
@@ -391,7 +396,8 @@
 	unsigned char *target = *target_p;
 	unsigned int nc, ne, i;
 
-	vdbg("usbatm_write_cells: howmany=%u, skb->len=%d, num_cells=%u, num_entire=%u, pdu_padding=%u", howmany, skb->len, ctrl->num_cells, ctrl->num_entire, ctrl->pdu_padding);
+	vdbg("%s: howmany=%u, skb->len=%d, num_cells=%u, num_entire=%u, pdu_padding=%u",
+			__func__, howmany, skb->len, ctrl->num_cells, ctrl->num_entire, ctrl->pdu_padding);
 
 	nc = ctrl->num_cells;
 	ne = min(howmany, ctrl->num_entire);
@@ -465,7 +471,7 @@
 	unsigned long flags;
 
 	if (!urb || !(rcv = urb->context)) {
-		dbg("usbatm_complete_receive: bad urb!");
+		dbg("%s: bad urb!", __func__);
 		return;
 	}
 
@@ -474,7 +480,8 @@
 
 	buf->filled_cells = urb->actual_length / (ATM_CELL_SIZE + instance->rx_padding);
 
-	vdbg("usbatm_complete_receive: urb 0x%p, status %d, actual_length %d, filled_cells %u, rcv 0x%p, buf 0x%p", urb, urb->status, urb->actual_length, buf->filled_cells, rcv, buf);
+	vdbg("%s: urb 0x%p, status %d, actual_length %d, filled_cells %u, rcv 0x%p, buf 0x%p",
+			__func__, urb, urb->status, urb->actual_length, buf->filled_cells, rcv, buf);
 
 	UDSL_ASSERT(buf->filled_cells <= rcv_buf_size);
 
@@ -518,11 +525,11 @@
 				  rcv_buf_size * (ATM_CELL_SIZE + instance->rx_padding),
 				  usbatm_complete_receive, rcv);
 
-		vdbg("usbatm_process_receive: sending urb 0x%p, rcv 0x%p, buf 0x%p",
-		     rcv->urb, rcv, buf);
+		vdbg("%s: sending urb 0x%p, rcv 0x%p, buf 0x%p",
+				__func__, rcv->urb, rcv, buf);
 
 		if ((err = usb_submit_urb(rcv->urb, GFP_ATOMIC)) < 0) {
-			dbg("usbatm_process_receive: urb submission failed (%d)!", err);
+			atm_dbg(instance, "%s: urb submission failed (%d)!\n", __func__, err);
 			list_add(&buf->list, &instance->spare_receive_buffers);
 			spin_lock_irq(&instance->receive_lock);
 			list_add(&rcv->list, &instance->spare_receivers);
@@ -541,7 +548,7 @@
 	list_del(&buf->list);
 	spin_unlock_irq(&instance->receive_lock);
 
-	vdbg("usbatm_process_receive: processing buf 0x%p", buf);
+	vdbg("%s: processing buf 0x%p", __func__, buf);
 	usbatm_extract_cells(instance, buf->base, buf->filled_cells);
 	list_add(&buf->list, &instance->spare_receive_buffers);
 	goto made_progress;
@@ -558,12 +565,12 @@
 	unsigned long flags;
 
 	if (!urb || !(snd = urb->context) || !(instance = snd->instance)) {
-		dbg("usbatm_complete_send: bad urb!");
+		dbg("%s: bad urb!", __func__);
 		return;
 	}
 
-	vdbg("usbatm_complete_send: urb 0x%p, status %d, snd 0x%p, buf 0x%p", urb,
-	     urb->status, snd, snd->buffer);
+	vdbg("%s: urb 0x%p, status %d, snd 0x%p, buf 0x%p",
+			__func__, urb, urb->status, snd, snd->buffer);
 
 	/* may not be in_interrupt() */
 	spin_lock_irqsave(&instance->send_lock, flags);
@@ -606,11 +613,11 @@
 				  (snd_buf_size - buf->free_cells) * (ATM_CELL_SIZE + instance->tx_padding),
 				  usbatm_complete_send, snd);
 
-		vdbg("usbatm_process_send: submitting urb 0x%p (%d cells), snd 0x%p, buf 0x%p",
-		     snd->urb, snd_buf_size - buf->free_cells, snd, buf);
+		vdbg("%s: submitting urb 0x%p (%d cells), snd 0x%p, buf 0x%p",
+				__func__, snd->urb, snd_buf_size - buf->free_cells, snd, buf);
 
 		if ((err = usb_submit_urb(snd->urb, GFP_ATOMIC)) < 0) {
-			dbg("usbatm_process_send: urb submission failed (%d)!", err);
+			atm_dbg(instance, "%s: urb submission failed (%d)!\n", __func__, err);
 			spin_lock_irq(&instance->send_lock);
 			list_add(&snd->list, &instance->spare_senders);
 			spin_unlock_irq(&instance->send_lock);
@@ -649,16 +656,16 @@
 
 	num_written = usbatm_write_cells(instance, buf->free_cells, skb, &buf->free_start);
 
-	vdbg("usbatm_process_send: wrote %u cells from skb 0x%p to buffer 0x%p",
-	     num_written, skb, buf);
+	vdbg("%s: wrote %u cells from skb 0x%p to buffer 0x%p",
+			__func__, num_written, skb, buf);
 
 	if (!(buf->free_cells -= num_written)) {
 		list_add_tail(&buf->list, &instance->filled_send_buffers);
 		instance->current_buffer = NULL;
 	}
 
-	vdbg("usbatm_process_send: buffer contains %d cells, %d left",
-	     snd_buf_size - buf->free_cells, buf->free_cells);
+	vdbg("%s: buffer contains %d cells, %d left",
+			__func__, snd_buf_size - buf->free_cells, buf->free_cells);
 
 	if (!UDSL_SKB(skb)->num_cells) {
 		struct atm_vcc *vcc = UDSL_SKB(skb)->atm_data.vcc;
@@ -672,18 +679,17 @@
 	goto made_progress;
 }
 
-static void usbatm_cancel_send(struct usbatm_data *instance,
-			     struct atm_vcc *vcc)
+static void usbatm_cancel_send(struct usbatm_data *instance, struct atm_vcc *vcc)
 {
 	struct sk_buff *skb, *n;
 
-	dbg("usbatm_cancel_send entered");
+	atm_dbg(instance, "%s entered\n", __func__);
 	spin_lock_irq(&instance->sndqueue.lock);
 	for (skb = instance->sndqueue.next, n = skb->next;
 	     skb != (struct sk_buff *)&instance->sndqueue;
 	     skb = n, n = skb->next)
 		if (UDSL_SKB(skb)->atm_data.vcc == vcc) {
-			dbg("usbatm_cancel_send: popping skb 0x%p", skb);
+			atm_dbg(instance, "%s: popping skb 0x%p\n", __func__, skb);
 			__skb_unlink(skb, &instance->sndqueue);
 			usbatm_pop(vcc, skb);
 		}
@@ -691,12 +697,12 @@
 
 	tasklet_disable(&instance->send_tasklet);
 	if ((skb = instance->current_skb) && (UDSL_SKB(skb)->atm_data.vcc == vcc)) {
-		dbg("usbatm_cancel_send: popping current skb (0x%p)", skb);
+		atm_dbg(instance, "%s: popping current skb (0x%p)\n", __func__, skb);
 		instance->current_skb = NULL;
 		usbatm_pop(vcc, skb);
 	}
 	tasklet_enable(&instance->send_tasklet);
-	dbg("usbatm_cancel_send done");
+	atm_dbg(instance, "%s done\n", __func__);
 }
 
 static int usbatm_atm_send(struct atm_vcc *vcc, struct sk_buff *skb)
@@ -704,23 +710,23 @@
 	struct usbatm_data *instance = vcc->dev->dev_data;
 	int err;
 
-	vdbg("usbatm_atm_send called (skb 0x%p, len %u)", skb, skb->len);
+	vdbg("%s called (skb 0x%p, len %u)", __func__, skb, skb->len);
 
 	if (!instance) {
-		dbg("usbatm_atm_send: NULL data!");
+		dbg("%s: NULL data!", __func__);
 		err = -ENODEV;
 		goto fail;
 	}
 
 	if (vcc->qos.aal != ATM_AAL5) {
-		dbg("usbatm_atm_send: unsupported ATM type %d!", vcc->qos.aal);
+		atm_dbg(instance, "%s: unsupported ATM type %d!\n", __func__, vcc->qos.aal);
 		err = -EINVAL;
 		goto fail;
 	}
 
 	if (skb->len > ATM_MAX_AAL5_PDU) {
-		dbg("usbatm_atm_send: packet too long (%d vs %d)!", skb->len,
-		    ATM_MAX_AAL5_PDU);
+		atm_dbg(instance, "%s: packet too long (%d vs %d)!\n",
+				__func__, skb->len, ATM_MAX_AAL5_PDU);
 		err = -EINVAL;
 		goto fail;
 	}
@@ -747,7 +753,7 @@
 {
 	struct usbatm_data *instance = container_of(kref, struct usbatm_data, refcount);
 
-	dbg("usbatm_destroy_instance");
+	dbg("%s", __func__);
 
 	tasklet_kill(&instance->receive_tasklet);
 	tasklet_kill(&instance->send_tasklet);
@@ -757,14 +763,14 @@
 
 void usbatm_get_instance(struct usbatm_data *instance)
 {
-	dbg("usbatm_get_instance");
+	dbg("%s", __func__);
 
 	kref_get(&instance->refcount);
 }
 
 void usbatm_put_instance(struct usbatm_data *instance)
 {
-	dbg("usbatm_put_instance");
+	dbg("%s", __func__);
 
 	kref_put(&instance->refcount, usbatm_destroy_instance);
 }
@@ -778,7 +784,7 @@
 {
 	struct usbatm_data *instance = dev->dev_data;
 
-	dbg("usbatm_atm_dev_close");
+	dbg("%s", __func__);
 
 	if (!instance)
 		return;
@@ -793,7 +799,7 @@
 	int left = *pos;
 
 	if (!instance) {
-		dbg("usbatm_atm_proc_read: NULL instance!");
+		dbg("%s: NULL instance!", __func__);
 		return -ENODEV;
 	}
 
@@ -836,30 +842,30 @@
 	int vci = vcc->vci;
 	short vpi = vcc->vpi;
 
-	dbg("usbatm_atm_open: vpi %hd, vci %d", vpi, vci);
-
 	if (!instance) {
-		dbg("usbatm_atm_open: NULL data!");
+		dbg("%s: NULL data!", __func__);
 		return -ENODEV;
 	}
 
+	atm_dbg(instance, "%s: vpi %hd, vci %d\n", __func__, vpi, vci);
+
 	/* only support AAL5 */
 	if ((vcc->qos.aal != ATM_AAL5) || (vcc->qos.rxtp.max_sdu < 0)
 	    || (vcc->qos.rxtp.max_sdu > ATM_MAX_AAL5_PDU)) {
-		dbg("usbatm_atm_open: unsupported ATM type %d!", vcc->qos.aal);
+		atm_dbg(instance, "%s: unsupported ATM type %d!\n", __func__, vcc->qos.aal);
 		return -EINVAL;
 	}
 
 	down(&instance->serialize);	/* vs self, usbatm_atm_close */
 
 	if (usbatm_find_vcc(instance, vpi, vci)) {
-		dbg("usbatm_atm_open: %hd/%d already in use!", vpi, vci);
+		atm_dbg(instance, "%s: %hd/%d already in use!\n", __func__, vpi, vci);
 		up(&instance->serialize);
 		return -EADDRINUSE;
 	}
 
 	if (!(new = kmalloc(sizeof(struct usbatm_vcc_data), GFP_KERNEL))) {
-		dbg("usbatm_atm_open: no memory for vcc_data!");
+		atm_dbg(instance, "%s: no memory for vcc_data!\n", __func__);
 		up(&instance->serialize);
 		return -ENOMEM;
 	}
@@ -872,7 +878,7 @@
 	/* usbatm_extract_cells requires at least one cell */
 	max_pdu = max(1, UDSL_NUM_CELLS(vcc->qos.rxtp.max_sdu)) * ATM_CELL_PAYLOAD;
 	if (!(new->sarb = alloc_skb(max_pdu, GFP_KERNEL))) {
-		dbg("usbatm_atm_open: no memory for SAR buffer!");
+		atm_dbg(instance, "%s: no memory for SAR buffer!\n", __func__);
 		kfree(new);
 		up(&instance->serialize);
 		return -ENOMEM;
@@ -892,7 +898,7 @@
 
 	tasklet_schedule(&instance->receive_tasklet);
 
-	dbg("usbatm_atm_open: allocated vcc data 0x%p (max_pdu: %u)", new, max_pdu);
+	atm_dbg(instance, "%s: allocated vcc data 0x%p (max_pdu: %u)\n", __func__, new, max_pdu);
 
 	return 0;
 }
@@ -902,15 +908,15 @@
 	struct usbatm_data *instance = vcc->dev->dev_data;
 	struct usbatm_vcc_data *vcc_data = vcc->dev_data;
 
-	dbg("usbatm_atm_close called");
-
 	if (!instance || !vcc_data) {
-		dbg("usbatm_atm_close: NULL data!");
+		dbg("%s: NULL data!", __func__);
 		return;
 	}
 
-	dbg("usbatm_atm_close: deallocating vcc 0x%p with vpi %d vci %d",
-	    vcc_data, vcc_data->vpi, vcc_data->vci);
+	atm_dbg(instance, "%s entered\n", __func__);
+
+	atm_dbg(instance, "%s: deallocating vcc 0x%p with vpi %d vci %d\n",
+	    __func__, vcc_data, vcc_data->vpi, vcc_data->vci);
 
 	usbatm_cancel_send(instance, vcc);
 
@@ -934,7 +940,7 @@
 
 	up(&instance->serialize);
 
-	dbg("usbatm_atm_close successful");
+	atm_dbg(instance, "%s successful\n", __func__);
 }
 
 static int usbatm_atm_ioctl(struct atm_dev *dev, unsigned int cmd,
@@ -956,7 +962,7 @@
 	/* ATM init */
 	atm_dev = atm_dev_register(instance->driver_name, &usbatm_atm_devops, -1, NULL);
 	if (!atm_dev) {
-		dbg("usbatm_atm_init: failed to register ATM device!");
+		usb_dbg(instance, "%s: failed to register ATM device!\n", __func__);
 		return -1;
 	}
 
@@ -970,7 +976,7 @@
 	atm_dev->link_rate = 128 * 1000 / 424;
 
 	if (instance->driver->atm_start && ((ret = instance->driver->atm_start(instance, atm_dev)) < 0)) {
-		dbg("usbatm_atm_init: atm_start failed: %d!", ret);
+		atm_dbg(instance, "%s: atm_start failed: %d!\n", __func__, ret);
 		goto fail;
 	}
 
@@ -1019,7 +1025,7 @@
 	int ret = kernel_thread(usbatm_do_heavy_init, instance, CLONE_KERNEL);
 
 	if (ret < 0) {
-		dbg("usbatm_heavy_init: failed to create kernel_thread (%d)!", ret);
+		usb_dbg(instance, "%s: failed to create kernel_thread (%d)!\n", __func__, ret);
 		return ret;
 	}
 
@@ -1035,22 +1041,23 @@
 int usbatm_usb_probe (struct usb_interface *intf, const struct usb_device_id *id,
 		struct usbatm_driver *driver)
 {
-	struct usb_device *dev = interface_to_usbdev(intf);
+	struct device *dev = &intf->dev;
+	struct usb_device *usb_dev = interface_to_usbdev(intf);
 	struct usbatm_data *instance;
 	char *buf;
 	int error = -ENOMEM;
 	int i, length;
 	int need_heavy;
 
-	dev_dbg(&intf->dev, "trying driver %s with vendor=0x%x, product=0x%x, ifnum %d\n",
-			driver->driver_name,
-			le16_to_cpu(dev->descriptor.idVendor),
-			le16_to_cpu(dev->descriptor.idProduct),
+	dev_dbg(dev, "%s: trying driver %s with vendor=0x%x, product=0x%x, ifnum %d\n",
+			__func__, driver->driver_name,
+			le16_to_cpu(usb_dev->descriptor.idVendor),
+			le16_to_cpu(usb_dev->descriptor.idProduct),
 			intf->altsetting->desc.bInterfaceNumber);
 
 	/* instance init */
 	if (!(instance = kmalloc(sizeof(*instance), GFP_KERNEL))) {
-		dev_dbg(&intf->dev, "no memory for instance data!\n");
+		dev_dbg(dev, "%s: no memory for instance data!\n", __func__);
 		return -ENOMEM;
 	}
 
@@ -1061,17 +1068,17 @@
 	instance->driver = driver;
 	snprintf(instance->driver_name, sizeof(instance->driver_name), driver->driver_name);
 
-	instance->usb_dev = dev;
+	instance->usb_dev = usb_dev;
 	instance->usb_intf = intf;
-	instance->tx_endpoint = usb_sndbulkpipe(dev, driver->out);
-	instance->rx_endpoint = usb_rcvbulkpipe(dev, driver->in);
+	instance->tx_endpoint = usb_sndbulkpipe(usb_dev, driver->out);
+	instance->rx_endpoint = usb_rcvbulkpipe(usb_dev, driver->in);
 	instance->tx_padding = driver->tx_padding;
 	instance->rx_padding = driver->rx_padding;
 
 	buf = instance->description;
 	length = sizeof(instance->description);
 
-	if ((i = usb_string(dev, dev->descriptor.iProduct, buf, length)) < 0)
+	if ((i = usb_string(usb_dev, usb_dev->descriptor.iProduct, buf, length)) < 0)
 		goto bind;
 
 	buf += i;
@@ -1081,7 +1088,7 @@
 	buf += i;
 	length -= i;
 
-	if (length <= 0 || (i = usb_make_path(dev, buf, length)) < 0)
+	if (length <= 0 || (i = usb_make_path(usb_dev, buf, length)) < 0)
 		goto bind;
 
 	buf += i;
@@ -1092,7 +1099,7 @@
  bind:
 	need_heavy = 1;
 	if (driver->bind && (error = driver->bind(instance, intf, id, &need_heavy)) < 0) {
-			dev_dbg(&intf->dev, "bind failed: %d!\n", error);
+			dev_dbg(dev, "%s: bind failed: %d!\n", __func__, error);
 			goto fail_free;
 	}
 
@@ -1128,7 +1135,7 @@
 		struct usbatm_receiver *rcv = &(instance->receivers[i]);
 
 		if (!(rcv->urb = usb_alloc_urb(0, GFP_KERNEL))) {
-			dev_dbg(&intf->dev, "no memory for receive urb %d!\n", i);
+			dev_dbg(dev, "%s: no memory for receive urb %d!\n", __func__, i);
 			goto fail_unbind;
 		}
 
@@ -1143,7 +1150,7 @@
 		buf->base = kmalloc(rcv_buf_size * (ATM_CELL_SIZE + instance->rx_padding),
 				    GFP_KERNEL);
 		if (!buf->base) {
-			dev_dbg(&intf->dev, "no memory for receive buffer %d!\n", i);
+			dev_dbg(dev, "%s: no memory for receive buffer %d!\n", __func__, i);
 			goto fail_unbind;
 		}
 
@@ -1155,7 +1162,7 @@
 		struct usbatm_sender *snd = &(instance->senders[i]);
 
 		if (!(snd->urb = usb_alloc_urb(0, GFP_KERNEL))) {
-			dev_dbg(&intf->dev, "usbatm_usb_probe: no memory for send urb %d!\n", i);
+			dev_dbg(dev, "%s: no memory for send urb %d!\n", __func__, i);
 			goto fail_unbind;
 		}
 
@@ -1170,7 +1177,7 @@
 		buf->base = kmalloc(snd_buf_size * (ATM_CELL_SIZE + instance->tx_padding),
 				    GFP_KERNEL);
 		if (!buf->base) {
-			dev_dbg(&intf->dev, "no memory for send buffer %d!\n", i);
+			dev_dbg(dev, "%s: no memory for send buffer %d!\n", __func__, i);
 			goto fail_unbind;
 		}
 
@@ -1187,7 +1194,7 @@
 	if (error < 0)
 		goto fail_unbind;
 
-	usb_get_dev(dev);
+	usb_get_dev(usb_dev);
 	usb_set_intfdata(intf, instance);
 
 	return 0;
@@ -1216,13 +1223,14 @@
 
 void usbatm_usb_disconnect(struct usb_interface *intf)
 {
+	struct device *dev = &intf->dev;
 	struct usbatm_data *instance = usb_get_intfdata(intf);
 	int i;
 
-	dev_dbg(&intf->dev, "disconnect entered\n");
+	dev_dbg(dev, "%s entered\n", __func__);
 
 	if (!instance) {
-		dev_dbg(&intf->dev, "NULL instance!\n");
+		dev_dbg(dev, "%s: NULL instance!\n", __func__);
 		return;
 	}
 
@@ -1294,10 +1302,10 @@
 
 static int __init usbatm_usb_init(void)
 {
-	dbg("usbatm_usb_init: driver version " DRIVER_VERSION);
+	dbg("%s: driver version %s", __func__, DRIVER_VERSION);
 
 	if (sizeof(struct usbatm_control) > sizeof(((struct sk_buff *) 0)->cb)) {
-		printk(KERN_ERR __FILE__ ": unusable with this kernel!\n");
+		printk(KERN_ERR "%s unusable with this kernel!\n", usbatm_driver_name);
 		return -EIO;
 	}
 
@@ -1315,7 +1323,7 @@
 
 static void __exit usbatm_usb_exit(void)
 {
-	dbg("usbatm_usb_exit");
+	dbg("%s", __func__);
 }
 module_exit(usbatm_usb_exit);
 




More information about the Usbatm-commits mailing list