Merge branch 'master' into for_paulus
[linux-drm-fsl-dcu.git] / drivers / net / ppp_generic.c
index c872f7c6cce39392e7490cb2437ea62bd8fcc53f..11b575f89856b55d0307c06513cc4695909cba2a 100644 (file)
@@ -83,7 +83,7 @@ struct ppp_file {
        int             dead;           /* unit/channel has been shut down */
 };
 
-#define PF_TO_X(pf, X)         ((X *)((char *)(pf) - offsetof(X, file)))
+#define PF_TO_X(pf, X)         container_of(pf, X, file)
 
 #define PF_TO_PPP(pf)          PF_TO_X(pf, struct ppp)
 #define PF_TO_CHANNEL(pf)      PF_TO_X(pf, struct channel)
@@ -304,7 +304,7 @@ static const int npindex_to_proto[NUM_NP] = {
        PPP_MPLS_UC,
        PPP_MPLS_MC,
 };
-       
+
 /* Translates an ethertype into an NP index */
 static inline int ethertype_to_npindex(int ethertype)
 {
@@ -834,7 +834,7 @@ static int ppp_unattached_ioctl(struct ppp_file *pf, struct file *file,
        return err;
 }
 
-static struct file_operations ppp_device_fops = {
+static const struct file_operations ppp_device_fops = {
        .owner          = THIS_MODULE,
        .read           = ppp_read,
        .write          = ppp_write,
@@ -860,7 +860,7 @@ static int __init ppp_init(void)
                        err = PTR_ERR(ppp_class);
                        goto out_chrdev;
                }
-               class_device_create(ppp_class, NULL, MKDEV(PPP_MAJOR, 0), NULL, "ppp");
+               device_create(ppp_class, NULL, MKDEV(PPP_MAJOR, 0), "ppp");
        }
 
 out:
@@ -1619,11 +1619,11 @@ ppp_receive_nonmp_frame(struct ppp *ppp, struct sk_buff *skb)
        case PPP_VJC_UNCOMP:
                if (ppp->vj == 0 || (ppp->flags & SC_REJ_COMP_TCP))
                        goto err;
-               
+
                /* Until we fix the decompressor need to make sure
                 * data portion is linear.
                 */
-               if (!pskb_may_pull(skb, skb->len)) 
+               if (!pskb_may_pull(skb, skb->len))
                        goto err;
 
                if (slhc_remember(ppp->vj, skb->data + 2, skb->len - 2) <= 0) {
@@ -2185,7 +2185,7 @@ ppp_ccp_peek(struct ppp *ppp, struct sk_buff *skb, int inbound)
        switch (CCP_CODE(dp)) {
        case CCP_CONFREQ:
 
-               /* A ConfReq starts negotiation of compression 
+               /* A ConfReq starts negotiation of compression
                 * in one direction of transmission,
                 * and hence brings it down...but which way?
                 *
@@ -2195,16 +2195,16 @@ ppp_ccp_peek(struct ppp *ppp, struct sk_buff *skb, int inbound)
                if(inbound)
                        /* He is proposing what I should send */
                        ppp->xstate &= ~SC_COMP_RUN;
-               else    
+               else
                        /* I am proposing to what he should send */
                        ppp->rstate &= ~SC_DECOMP_RUN;
-               
+
                break;
-               
+
        case CCP_TERMREQ:
        case CCP_TERMACK:
                /*
-                * CCP is going down, both directions of transmission 
+                * CCP is going down, both directions of transmission
                 */
                ppp->rstate &= ~SC_DECOMP_RUN;
                ppp->xstate &= ~SC_COMP_RUN;
@@ -2675,7 +2675,7 @@ static void __exit ppp_cleanup(void)
        cardmap_destroy(&all_ppp_units);
        if (unregister_chrdev(PPP_MAJOR, "ppp") != 0)
                printk(KERN_ERR "PPP: failed to unregister PPP device\n");
-       class_device_destroy(ppp_class, MKDEV(PPP_MAJOR, 0));
+       device_destroy(ppp_class, MKDEV(PPP_MAJOR, 0));
        class_destroy(ppp_class);
 }