aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/char/rio/rio_linux.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/drivers/char/rio/rio_linux.c b/drivers/char/rio/rio_linux.c
index ec2afd139472..2e8a6eed34be 100644
--- a/drivers/char/rio/rio_linux.c
+++ b/drivers/char/rio/rio_linux.c
@@ -796,15 +796,6 @@ static int rio_init_drivers(void)
796 return 1; 796 return 1;
797} 797}
798 798
799
800static void *ckmalloc(int size)
801{
802 void *p;
803
804 p = kzalloc(size, GFP_KERNEL);
805 return p;
806}
807
808static const struct tty_port_operations rio_port_ops = { 799static const struct tty_port_operations rio_port_ops = {
809 .carrier_raised = rio_carrier_raised, 800 .carrier_raised = rio_carrier_raised,
810}; 801};
@@ -827,18 +818,18 @@ static int rio_init_datastructures(void)
827#define TMIO_SZ sizeof(struct termios *) 818#define TMIO_SZ sizeof(struct termios *)
828 rio_dprintk(RIO_DEBUG_INIT, "getting : %Zd %Zd %Zd %Zd %Zd bytes\n", RI_SZ, RIO_HOSTS * HOST_SZ, RIO_PORTS * PORT_SZ, RIO_PORTS * TMIO_SZ, RIO_PORTS * TMIO_SZ); 819 rio_dprintk(RIO_DEBUG_INIT, "getting : %Zd %Zd %Zd %Zd %Zd bytes\n", RI_SZ, RIO_HOSTS * HOST_SZ, RIO_PORTS * PORT_SZ, RIO_PORTS * TMIO_SZ, RIO_PORTS * TMIO_SZ);
829 820
830 if (!(p = ckmalloc(RI_SZ))) 821 if (!(p = kzalloc(RI_SZ, GFP_KERNEL)))
831 goto free0; 822 goto free0;
832 if (!(p->RIOHosts = ckmalloc(RIO_HOSTS * HOST_SZ))) 823 if (!(p->RIOHosts = kzalloc(RIO_HOSTS * HOST_SZ, GFP_KERNEL)))
833 goto free1; 824 goto free1;
834 if (!(p->RIOPortp = ckmalloc(RIO_PORTS * PORT_SZ))) 825 if (!(p->RIOPortp = kzalloc(RIO_PORTS * PORT_SZ, GFP_KERNEL)))
835 goto free2; 826 goto free2;
836 p->RIOConf = RIOConf; 827 p->RIOConf = RIOConf;
837 rio_dprintk(RIO_DEBUG_INIT, "Got : %p %p %p\n", p, p->RIOHosts, p->RIOPortp); 828 rio_dprintk(RIO_DEBUG_INIT, "Got : %p %p %p\n", p, p->RIOHosts, p->RIOPortp);
838 829
839#if 1 830#if 1
840 for (i = 0; i < RIO_PORTS; i++) { 831 for (i = 0; i < RIO_PORTS; i++) {
841 port = p->RIOPortp[i] = ckmalloc(sizeof(struct Port)); 832 port = p->RIOPortp[i] = kzalloc(sizeof(struct Port), GFP_KERNEL);
842 if (!port) { 833 if (!port) {
843 goto free6; 834 goto free6;
844 } 835 }