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

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

USB: remove warn() macro from usb net drivers



USB should not be having it's own printk macros, so remove warn() and
use the system-wide standard of dev_warn() wherever possible.  In the
few places that will not work out, use a basic printk().

Cc: Jeff Garzik <jgarzik@pobox.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent aa82661b
Loading
Loading
Loading
Loading
+5 −5
Original line number Original line Diff line number Diff line
@@ -506,7 +506,7 @@ static int change_speed(struct stir_cb *stir, unsigned speed)
			goto found;
			goto found;
	}
	}


	warn("%s: invalid speed %d", stir->netdev->name, speed);
	dev_warn(&stir->netdev->dev, "invalid speed %d\n", speed);
	return -EINVAL;
	return -EINVAL;


 found:
 found:
@@ -598,8 +598,8 @@ static int fifo_txwait(struct stir_cb *stir, int space)
		err = read_reg(stir, REG_FIFOCTL, stir->fifo_status, 
		err = read_reg(stir, REG_FIFOCTL, stir->fifo_status, 
				   FIFO_REGS_SIZE);
				   FIFO_REGS_SIZE);
		if (unlikely(err != FIFO_REGS_SIZE)) {
		if (unlikely(err != FIFO_REGS_SIZE)) {
			warn("%s: FIFO register read error: %d", 
			dev_warn(&stir->netdev->dev,
			     stir->netdev->name, err);
				 "FIFO register read error: %d\n", err);


			return err;
			return err;
		}
		}
@@ -836,8 +836,8 @@ static void stir_rcv_irq(struct urb *urb)


	/* in case of error, the kernel thread will restart us */
	/* in case of error, the kernel thread will restart us */
	if (err) {
	if (err) {
		warn("%s: usb receive submit error: %d",
		dev_warn(&stir->netdev->dev, "usb receive submit error: %d\n",
			stir->netdev->name, err);
			 err);
		stir->receiving = 0;
		stir->receiving = 0;
		wake_up_process(stir->thread);
		wake_up_process(stir->thread);
	}
	}
+3 −2
Original line number Original line Diff line number Diff line
@@ -456,7 +456,7 @@ static void catc_tx_timeout(struct net_device *netdev)
{
{
	struct catc *catc = netdev_priv(netdev);
	struct catc *catc = netdev_priv(netdev);


	warn("Transmit timed out.");
	dev_warn(&netdev->dev, "Transmit timed out.\n");
	usb_unlink_urb(catc->tx_urb);
	usb_unlink_urb(catc->tx_urb);
}
}


@@ -847,7 +847,8 @@ static int catc_probe(struct usb_interface *intf, const struct usb_device_id *id
			dbg("64k Memory\n");
			dbg("64k Memory\n");
			break;
			break;
		default:
		default:
			warn("Couldn't detect memory size, assuming 32k");
			dev_warn(&intf->dev,
				 "Couldn't detect memory size, assuming 32k\n");
		case 0x87654321:
		case 0x87654321:
			catc_set_reg(catc, TxBufCount, 4);
			catc_set_reg(catc, TxBufCount, 4);
			catc_set_reg(catc, RxBufCount, 16);
			catc_set_reg(catc, RxBufCount, 16);
+4 −4
Original line number Original line Diff line number Diff line
@@ -832,7 +832,7 @@ static int kaweth_start_xmit(struct sk_buff *skb, struct net_device *net)


	if((res = usb_submit_urb(kaweth->tx_urb, GFP_ATOMIC)))
	if((res = usb_submit_urb(kaweth->tx_urb, GFP_ATOMIC)))
	{
	{
		warn("kaweth failed tx_urb %d", res);
		dev_warn(&net->dev, "kaweth failed tx_urb %d\n", res);
skip:
skip:
		kaweth->stats.tx_errors++;
		kaweth->stats.tx_errors++;


@@ -924,7 +924,7 @@ static void kaweth_tx_timeout(struct net_device *net)
{
{
	struct kaweth_device *kaweth = netdev_priv(net);
	struct kaweth_device *kaweth = netdev_priv(net);


	warn("%s: Tx timed out. Resetting.", net->name);
	dev_warn(&net->dev, "%s: Tx timed out. Resetting.\n", net->name);
	kaweth->stats.tx_errors++;
	kaweth->stats.tx_errors++;
	net->trans_start = jiffies;
	net->trans_start = jiffies;


@@ -1209,7 +1209,7 @@ static void kaweth_disconnect(struct usb_interface *intf)


	usb_set_intfdata(intf, NULL);
	usb_set_intfdata(intf, NULL);
	if (!kaweth) {
	if (!kaweth) {
		warn("unregistering non-existant device");
		dev_warn(&intf->dev, "unregistering non-existant device\n");
		return;
		return;
	}
	}
	netdev = kaweth->net;
	netdev = kaweth->net;
@@ -1269,7 +1269,7 @@ static int usb_start_wait_urb(struct urb *urb, int timeout, int* actual_length)


	if (!wait_event_timeout(awd.wqh, awd.done, timeout)) {
	if (!wait_event_timeout(awd.wqh, awd.done, timeout)) {
                // timeout
                // timeout
                warn("usb_control/bulk_msg: timeout");
                dev_warn(&urb->dev->dev, "usb_control/bulk_msg: timeout\n");
                usb_kill_urb(urb);  // remove urb safely
                usb_kill_urb(urb);  // remove urb safely
                status = -ETIMEDOUT;
                status = -ETIMEDOUT;
        }
        }
+8 −8
Original line number Original line Diff line number Diff line
@@ -221,7 +221,7 @@ static void ctrl_callback(struct urb *urb)
	case -ENOENT:
	case -ENOENT:
		break;
		break;
	default:
	default:
		warn("ctrl urb status %d", urb->status);
		dev_warn(&urb->dev->dev, "ctrl urb status %d\n", urb->status);
	}
	}
	dev = urb->context;
	dev = urb->context;
	clear_bit(RX_REG_SET, &dev->flags);
	clear_bit(RX_REG_SET, &dev->flags);
@@ -441,10 +441,10 @@ static void read_bulk_callback(struct urb *urb)
	case -ENOENT:
	case -ENOENT:
		return;	/* the urb is in unlink state */
		return;	/* the urb is in unlink state */
	case -ETIME:
	case -ETIME:
		warn("may be reset is needed?..");
		dev_warn(&urb->dev->dev, "may be reset is needed?..\n");
		goto goon;
		goto goon;
	default:
	default:
		warn("Rx status %d", urb->status);
		dev_warn(&urb->dev->dev, "Rx status %d\n", urb->status);
		goto goon;
		goto goon;
	}
	}


@@ -665,7 +665,7 @@ static int enable_net_traffic(rtl8150_t * dev)
	u8 cr, tcr, rcr, msr;
	u8 cr, tcr, rcr, msr;


	if (!rtl8150_reset(dev)) {
	if (!rtl8150_reset(dev)) {
		warn("%s - device reset failed", __FUNCTION__);
		dev_warn(&dev->udev->dev, "device reset failed\n");
	}
	}
	/* RCR bit7=1 attach Rx info at the end;  =0 HW CRC (which is broken) */
	/* RCR bit7=1 attach Rx info at the end;  =0 HW CRC (which is broken) */
	rcr = 0x9e;
	rcr = 0x9e;
@@ -699,7 +699,7 @@ static struct net_device_stats *rtl8150_netdev_stats(struct net_device *dev)
static void rtl8150_tx_timeout(struct net_device *netdev)
static void rtl8150_tx_timeout(struct net_device *netdev)
{
{
	rtl8150_t *dev = netdev_priv(netdev);
	rtl8150_t *dev = netdev_priv(netdev);
	warn("%s: Tx timeout.", netdev->name);
	dev_warn(&netdev->dev, "Tx timeout.\n");
	usb_unlink_urb(dev->tx_urb);
	usb_unlink_urb(dev->tx_urb);
	dev->stats.tx_errors++;
	dev->stats.tx_errors++;
}
}
@@ -740,7 +740,7 @@ static int rtl8150_start_xmit(struct sk_buff *skb, struct net_device *netdev)
		if (res == -ENODEV)
		if (res == -ENODEV)
			netif_device_detach(dev->netdev);
			netif_device_detach(dev->netdev);
		else {
		else {
			warn("failed tx_urb %d\n", res);
			dev_warn(&netdev->dev, "failed tx_urb %d\n", res);
			dev->stats.tx_errors++;
			dev->stats.tx_errors++;
			netif_start_queue(netdev);
			netif_start_queue(netdev);
		}
		}
@@ -783,7 +783,7 @@ static int rtl8150_open(struct net_device *netdev)
	if ((res = usb_submit_urb(dev->rx_urb, GFP_KERNEL))) {
	if ((res = usb_submit_urb(dev->rx_urb, GFP_KERNEL))) {
		if (res == -ENODEV)
		if (res == -ENODEV)
			netif_device_detach(dev->netdev);
			netif_device_detach(dev->netdev);
		warn("%s: rx_urb submit failed: %d", __FUNCTION__, res);
		dev_warn(&netdev->dev, "rx_urb submit failed: %d\n", res);
		return res;
		return res;
	}
	}
	usb_fill_int_urb(dev->intr_urb, dev->udev, usb_rcvintpipe(dev->udev, 3),
	usb_fill_int_urb(dev->intr_urb, dev->udev, usb_rcvintpipe(dev->udev, 3),
@@ -792,7 +792,7 @@ static int rtl8150_open(struct net_device *netdev)
	if ((res = usb_submit_urb(dev->intr_urb, GFP_KERNEL))) {
	if ((res = usb_submit_urb(dev->intr_urb, GFP_KERNEL))) {
		if (res == -ENODEV)
		if (res == -ENODEV)
			netif_device_detach(dev->netdev);
			netif_device_detach(dev->netdev);
		warn("%s: intr_urb submit failed: %d", __FUNCTION__, res);
		dev_warn(&netdev->dev, "intr_urb submit failed: %d\n", res);
		usb_kill_urb(dev->rx_urb);
		usb_kill_urb(dev->rx_urb);
		return res;
		return res;
	}
	}