]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/irda/mcs7780.c
Merge branch 'v2.6.24-rc1-lockdep' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-omap-h63xx.git] / drivers / net / irda / mcs7780.c
index f0c61f3b2a82e992fee61cdf664dd2d42e62cfdc..0b769192d4ce0753c872410c601a1e2eb4849a8e 100644 (file)
@@ -50,7 +50,6 @@
 #include <linux/errno.h>
 #include <linux/init.h>
 #include <linux/slab.h>
-#include <linux/module.h>
 #include <linux/kref.h>
 #include <linux/usb.h>
 #include <linux/device.h>
@@ -200,14 +199,14 @@ static inline int mcs_setup_transceiver_vishay(struct mcs_cb *mcs)
 /* Setup a communication between mcs7780 and agilent chip. */
 static inline int mcs_setup_transceiver_agilent(struct mcs_cb *mcs)
 {
-       IRDA_WARNING("This transceiver type is not supported yet.");
+       IRDA_WARNING("This transceiver type is not supported yet.\n");
        return 1;
 }
 
 /* Setup a communication between mcs7780 and sharp chip. */
 static inline int mcs_setup_transceiver_sharp(struct mcs_cb *mcs)
 {
-       IRDA_WARNING("This transceiver type is not supported yet.");
+       IRDA_WARNING("This transceiver type is not supported yet.\n");
        return 1;
 }
 
@@ -279,7 +278,7 @@ static inline int mcs_setup_transceiver(struct mcs_cb *mcs)
                break;
 
        default:
-               IRDA_WARNING("Unknown transceiver type: %d",
+               IRDA_WARNING("Unknown transceiver type: %d\n",
                             mcs->transceiver_type);
                ret = 1;
        }
@@ -318,7 +317,7 @@ static inline int mcs_setup_transceiver(struct mcs_cb *mcs)
                return ret;
 
 error:
-       IRDA_ERROR("%s", msg);
+       IRDA_ERROR("%s\n", msg);
        return ret;
 }
 
@@ -353,7 +352,7 @@ static unsigned mcs_wrap_fir_skb(const struct sk_buff *skb, __u8 *buf)
        buf[0] = len & 0xff;
        buf[1] = (len >> 8) & 0xff;
        /* copy the data into the tx buffer. */
-       memcpy(buf+2, skb->data, skb->len);
+       skb_copy_from_linear_data(skb, buf + 2, skb->len);
        /* put the fcs in the last four bytes in little endian order. */
        buf[len - 4] = fcs & 0xff;
        buf[len - 3] = (fcs >> 8) & 0xff;
@@ -377,7 +376,7 @@ static unsigned mcs_wrap_mir_skb(const struct sk_buff *skb, __u8 *buf)
        buf[0] = len & 0xff;
        buf[1] = (len >> 8) & 0xff;
        /* copy the data */
-       memcpy(buf+2, skb->data, skb->len);
+       skb_copy_from_linear_data(skb, buf + 2, skb->len);
        /* put the fcs in last two bytes in little endian order. */
        buf[len - 2] = fcs & 0xff;
        buf[len - 1] = (fcs >> 8) & 0xff;
@@ -426,9 +425,9 @@ static void mcs_unwrap_mir(struct mcs_cb *mcs, __u8 *buf, int len)
        }
 
        skb_reserve(skb, 1);
-       memcpy(skb->data, buf, new_len);
+       skb_copy_to_linear_data(skb, buf, new_len);
        skb_put(skb, new_len);
-       skb->mac.raw = skb->data;
+       skb_reset_mac_header(skb);
        skb->protocol = htons(ETH_P_IRDA);
        skb->dev = mcs->netdev;
 
@@ -465,7 +464,7 @@ static void mcs_unwrap_fir(struct mcs_cb *mcs, __u8 *buf, int len)
        }
 
        fcs = ~(crc32_le(~0, buf, new_len));
-       if(fcs != le32_to_cpu(get_unaligned((u32 *)(buf+new_len)))) {
+       if(fcs != le32_to_cpu(get_unaligned((__le32 *)(buf+new_len)))) {
                IRDA_ERROR("crc error calc 0x%x len %d\n", fcs, new_len);
                mcs->stats.rx_errors++;
                mcs->stats.rx_crc_errors++;
@@ -479,9 +478,9 @@ static void mcs_unwrap_fir(struct mcs_cb *mcs, __u8 *buf, int len)
        }
 
        skb_reserve(skb, 1);
-       memcpy(skb->data, buf, new_len);
+       skb_copy_to_linear_data(skb, buf, new_len);
        skb_put(skb, new_len);
-       skb->mac.raw = skb->data;
+       skb_reset_mac_header(skb);
        skb->protocol = htons(ETH_P_IRDA);
        skb->dev = mcs->netdev;
 
@@ -587,7 +586,7 @@ static int mcs_speed_change(struct mcs_cb *mcs)
        } while(cnt++ < 100 && (rval & MCS_IRINTX));
 
        if(cnt >= 100) {
-               IRDA_ERROR("unable to change speed");
+               IRDA_ERROR("unable to change speed\n");
                ret = -EIO;
                goto error;
        }
@@ -638,7 +637,7 @@ static int mcs_speed_change(struct mcs_cb *mcs)
 
                default:
                        ret = 1;
-                       IRDA_WARNING("Unknown transceiver type: %d",
+                       IRDA_WARNING("Unknown transceiver type: %d\n",
                                     mcs->transceiver_type);
                }
        if (unlikely(ret))
@@ -733,7 +732,7 @@ static int mcs_net_open(struct net_device *netdev)
        sprintf(hwname, "usb#%d", mcs->usbdev->devnum);
        mcs->irlap = irlap_open(netdev, &mcs->qos, hwname);
        if (!mcs->irlap) {
-               IRDA_ERROR("mcs7780: irlap_open failed");
+               IRDA_ERROR("mcs7780: irlap_open failed\n");
                goto error2;
        }
 
@@ -862,7 +861,7 @@ static int mcs_hard_xmit(struct sk_buff *skb, struct net_device *ndev)
                          mcs->out_buf, wraplen, mcs_send_irq, mcs);
 
        if ((ret = usb_submit_urb(mcs->tx_urb, GFP_ATOMIC))) {
-               IRDA_ERROR("failed tx_urb: %d", ret);
+               IRDA_ERROR("failed tx_urb: %d\n", ret);
                switch (ret) {
                case -ENODEV:
                case -EPIPE:
@@ -897,15 +896,13 @@ static int mcs_probe(struct usb_interface *intf,
        if (!ndev)
                goto error1;
 
-       IRDA_DEBUG(1, "MCS7780 USB-IrDA bridge found at %d.", udev->devnum);
+       IRDA_DEBUG(1, "MCS7780 USB-IrDA bridge found at %d.\n", udev->devnum);
 
-       /* what is it realy for? */
-       SET_MODULE_OWNER(ndev);
        SET_NETDEV_DEV(ndev, &intf->dev);
 
        ret = usb_reset_configuration(udev);
        if (ret != 0) {
-               IRDA_ERROR("mcs7780: usb reset configuration failed");
+               IRDA_ERROR("mcs7780: usb reset configuration failed\n");
                goto error2;
        }
 
@@ -950,7 +947,7 @@ static int mcs_probe(struct usb_interface *intf,
        if (ret != 0)
                goto error2;
 
-       IRDA_DEBUG(1, "IrDA: Registered MosChip MCS7780 device as %s",
+       IRDA_DEBUG(1, "IrDA: Registered MosChip MCS7780 device as %s\n",
                   ndev->name);
 
        mcs->transceiver_type = transceiver_type;
@@ -981,7 +978,7 @@ static void mcs_disconnect(struct usb_interface *intf)
        free_netdev(mcs->netdev);
 
        usb_set_intfdata(intf, NULL);
-       IRDA_DEBUG(0, "MCS7780 now disconnected.");
+       IRDA_DEBUG(0, "MCS7780 now disconnected.\n");
 }
 
 /* Module insertion */
@@ -992,7 +989,7 @@ static int __init mcs_init(void)
        /* register this driver with the USB subsystem */
        result = usb_register(&mcs_driver);
        if (result)
-               IRDA_ERROR("usb_register failed. Error number %d", result);
+               IRDA_ERROR("usb_register failed. Error number %d\n", result);
 
        return result;
 }