Merge branch 'reset-seq' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libat...
[powerpc.git] / drivers / serial / ioc4_serial.c
index 711bd15..0c17938 100644 (file)
@@ -1076,13 +1076,12 @@ static int inline ioc4_attach_local(struct ioc4_driver_data *idd)
        /* Create port structures for each port */
        for (port_number = 0; port_number < IOC4_NUM_SERIAL_PORTS;
                                                        port_number++) {
-               port = kmalloc(sizeof(struct ioc4_port), GFP_KERNEL);
+               port = kzalloc(sizeof(struct ioc4_port), GFP_KERNEL);
                if (!port) {
                        printk(KERN_WARNING
                                "IOC4 serial memory not available for port\n");
                        return -ENOMEM;
                }
-               memset(port, 0, sizeof(struct ioc4_port));
                spin_lock_init(&port->ip_lock);
 
                /* we need to remember the previous ones, to point back to
@@ -1681,7 +1680,7 @@ static void transmit_chars(struct uart_port *the_port)
  */
 static void
 ioc4_change_speed(struct uart_port *the_port,
-                 struct termios *new_termios, struct termios *old_termios)
+                 struct ktermios *new_termios, struct ktermios *old_termios)
 {
        struct ioc4_port *port = get_ioc4_port(the_port, 0);
        int baud, bits;
@@ -1802,7 +1801,7 @@ static inline int ic4_startup_local(struct uart_port *the_port)
        ioc4_set_proto(port, the_port->mapbase);
 
        /* set the speed of the serial port */
-       ioc4_change_speed(the_port, info->tty->termios, (struct termios *)0);
+       ioc4_change_speed(the_port, info->tty->termios, (struct ktermios *)0);
 
        return 0;
 }
@@ -2570,7 +2569,7 @@ static int ic4_startup(struct uart_port *the_port)
  */
 static void
 ic4_set_termios(struct uart_port *the_port,
-               struct termios *termios, struct termios *old_termios)
+               struct ktermios *termios, struct ktermios *old_termios)
 {
        unsigned long port_flags;
 
@@ -2685,7 +2684,7 @@ static int ioc4_serial_remove_one(struct ioc4_driver_data *idd)
                free_irq(control->ic_irq, soft);
                if (soft->is_ioc4_serial_addr) {
                        iounmap(soft->is_ioc4_serial_addr);
-                       release_region((unsigned long)
+                       release_mem_region((unsigned long)
                             soft->is_ioc4_serial_addr,
                                sizeof(struct ioc4_serial));
                }
@@ -2790,7 +2789,7 @@ ioc4_serial_attach_one(struct ioc4_driver_data *idd)
        /* request serial registers */
        tmp_addr1 = idd->idd_bar0 + IOC4_SERIAL_OFFSET;
 
-       if (!request_region(tmp_addr1, sizeof(struct ioc4_serial),
+       if (!request_mem_region(tmp_addr1, sizeof(struct ioc4_serial),
                                        "sioc4_uart")) {
                printk(KERN_WARNING
                        "ioc4 (%p): unable to get request region for "
@@ -2811,7 +2810,7 @@ ioc4_serial_attach_one(struct ioc4_driver_data *idd)
                                (void *)serial));
 
        /* Get memory for the new card */
-       control = kmalloc(sizeof(struct ioc4_control), GFP_KERNEL);
+       control = kzalloc(sizeof(struct ioc4_control), GFP_KERNEL);
 
        if (!control) {
                printk(KERN_WARNING "ioc4_attach_one"
@@ -2819,11 +2818,10 @@ ioc4_serial_attach_one(struct ioc4_driver_data *idd)
                ret = -ENOMEM;
                goto out2;
        }
-       memset(control, 0, sizeof(struct ioc4_control));
        idd->idd_serial_data = control;
 
        /* Allocate the soft structure */
-       soft = kmalloc(sizeof(struct ioc4_soft), GFP_KERNEL);
+       soft = kzalloc(sizeof(struct ioc4_soft), GFP_KERNEL);
        if (!soft) {
                printk(KERN_WARNING
                       "ioc4 (%p): unable to get memory for the soft struct\n",
@@ -2831,7 +2829,6 @@ ioc4_serial_attach_one(struct ioc4_driver_data *idd)
                ret = -ENOMEM;
                goto out3;
        }
-       memset(soft, 0, sizeof(struct ioc4_soft));
 
        spin_lock_init(&soft->is_ir_lock);
        soft->is_ioc4_misc_addr = idd->idd_misc_regs;
@@ -2889,7 +2886,7 @@ out3:
 out2:
        if (serial)
                iounmap(serial);
-       release_region(tmp_addr1, sizeof(struct ioc4_serial));
+       release_mem_region(tmp_addr1, sizeof(struct ioc4_serial));
 out1:
 
        return ret;