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

Commit 6c91023d authored by Joe Perches's avatar Joe Perches Committed by David S. Miller
Browse files

irda: Remove IRDA_<TYPE> logging macros



And use the more common mechanisms directly.

Other miscellanea:

o Coalesce formats
o Add missing newlines
o Realign arguments
o Remove unnecessary OOM message logging as
  there's a generic stack dump already on OOM.

Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 09626e9d
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -240,7 +240,8 @@ static int act200l_reset(struct sir_dev *dev)
		dev->speed = 9600;
		break;
	default:
		IRDA_ERROR("%s(), unknown state %d\n", __func__, state);
		net_err_ratelimited("%s(), unknown state %d\n",
				    __func__, state);
		ret = -1;
		break;
	}
+28 −29
Original line number Diff line number Diff line
@@ -158,7 +158,7 @@ static int __init ali_ircc_init(void)

	ret = platform_driver_register(&ali_ircc_driver);
        if (ret) {
                IRDA_ERROR("%s, Can't register driver!\n",
		net_err_ratelimited("%s, Can't register driver!\n",
				    ALI_IRCC_DRIVER_NAME);
                return ret;
        }
@@ -292,7 +292,7 @@ static int ali_ircc_open(int i, chipio_t *info)
	IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __func__);

	if (i >= ARRAY_SIZE(dev_self)) {
		IRDA_ERROR("%s(), maximum number of supported chips reached!\n",
		net_err_ratelimited("%s(), maximum number of supported chips reached!\n",
				    __func__);
		return -ENOMEM;
	}
@@ -303,7 +303,7 @@ static int ali_ircc_open(int i, chipio_t *info)
		
	dev = alloc_irdadev(sizeof(*self));
	if (dev == NULL) {
		IRDA_ERROR("%s(), can't allocate memory for control block!\n",
		net_err_ratelimited("%s(), can't allocate memory for control block!\n",
				    __func__);
		return -ENOMEM;
	}
@@ -328,8 +328,8 @@ static int ali_ircc_open(int i, chipio_t *info)
	/* Reserve the ioports that we need */
	if (!request_region(self->io.fir_base, self->io.fir_ext,
			    ALI_IRCC_DRIVER_NAME)) {
		IRDA_WARNING("%s(), can't get iobase of 0x%03x\n", __func__,
			self->io.fir_base);
		net_warn_ratelimited("%s(), can't get iobase of 0x%03x\n",
				     __func__, self->io.fir_base);
		err = -ENODEV;
		goto err_out1;
	}
@@ -380,15 +380,17 @@ static int ali_ircc_open(int i, chipio_t *info)

	err = register_netdev(dev);
	if (err) {
		IRDA_ERROR("%s(), register_netdev() failed!\n", __func__);
		net_err_ratelimited("%s(), register_netdev() failed!\n",
				    __func__);
		goto err_out4;
	}
	IRDA_MESSAGE("IrDA: Registered device %s\n", dev->name);
	net_info_ratelimited("IrDA: Registered device %s\n", dev->name);

	/* Check dongle id */
	dongle_id = ali_ircc_read_dongle_id(i, info);
	IRDA_MESSAGE("%s(), %s, Found dongle: %s\n", __func__,
		     ALI_IRCC_DRIVER_NAME, dongle_types[dongle_id]);
	net_info_ratelimited("%s(), %s, Found dongle: %s\n",
			     __func__, ALI_IRCC_DRIVER_NAME,
			     dongle_types[dongle_id]);
		
	self->io.dongle_id = dongle_id;

@@ -521,7 +523,8 @@ static int ali_ircc_probe_53(ali_chip_t *chip, chipio_t *info)
	info->dma = reg & 0x07;
	
	if(info->dma == 0x04)
		IRDA_WARNING("%s(), No DMA channel assigned !\n", __func__);
		net_warn_ratelimited("%s(), No DMA channel assigned !\n",
				     __func__);
	else
		IRDA_DEBUG(2, "%s(), probing dma=%d\n", __func__, info->dma);
	
@@ -578,7 +581,7 @@ static int ali_ircc_setup(chipio_t *info)
	/* Should be 0x00 in the M1535/M1535D */
	if(version != 0x00)
	{
		IRDA_ERROR("%s, Wrong chip version %02x\n",
		net_err_ratelimited("%s, Wrong chip version %02x\n",
				    ALI_IRCC_DRIVER_NAME, version);
		return -1;
	}
@@ -612,7 +615,7 @@ static int ali_ircc_setup(chipio_t *info)
	/* Switch to SIR space */
	FIR2SIR(iobase);
	
	IRDA_MESSAGE("%s, driver loaded (Benjamin Kong)\n",
	net_info_ratelimited("%s, driver loaded (Benjamin Kong)\n",
			     ALI_IRCC_DRIVER_NAME);
	
	/* Enable receive interrupts */ 
@@ -1352,9 +1355,8 @@ static int ali_ircc_net_open(struct net_device *dev)
	/* Request IRQ and install Interrupt Handler */
	if (request_irq(self->io.irq, ali_ircc_interrupt, 0, dev->name, dev)) 
	{
		IRDA_WARNING("%s, unable to allocate irq=%d\n",
			     ALI_IRCC_DRIVER_NAME,
			     self->io.irq);
		net_warn_ratelimited("%s, unable to allocate irq=%d\n",
				     ALI_IRCC_DRIVER_NAME, self->io.irq);
		return -EAGAIN;
	}
	
@@ -1363,9 +1365,8 @@ static int ali_ircc_net_open(struct net_device *dev)
	 * failure.
	 */
	if (request_dma(self->io.dma, dev->name)) {
		IRDA_WARNING("%s, unable to allocate dma=%d\n",
			     ALI_IRCC_DRIVER_NAME,
			     self->io.dma);
		net_warn_ratelimited("%s, unable to allocate dma=%d\n",
				     ALI_IRCC_DRIVER_NAME, self->io.dma);
		free_irq(self->io.irq, dev);
		return -EAGAIN;
	}
@@ -1671,7 +1672,8 @@ static int ali_ircc_dma_xmit_complete(struct ali_ircc_cb *self)
	if((inb(iobase+FIR_LSR) & LSR_FRAME_ABORT) == LSR_FRAME_ABORT)
	
	{
		IRDA_ERROR("%s(), ********* LSR_FRAME_ABORT *********\n", __func__);
		net_err_ratelimited("%s(), ********* LSR_FRAME_ABORT *********\n",
				    __func__);
		self->netdev->stats.tx_errors++;
		self->netdev->stats.tx_fifo_errors++;
	}
@@ -1918,9 +1920,6 @@ static int ali_ircc_dma_receive_complete(struct ali_ircc_cb *self)
			skb = dev_alloc_skb(len+1);
			if (skb == NULL)  
			{
				IRDA_WARNING("%s(), memory squeeze, "
					     "dropping frame.\n",
					     __func__);
				self->netdev->stats.rx_dropped++;

				return FALSE;
@@ -2127,7 +2126,7 @@ static int ali_ircc_suspend(struct platform_device *dev, pm_message_t state)
{
	struct ali_ircc_cb *self = platform_get_drvdata(dev);
	
	IRDA_MESSAGE("%s, Suspending\n", ALI_IRCC_DRIVER_NAME);
	net_info_ratelimited("%s, Suspending\n", ALI_IRCC_DRIVER_NAME);

	if (self->io.suspended)
		return 0;
@@ -2148,7 +2147,7 @@ static int ali_ircc_resume(struct platform_device *dev)
	
	ali_ircc_net_open(self->netdev);
	
	IRDA_MESSAGE("%s, Waking up\n", ALI_IRCC_DRIVER_NAME);
	net_info_ratelimited("%s, Waking up\n", ALI_IRCC_DRIVER_NAME);

	self->io.suspended = 0;

+4 −2
Original line number Diff line number Diff line
@@ -179,7 +179,8 @@ static int girbil_change_speed(struct sir_dev *dev, unsigned speed)
		break;

	default:
		IRDA_ERROR("%s - undefined state %d\n", __func__, state);
		net_err_ratelimited("%s - undefined state %d\n",
				    __func__, state);
		ret = -EINVAL;
		break;
	}
@@ -241,7 +242,8 @@ static int girbil_reset(struct sir_dev *dev)
		break;

	default:
		IRDA_ERROR("%s(), undefined state %d\n", __func__, state);
		net_err_ratelimited("%s(), undefined state %d\n",
				    __func__, state);
		ret = -1;
		break;
	}
+23 −24
Original line number Diff line number Diff line
@@ -307,7 +307,7 @@ static void irda_usb_change_speed_xbofs(struct irda_usb_cb *self)
	/* Grab the speed URB */
	urb = self->speed_urb;
	if (urb->status != 0) {
		IRDA_WARNING("%s(), URB still in use!\n", __func__);
		net_warn_ratelimited("%s(), URB still in use!\n", __func__);
		return;
	}

@@ -333,7 +333,7 @@ static void irda_usb_change_speed_xbofs(struct irda_usb_cb *self)

	/* Irq disabled -> GFP_ATOMIC */
	if ((ret = usb_submit_urb(urb, GFP_ATOMIC))) {
		IRDA_WARNING("%s(), failed Speed URB\n", __func__);
		net_warn_ratelimited("%s(), failed Speed URB\n", __func__);
	}
}

@@ -435,7 +435,7 @@ static netdev_tx_t irda_usb_hard_xmit(struct sk_buff *skb,
	}

	if (urb->status != 0) {
		IRDA_WARNING("%s(), URB still in use!\n", __func__);
		net_warn_ratelimited("%s(), URB still in use!\n", __func__);
		goto drop;
	}

@@ -522,7 +522,7 @@ static netdev_tx_t irda_usb_hard_xmit(struct sk_buff *skb,
	
	/* Ask USB to send the packet - Irq disabled -> GFP_ATOMIC */
	if ((res = usb_submit_urb(urb, GFP_ATOMIC))) {
		IRDA_WARNING("%s(), failed Tx URB\n", __func__);
		net_warn_ratelimited("%s(), failed Tx URB\n", __func__);
		netdev->stats.tx_errors++;
		/* Let USB recover : We will catch that in the watchdog */
		/*netif_start_queue(netdev);*/
@@ -638,7 +638,7 @@ static void irda_usb_net_timeout(struct net_device *netdev)

	/* self->present *MUST* be read under spinlock */
	if (!self->present) {
		IRDA_WARNING("%s(), device not present!\n", __func__);
		net_warn_ratelimited("%s(), device not present!\n", __func__);
		netif_stop_queue(netdev);
		spin_unlock_irqrestore(&self->lock, flags);
		return;
@@ -783,7 +783,7 @@ static void irda_usb_submit(struct irda_usb_cb *self, struct sk_buff *skb, struc
	if (ret) {
		/* If this ever happen, we are in deep s***.
		 * Basically, the Rx path will stop... */
		IRDA_WARNING("%s(), Failed to submit Rx URB %d\n",
		net_warn_ratelimited("%s(), Failed to submit Rx URB %d\n",
				     __func__, ret);
	}
}
@@ -859,7 +859,7 @@ static void irda_usb_receive(struct urb *urb)
	
	/* Check for empty frames */
	if (urb->actual_length <= self->header_length) {
		IRDA_WARNING("%s(), empty frame!\n", __func__);
		net_warn_ratelimited("%s(), empty frame!\n", __func__);
		goto done;
	}

@@ -1088,7 +1088,7 @@ static int stir421x_patch_device(struct irda_usb_cb *self)
                return ret;

        /* We get a patch from userspace */
        IRDA_MESSAGE("%s(): Received firmware %s (%zu bytes)\n",
	net_info_ratelimited("%s(): Received firmware %s (%zu bytes)\n",
			     __func__, stir421x_fw_name, fw->size);

        ret = -EINVAL;
@@ -1179,13 +1179,13 @@ static int irda_usb_net_open(struct net_device *netdev)
	/* Can only open the device if it's there */
	if(!self->present) {
		spin_unlock_irqrestore(&self->lock, flags);
		IRDA_WARNING("%s(), device not present!\n", __func__);
		net_warn_ratelimited("%s(), device not present!\n", __func__);
		return -1;
	}

	if(self->needspatch) {
		spin_unlock_irqrestore(&self->lock, flags);
		IRDA_WARNING("%s(), device needs patch\n", __func__) ;
		net_warn_ratelimited("%s(), device needs patch\n", __func__);
		return -EIO ;
	}

@@ -1227,8 +1227,6 @@ static int irda_usb_net_open(struct net_device *netdev)
		if (!skb) {
			/* If this ever happen, we are in deep s***.
			 * Basically, we can't start the Rx path... */
			IRDA_WARNING("%s(), Failed to allocate Rx skb\n",
				     __func__);
			return -1;
		}
		//skb_reserve(newskb, USB_IRDA_HEADER - 1);
@@ -1505,7 +1503,8 @@ static inline int irda_usb_parse_endpoints(struct irda_usb_cb *self, struct usb_
				/* This is our interrupt endpoint */
				self->bulk_int_ep = ep;
			} else {
				IRDA_ERROR("%s(), Unrecognised endpoint %02X.\n", __func__, ep);
				net_err_ratelimited("%s(), Unrecognised endpoint %02X\n",
						    __func__, ep);
			}
		}
	}
@@ -1575,11 +1574,11 @@ static inline struct irda_class_desc *irda_usb_find_class_desc(struct usb_interf
	
	IRDA_DEBUG(1, "%s(), ret=%d\n", __func__, ret);
	if (ret < sizeof(*desc)) {
		IRDA_WARNING("usb-irda: class_descriptor read %s (%d)\n",
			     (ret<0) ? "failed" : "too short", ret);
		net_warn_ratelimited("usb-irda: class_descriptor read %s (%d)\n",
				     ret < 0 ? "failed" : "too short", ret);
	}
	else if (desc->bDescriptorType != USB_DT_IRDA) {
		IRDA_WARNING("usb-irda: bad class_descriptor type\n");
		net_warn_ratelimited("usb-irda: bad class_descriptor type\n");
	}
	else {
#ifdef IU_DUMP_CLASS_DESC
@@ -1622,7 +1621,7 @@ static int irda_usb_probe(struct usb_interface *intf,
	 * don't need to check if the dongle is really ours.
	 * Jean II */

	IRDA_MESSAGE("IRDA-USB found at address %d, Vendor: %x, Product: %x\n",
	net_info_ratelimited("IRDA-USB found at address %d, Vendor: %x, Product: %x\n",
			     dev->devnum, le16_to_cpu(dev->descriptor.idVendor),
			     le16_to_cpu(dev->descriptor.idProduct));

@@ -1700,7 +1699,7 @@ static int irda_usb_probe(struct usb_interface *intf,
	interface = intf->cur_altsetting;
	if(!irda_usb_parse_endpoints(self, interface->endpoint,
				     interface->desc.bNumEndpoints)) {
		IRDA_ERROR("%s(), Bogus endpoints...\n", __func__);
		net_err_ratelimited("%s(), Bogus endpoints...\n", __func__);
		ret = -EIO;
		goto err_out_3;
	}
@@ -1746,7 +1745,7 @@ static int irda_usb_probe(struct usb_interface *intf,
	if (ret) 
		goto err_out_5;

	IRDA_MESSAGE("IrDA: Registered device %s\n", net->name);
	net_info_ratelimited("IrDA: Registered device %s\n", net->name);
	usb_set_intfdata(intf, self);

	if (self->needspatch) {
@@ -1754,7 +1753,7 @@ static int irda_usb_probe(struct usb_interface *intf,
		ret = stir421x_patch_device(self);
		self->needspatch = (ret < 0);
		if (self->needspatch) {
			IRDA_ERROR("STIR421X: Couldn't upload patch\n");
			net_err_ratelimited("STIR421X: Couldn't upload patch\n");
			goto err_out_6;
		}

+5 −5
Original line number Diff line number Diff line
@@ -231,7 +231,7 @@ static void irtty_receive_buf(struct tty_struct *tty, const unsigned char *cp,

	dev = priv->dev;
	if (!dev) {
		IRDA_WARNING("%s(), not ready yet!\n", __func__);
		net_warn_ratelimited("%s(), not ready yet!\n", __func__);
		return;
	}

@@ -555,7 +555,7 @@ static int __init irtty_sir_init(void)
	int err;

	if ((err = tty_register_ldisc(N_IRDA, &irda_ldisc)) != 0)
		IRDA_ERROR("IrDA: can't register line discipline (err = %d)\n",
		net_err_ratelimited("IrDA: can't register line discipline (err = %d)\n",
				    err);
	return err;
}
@@ -565,7 +565,7 @@ static void __exit irtty_sir_cleanup(void)
	int err;

	if ((err = tty_unregister_ldisc(N_IRDA))) {
		IRDA_ERROR("%s(), can't unregister line discipline (err = %d)\n",
		net_err_ratelimited("%s(), can't unregister line discipline (err = %d)\n",
				    __func__, err);
	}
}
Loading