aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390')
-rw-r--r--drivers/s390/block/xpram.c41
1 files changed, 19 insertions, 22 deletions
diff --git a/drivers/s390/block/xpram.c b/drivers/s390/block/xpram.c
index 03916989ed2d..76814f3e898a 100644
--- a/drivers/s390/block/xpram.c
+++ b/drivers/s390/block/xpram.c
@@ -25,6 +25,9 @@
25 * generic hard disk support to replace ad-hoc partitioning 25 * generic hard disk support to replace ad-hoc partitioning
26 */ 26 */
27 27
28#define KMSG_COMPONENT "xpram"
29#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
30
28#include <linux/module.h> 31#include <linux/module.h>
29#include <linux/moduleparam.h> 32#include <linux/moduleparam.h>
30#include <linux/ctype.h> /* isdigit, isxdigit */ 33#include <linux/ctype.h> /* isdigit, isxdigit */
@@ -42,12 +45,6 @@
42#define XPRAM_DEVS 1 /* one partition */ 45#define XPRAM_DEVS 1 /* one partition */
43#define XPRAM_MAX_DEVS 32 /* maximal number of devices (partitions) */ 46#define XPRAM_MAX_DEVS 32 /* maximal number of devices (partitions) */
44 47
45#define PRINT_DEBUG(x...) printk(KERN_DEBUG XPRAM_NAME " debug:" x)
46#define PRINT_INFO(x...) printk(KERN_INFO XPRAM_NAME " info:" x)
47#define PRINT_WARN(x...) printk(KERN_WARNING XPRAM_NAME " warning:" x)
48#define PRINT_ERR(x...) printk(KERN_ERR XPRAM_NAME " error:" x)
49
50
51typedef struct { 48typedef struct {
52 unsigned int size; /* size of xpram segment in pages */ 49 unsigned int size; /* size of xpram segment in pages */
53 unsigned int offset; /* start page of xpram segment */ 50 unsigned int offset; /* start page of xpram segment */
@@ -264,7 +261,7 @@ static int __init xpram_setup_sizes(unsigned long pages)
264 261
265 /* Check number of devices. */ 262 /* Check number of devices. */
266 if (devs <= 0 || devs > XPRAM_MAX_DEVS) { 263 if (devs <= 0 || devs > XPRAM_MAX_DEVS) {
267 PRINT_ERR("invalid number %d of devices\n",devs); 264 pr_err("%d is not a valid number of XPRAM devices\n",devs);
268 return -EINVAL; 265 return -EINVAL;
269 } 266 }
270 xpram_devs = devs; 267 xpram_devs = devs;
@@ -295,22 +292,22 @@ static int __init xpram_setup_sizes(unsigned long pages)
295 mem_auto_no++; 292 mem_auto_no++;
296 } 293 }
297 294
298 PRINT_INFO(" number of devices (partitions): %d \n", xpram_devs); 295 pr_info(" number of devices (partitions): %d \n", xpram_devs);
299 for (i = 0; i < xpram_devs; i++) { 296 for (i = 0; i < xpram_devs; i++) {
300 if (xpram_sizes[i]) 297 if (xpram_sizes[i])
301 PRINT_INFO(" size of partition %d: %u kB\n", 298 pr_info(" size of partition %d: %u kB\n",
302 i, xpram_sizes[i]); 299 i, xpram_sizes[i]);
303 else 300 else
304 PRINT_INFO(" size of partition %d to be set " 301 pr_info(" size of partition %d to be set "
305 "automatically\n",i); 302 "automatically\n",i);
306 } 303 }
307 PRINT_DEBUG(" memory needed (for sized partitions): %lu kB\n", 304 pr_info(" memory needed (for sized partitions): %lu kB\n",
308 mem_needed); 305 mem_needed);
309 PRINT_DEBUG(" partitions to be sized automatically: %d\n", 306 pr_info(" partitions to be sized automatically: %d\n",
310 mem_auto_no); 307 mem_auto_no);
311 308
312 if (mem_needed > pages * 4) { 309 if (mem_needed > pages * 4) {
313 PRINT_ERR("Not enough expanded memory available\n"); 310 pr_err("Not enough expanded memory available\n");
314 return -EINVAL; 311 return -EINVAL;
315 } 312 }
316 313
@@ -322,8 +319,8 @@ static int __init xpram_setup_sizes(unsigned long pages)
322 */ 319 */
323 if (mem_auto_no) { 320 if (mem_auto_no) {
324 mem_auto = ((pages - mem_needed / 4) / mem_auto_no) * 4; 321 mem_auto = ((pages - mem_needed / 4) / mem_auto_no) * 4;
325 PRINT_INFO(" automatically determined " 322 pr_info(" automatically determined "
326 "partition size: %lu kB\n", mem_auto); 323 "partition size: %lu kB\n", mem_auto);
327 for (i = 0; i < xpram_devs; i++) 324 for (i = 0; i < xpram_devs; i++)
328 if (xpram_sizes[i] == 0) 325 if (xpram_sizes[i] == 0)
329 xpram_sizes[i] = mem_auto; 326 xpram_sizes[i] = mem_auto;
@@ -405,12 +402,12 @@ static int __init xpram_init(void)
405 402
406 /* Find out size of expanded memory. */ 403 /* Find out size of expanded memory. */
407 if (xpram_present() != 0) { 404 if (xpram_present() != 0) {
408 PRINT_WARN("No expanded memory available\n"); 405 pr_err("No expanded memory available\n");
409 return -ENODEV; 406 return -ENODEV;
410 } 407 }
411 xpram_pages = xpram_highest_page_index() + 1; 408 xpram_pages = xpram_highest_page_index() + 1;
412 PRINT_INFO(" %u pages expanded memory found (%lu KB).\n", 409 pr_info(" %u pages expanded memory found (%lu KB).\n",
413 xpram_pages, (unsigned long) xpram_pages*4); 410 xpram_pages, (unsigned long) xpram_pages*4);
414 rc = xpram_setup_sizes(xpram_pages); 411 rc = xpram_setup_sizes(xpram_pages);
415 if (rc) 412 if (rc)
416 return rc; 413 return rc;