Merge branch 'master' into for_paulus
[linux-drm-fsl-dcu.git] / drivers / isdn / hisax / hfc_usb.c
index b5e571a526943847f3bd1e0d0240d27c1041c989..42bbae2a646c49622af83b6e6cda2db04a188c03 100644 (file)
@@ -183,7 +183,7 @@ typedef struct hfcusb_data {
        int vend_idx;           /* vendor found */
        int b_mode[2];          /* B-channel mode */
        int l1_activated;       /* layer 1 activated */
-       int disc_flag;          /* TRUE if device was disonnected to avoid some USB actions */
+       int disc_flag;          /* 'true' if device was disonnected to avoid some USB actions */
        int packet_size, iso_packet_size;
 
        /* control pipe background handling */
@@ -276,7 +276,7 @@ control_action_handler(hfcusb_data * hfc, int reg, int val, int action)
 /* control completion routine handling background control cmds */
 /***************************************************************/
 static void
-ctrl_complete(struct urb *urb, struct pt_regs *regs)
+ctrl_complete(struct urb *urb)
 {
        hfcusb_data *hfc = (hfcusb_data *) urb->context;
        ctrl_buft *buf;
@@ -392,7 +392,7 @@ l1_timer_expire_t3(hfcusb_data * hfc)
        DBG(ISDN_DBG,
            "HFC-S USB: PH_DEACTIVATE | INDICATION sent (T3 expire)");
 #endif
-       hfc->l1_activated = FALSE;
+       hfc->l1_activated = false;
        handle_led(hfc, LED_S0_OFF);
        /* deactivate : */
        queue_control_request(hfc, HFCUSB_STATES, 0x10, 1);
@@ -411,7 +411,7 @@ l1_timer_expire_t4(hfcusb_data * hfc)
        DBG(ISDN_DBG,
            "HFC-S USB: PH_DEACTIVATE | INDICATION sent (T4 expire)");
 #endif
-       hfc->l1_activated = FALSE;
+       hfc->l1_activated = false;
        handle_led(hfc, LED_S0_OFF);
 }
 
@@ -452,7 +452,7 @@ state_handler(hfcusb_data * hfc, __u8 state)
 #ifdef CONFIG_HISAX_DEBUG
                DBG(ISDN_DBG, "HFC-S USB: PH_ACTIVATE | INDICATION sent");
 #endif
-               hfc->l1_activated = TRUE;
+               hfc->l1_activated = true;
                handle_led(hfc, LED_S0_ON);
        } else if (state <= 3 /* && activated */ ) {
                if (old_state == 7 || old_state == 8) {
@@ -472,7 +472,7 @@ state_handler(hfcusb_data * hfc, __u8 state)
                        DBG(ISDN_DBG,
                            "HFC-S USB: PH_DEACTIVATE | INDICATION sent");
 #endif
-                       hfc->l1_activated = FALSE;
+                       hfc->l1_activated = false;
                        handle_led(hfc, LED_S0_OFF);
                }
        }
@@ -603,7 +603,7 @@ static int iso_packets[8] =
 /* transmit completion routine for all ISO tx fifos */
 /*****************************************************/
 static void
-tx_iso_complete(struct urb *urb, struct pt_regs *regs)
+tx_iso_complete(struct urb *urb)
 {
        iso_urb_struct *context_iso_urb = (iso_urb_struct *) urb->context;
        usb_fifo *fifo = context_iso_urb->owner_fifo;
@@ -622,7 +622,7 @@ tx_iso_complete(struct urb *urb, struct pt_regs *regs)
        if (fifo->active && !status) {
                transp_mode = 0;
                if (fifon < 4 && hfc->b_mode[fifon / 2] == L1_MODE_TRANS)
-                       transp_mode = TRUE;
+                       transp_mode = true;
 
                /* is FifoFull-threshold set for our channel? */
                threshbit = threshtable[fifon] & hfc->threshold_mask;
@@ -640,7 +640,7 @@ tx_iso_complete(struct urb *urb, struct pt_regs *regs)
                              tx_iso_complete, urb->context);
                memset(context_iso_urb->buffer, 0,
                       sizeof(context_iso_urb->buffer));
-               frame_complete = FALSE;
+               frame_complete = false;
                /* Generate next Iso Packets */
                for (k = 0; k < num_isoc_packets; ++k) {
                        if (fifo->skbuff) {
@@ -666,7 +666,7 @@ tx_iso_complete(struct urb *urb, struct pt_regs *regs)
                                                /* add 2 byte flags and 16bit CRC at end of ISDN frame */
                                                fifo->bit_line += 32;
                                        }
-                                       frame_complete = TRUE;
+                                       frame_complete = true;
                                }
 
                                memcpy(context_iso_urb->buffer +
@@ -693,17 +693,17 @@ tx_iso_complete(struct urb *urb, struct pt_regs *regs)
                        }
 
                        if (frame_complete) {
-                               fifo->delete_flg = TRUE;
+                               fifo->delete_flg = true;
                                fifo->hif->l1l2(fifo->hif,
                                                PH_DATA | CONFIRM,
-                                               (void *) fifo->skbuff->
+                                               (void *) (unsigned long) fifo->skbuff->
                                                truesize);
                                if (fifo->skbuff && fifo->delete_flg) {
                                        dev_kfree_skb_any(fifo->skbuff);
                                        fifo->skbuff = NULL;
-                                       fifo->delete_flg = FALSE;
+                                       fifo->delete_flg = false;
                                }
-                               frame_complete = FALSE;
+                               frame_complete = false;
                        }
                }
                errcode = usb_submit_urb(urb, GFP_ATOMIC);
@@ -726,7 +726,7 @@ tx_iso_complete(struct urb *urb, struct pt_regs *regs)
 /* receive completion routine for all ISO tx fifos   */
 /*****************************************************/
 static void
-rx_iso_complete(struct urb *urb, struct pt_regs *regs)
+rx_iso_complete(struct urb *urb)
 {
        iso_urb_struct *context_iso_urb = (iso_urb_struct *) urb->context;
        usb_fifo *fifo = context_iso_urb->owner_fifo;
@@ -837,7 +837,7 @@ collect_rx_frame(usb_fifo * fifo, __u8 * data, int len, int finish)
        fifon = fifo->fifonum;
        transp_mode = 0;
        if (fifon < 4 && hfc->b_mode[fifon / 2] == L1_MODE_TRANS)
-               transp_mode = TRUE;
+               transp_mode = true;
 
        if (!fifo->skbuff) {
                fifo->skbuff = dev_alloc_skb(fifo->max_size + 3);
@@ -919,7 +919,7 @@ collect_rx_frame(usb_fifo * fifo, __u8 * data, int len, int finish)
 /* receive completion routine for all rx fifos */
 /***********************************************/
 static void
-rx_complete(struct urb *urb, struct pt_regs *regs)
+rx_complete(struct urb *urb)
 {
        int len;
        int status;
@@ -1144,7 +1144,7 @@ hfc_usb_l2l1(struct hisax_if *my_hisax_if, int pr, void *arg)
                                set_hfcmode(hfc,
                                            (fifo->fifonum ==
                                             HFCUSB_B1_TX) ? 0 : 1,
-                                           (int) arg);
+                                           (long) arg);
                                fifo->hif->l1l2(fifo->hif,
                                                PH_ACTIVATE | INDICATION,
                                                NULL);
@@ -1176,7 +1176,7 @@ hfc_usb_l2l1(struct hisax_if *my_hisax_if, int pr, void *arg)
                        if (fifo->skbuff && fifo->delete_flg) {
                                dev_kfree_skb_any(fifo->skbuff);
                                fifo->skbuff = NULL;
-                               fifo->delete_flg = FALSE;
+                               fifo->delete_flg = false;
                        }
                        fifo->skbuff = arg;     /* we have a new buffer */
                        break;
@@ -1262,8 +1262,8 @@ usb_init(hfcusb_data * hfc)
        hfc->b_mode[0] = L1_MODE_NULL;
        hfc->b_mode[1] = L1_MODE_NULL;
 
-       hfc->l1_activated = FALSE;
-       hfc->disc_flag = FALSE;
+       hfc->l1_activated = false;
+       hfc->disc_flag = false;
        hfc->led_state = 0;
        hfc->led_new_data = 0;
        hfc->old_led_state = 0;
@@ -1404,7 +1404,7 @@ hfc_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
 
                        /* check for config EOL element */
                        while (validconf[cfg_used][0]) {
-                               cfg_found = TRUE;
+                               cfg_found = true;
                                vcf = validconf[cfg_used];
                                /* first endpoint descriptor */
                                ep = iface->endpoint;
@@ -1426,7 +1426,7 @@ hfc_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
                                                idx++;
                                        attr = ep->desc.bmAttributes;
                                        if (cmptbl[idx] == EP_NUL) {
-                                               cfg_found = FALSE;
+                                               cfg_found = false;
                                        }
                                        if (attr == USB_ENDPOINT_XFER_INT
                                            && cmptbl[idx] == EP_INT)
@@ -1448,7 +1448,7 @@ hfc_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
                                                            "HFC-S USB: Interrupt Endpoint interval < %d found - skipping config",
                                                            vcf[17]);
 #endif
-                                               cfg_found = FALSE;
+                                               cfg_found = false;
                                        }
                                        ep++;
                                }
@@ -1456,7 +1456,7 @@ hfc_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
                                        /* all entries must be EP_NOP or EP_NUL for a valid config */
                                        if (cmptbl[i] != EP_NOP
                                            && cmptbl[i] != EP_NUL)
-                                               cfg_found = FALSE;
+                                               cfg_found = false;
                                }
                                if (cfg_found) {
                                        if (cfg_used < small_match) {
@@ -1481,9 +1481,8 @@ hfc_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
                        iface = iface_used;
                        if (!
                            (context =
-                            kmalloc(sizeof(hfcusb_data), GFP_KERNEL)))
+                            kzalloc(sizeof(hfcusb_data), GFP_KERNEL)))
                                return (-ENOMEM);       /* got no mem */
-                       memset(context, 0, sizeof(hfcusb_data));
 
                        ep = iface->endpoint;
                        vcf = validconf[small_match];
@@ -1657,7 +1656,7 @@ hfc_usb_disconnect(struct usb_interface
        hfcusb_data *context = usb_get_intfdata(intf);
        int i;
        printk(KERN_INFO "HFC-S USB: device disconnect\n");
-       context->disc_flag = TRUE;
+       context->disc_flag = true;
        usb_set_intfdata(intf, NULL);
        if (!context)
                return;