diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2009-06-22 06:08:05 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2009-06-22 06:08:17 -0400 |
commit | 33403dcfcdfd097d80213a715604eab2dca93b2e (patch) | |
tree | ab8f5b2790bb0b529788983836197cb94204a5f2 /drivers/s390 | |
parent | 6d56eee2c016b0b131e444d02a66b0fef7df3ef0 (diff) |
[S390] 3270 console: convert from bootmem to slab
The slab allocator is earlier available so convert the
bootmem allocations to slab/gfp allocations.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390')
-rw-r--r-- | drivers/s390/char/con3270.c | 13 | ||||
-rw-r--r-- | drivers/s390/char/raw3270.c | 32 |
2 files changed, 7 insertions, 38 deletions
diff --git a/drivers/s390/char/con3270.c b/drivers/s390/char/con3270.c index 44d02e371c04..bb838bdf829d 100644 --- a/drivers/s390/char/con3270.c +++ b/drivers/s390/char/con3270.c | |||
@@ -7,7 +7,6 @@ | |||
7 | * Copyright IBM Corp. 2003, 2009 | 7 | * Copyright IBM Corp. 2003, 2009 |
8 | */ | 8 | */ |
9 | 9 | ||
10 | #include <linux/bootmem.h> | ||
11 | #include <linux/console.h> | 10 | #include <linux/console.h> |
12 | #include <linux/init.h> | 11 | #include <linux/init.h> |
13 | #include <linux/interrupt.h> | 12 | #include <linux/interrupt.h> |
@@ -600,16 +599,14 @@ con3270_init(void) | |||
600 | if (IS_ERR(rp)) | 599 | if (IS_ERR(rp)) |
601 | return PTR_ERR(rp); | 600 | return PTR_ERR(rp); |
602 | 601 | ||
603 | condev = (struct con3270 *) alloc_bootmem_low(sizeof(struct con3270)); | 602 | condev = kzalloc(sizeof(struct con3270), GFP_KERNEL | GFP_DMA); |
604 | memset(condev, 0, sizeof(struct con3270)); | ||
605 | condev->view.dev = rp; | 603 | condev->view.dev = rp; |
606 | 604 | ||
607 | condev->read = raw3270_request_alloc_bootmem(0); | 605 | condev->read = raw3270_request_alloc(0); |
608 | condev->read->callback = con3270_read_callback; | 606 | condev->read->callback = con3270_read_callback; |
609 | condev->read->callback_data = condev; | 607 | condev->read->callback_data = condev; |
610 | condev->write = | 608 | condev->write = raw3270_request_alloc(CON3270_OUTPUT_BUFFER_SIZE); |
611 | raw3270_request_alloc_bootmem(CON3270_OUTPUT_BUFFER_SIZE); | 609 | condev->kreset = raw3270_request_alloc(1); |
612 | condev->kreset = raw3270_request_alloc_bootmem(1); | ||
613 | 610 | ||
614 | INIT_LIST_HEAD(&condev->lines); | 611 | INIT_LIST_HEAD(&condev->lines); |
615 | INIT_LIST_HEAD(&condev->update); | 612 | INIT_LIST_HEAD(&condev->update); |
@@ -623,7 +620,7 @@ con3270_init(void) | |||
623 | 620 | ||
624 | INIT_LIST_HEAD(&condev->freemem); | 621 | INIT_LIST_HEAD(&condev->freemem); |
625 | for (i = 0; i < CON3270_STRING_PAGES; i++) { | 622 | for (i = 0; i < CON3270_STRING_PAGES; i++) { |
626 | cbuf = (void *) alloc_bootmem_low_pages(PAGE_SIZE); | 623 | cbuf = (void *) get_zeroed_page(GFP_KERNEL | GFP_DMA); |
627 | add_string_memory(&condev->freemem, cbuf, PAGE_SIZE); | 624 | add_string_memory(&condev->freemem, cbuf, PAGE_SIZE); |
628 | } | 625 | } |
629 | condev->cline = alloc_string(&condev->freemem, condev->view.cols); | 626 | condev->cline = alloc_string(&condev->freemem, condev->view.cols); |
diff --git a/drivers/s390/char/raw3270.c b/drivers/s390/char/raw3270.c index acab7b2dfe8a..9047b62294d0 100644 --- a/drivers/s390/char/raw3270.c +++ b/drivers/s390/char/raw3270.c | |||
@@ -7,7 +7,6 @@ | |||
7 | * Copyright IBM Corp. 2003, 2009 | 7 | * Copyright IBM Corp. 2003, 2009 |
8 | */ | 8 | */ |
9 | 9 | ||
10 | #include <linux/bootmem.h> | ||
11 | #include <linux/module.h> | 10 | #include <linux/module.h> |
12 | #include <linux/err.h> | 11 | #include <linux/err.h> |
13 | #include <linux/init.h> | 12 | #include <linux/init.h> |
@@ -143,33 +142,6 @@ raw3270_request_alloc(size_t size) | |||
143 | return rq; | 142 | return rq; |
144 | } | 143 | } |
145 | 144 | ||
146 | #ifdef CONFIG_TN3270_CONSOLE | ||
147 | /* | ||
148 | * Allocate a new 3270 ccw request from bootmem. Only works very | ||
149 | * early in the boot process. Only con3270.c should be using this. | ||
150 | */ | ||
151 | struct raw3270_request __init *raw3270_request_alloc_bootmem(size_t size) | ||
152 | { | ||
153 | struct raw3270_request *rq; | ||
154 | |||
155 | rq = alloc_bootmem_low(sizeof(struct raw3270)); | ||
156 | |||
157 | /* alloc output buffer. */ | ||
158 | if (size > 0) | ||
159 | rq->buffer = alloc_bootmem_low(size); | ||
160 | rq->size = size; | ||
161 | INIT_LIST_HEAD(&rq->list); | ||
162 | |||
163 | /* | ||
164 | * Setup ccw. | ||
165 | */ | ||
166 | rq->ccw.cda = __pa(rq->buffer); | ||
167 | rq->ccw.flags = CCW_FLAG_SLI; | ||
168 | |||
169 | return rq; | ||
170 | } | ||
171 | #endif | ||
172 | |||
173 | /* | 145 | /* |
174 | * Free 3270 ccw request | 146 | * Free 3270 ccw request |
175 | */ | 147 | */ |
@@ -846,8 +818,8 @@ struct raw3270 __init *raw3270_setup_console(struct ccw_device *cdev) | |||
846 | char *ascebc; | 818 | char *ascebc; |
847 | int rc; | 819 | int rc; |
848 | 820 | ||
849 | rp = (struct raw3270 *) alloc_bootmem_low(sizeof(struct raw3270)); | 821 | rp = kzalloc(sizeof(struct raw3270), GFP_KERNEL | GFP_DMA); |
850 | ascebc = (char *) alloc_bootmem(256); | 822 | ascebc = kzalloc(256, GFP_KERNEL); |
851 | rc = raw3270_setup_device(cdev, rp, ascebc); | 823 | rc = raw3270_setup_device(cdev, rp, ascebc); |
852 | if (rc) | 824 | if (rc) |
853 | return ERR_PTR(rc); | 825 | return ERR_PTR(rc); |