aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi/zfcp_aux.c
diff options
context:
space:
mode:
authorChristof Schmitt <christof.schmitt@de.ibm.com>2008-06-10 12:20:58 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-07-12 09:22:26 -0400
commit553448f6c4838a1e4bed2bc9301c748278d7d9ce (patch)
treed06b3b52b5bbe5047e3855297aa65759f8e50405 /drivers/s390/scsi/zfcp_aux.c
parent00bab91066a49468bfa4f6d5c8ad5e9ec53b7ea3 (diff)
[SCSI] zfcp: Message cleanup
Cleanup the messages used in the zfcp driver: Remove unnecessary debug and trace message and convert the remaining messages to standard kernel macros. Remove the zfcp message macros and while updating the whole flie also update the copyright headers. Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com> Signed-off-by: Swen Schillig <swen@vnet.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/s390/scsi/zfcp_aux.c')
-rw-r--r--drivers/s390/scsi/zfcp_aux.c75
1 files changed, 21 insertions, 54 deletions
diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c
index 7084a6ae1096..47739f4f6709 100644
--- a/drivers/s390/scsi/zfcp_aux.c
+++ b/drivers/s390/scsi/zfcp_aux.c
@@ -1,22 +1,9 @@
1/* 1/*
2 * This file is part of the zfcp device driver for 2 * zfcp device driver
3 * FCP adapters for IBM System z9 and zSeries.
4 * 3 *
5 * (C) Copyright IBM Corp. 2002, 2006 4 * Module interface and handling of zfcp data structures.
6 * 5 *
7 * This program is free software; you can redistribute it and/or modify 6 * Copyright IBM Corporation 2002, 2008
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2, or (at your option)
10 * any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 */ 7 */
21 8
22/* 9/*
@@ -31,13 +18,16 @@
31 * Maxim Shchetynin 18 * Maxim Shchetynin
32 * Volker Sameske 19 * Volker Sameske
33 * Ralph Wuerthner 20 * Ralph Wuerthner
21 * Michael Loehr
22 * Swen Schillig
23 * Christof Schmitt
24 * Martin Petermann
25 * Sven Schuetz
34 */ 26 */
35 27
36#include <linux/miscdevice.h> 28#include <linux/miscdevice.h>
37#include "zfcp_ext.h" 29#include "zfcp_ext.h"
38 30
39/* accumulated log level (module parameter) */
40static u32 loglevel = ZFCP_LOG_LEVEL_DEFAULTS;
41static char *device; 31static char *device;
42/*********************** FUNCTION PROTOTYPES *********************************/ 32/*********************** FUNCTION PROTOTYPES *********************************/
43 33
@@ -57,12 +47,6 @@ MODULE_LICENSE("GPL");
57module_param(device, charp, 0400); 47module_param(device, charp, 0400);
58MODULE_PARM_DESC(device, "specify initial device"); 48MODULE_PARM_DESC(device, "specify initial device");
59 49
60module_param(loglevel, uint, 0400);
61MODULE_PARM_DESC(loglevel,
62 "log levels, 8 nibbles: "
63 "FC ERP QDIO CIO Config FSF SCSI Other, "
64 "levels: 0=none 1=normal 2=devel 3=trace");
65
66/****************************************************************/ 50/****************************************************************/
67/************** Functions without logging ***********************/ 51/************** Functions without logging ***********************/
68/****************************************************************/ 52/****************************************************************/
@@ -87,8 +71,6 @@ _zfcp_hex_dump(char *addr, int count)
87/****** Functions to handle the request ID hash table ********/ 71/****** Functions to handle the request ID hash table ********/
88/****************************************************************/ 72/****************************************************************/
89 73
90#define ZFCP_LOG_AREA ZFCP_LOG_AREA_FSF
91
92static int zfcp_reqlist_alloc(struct zfcp_adapter *adapter) 74static int zfcp_reqlist_alloc(struct zfcp_adapter *adapter)
93{ 75{
94 int idx; 76 int idx;
@@ -118,14 +100,10 @@ int zfcp_reqlist_isempty(struct zfcp_adapter *adapter)
118 return 1; 100 return 1;
119} 101}
120 102
121#undef ZFCP_LOG_AREA
122
123/****************************************************************/ 103/****************************************************************/
124/************** Uncategorised Functions *************************/ 104/************** Uncategorised Functions *************************/
125/****************************************************************/ 105/****************************************************************/
126 106
127#define ZFCP_LOG_AREA ZFCP_LOG_AREA_OTHER
128
129/** 107/**
130 * zfcp_device_setup - setup function 108 * zfcp_device_setup - setup function
131 * @str: pointer to parameter string 109 * @str: pointer to parameter string
@@ -143,8 +121,11 @@ zfcp_device_setup(char *devstr)
143 121
144 len = strlen(devstr) + 1; 122 len = strlen(devstr) + 1;
145 str = kmalloc(len, GFP_KERNEL); 123 str = kmalloc(len, GFP_KERNEL);
146 if (!str) 124 if (!str) {
147 goto err_out; 125 pr_err("zfcp: Could not allocate memory for "
126 "device parameter string, device not attached.\n");
127 return 0;
128 }
148 memcpy(str, devstr, len); 129 memcpy(str, devstr, len);
149 130
150 tmp = strchr(str, ','); 131 tmp = strchr(str, ',');
@@ -167,7 +148,8 @@ zfcp_device_setup(char *devstr)
167 return 1; 148 return 1;
168 149
169 err_out: 150 err_out:
170 ZFCP_LOG_NORMAL("Parse error for device parameter string %s\n", str); 151 pr_err("zfcp: Parse error for device parameter string %s, "
152 "device not attached.\n", str);
171 kfree(str); 153 kfree(str);
172 return 0; 154 return 0;
173} 155}
@@ -248,8 +230,6 @@ zfcp_module_init(void)
248 if (!zfcp_data.gid_pn_cache) 230 if (!zfcp_data.gid_pn_cache)
249 goto out_gid_cache; 231 goto out_gid_cache;
250 232
251 atomic_set(&zfcp_data.loglevel, loglevel);
252
253 /* initialize adapter list */ 233 /* initialize adapter list */
254 INIT_LIST_HEAD(&zfcp_data.adapter_list_head); 234 INIT_LIST_HEAD(&zfcp_data.adapter_list_head);
255 235
@@ -263,8 +243,7 @@ zfcp_module_init(void)
263 243
264 retval = misc_register(&zfcp_cfdc_misc); 244 retval = misc_register(&zfcp_cfdc_misc);
265 if (retval != 0) { 245 if (retval != 0) {
266 ZFCP_LOG_INFO("registration of misc device " 246 pr_err("zfcp: registration of misc device zfcp_cfdc failed\n");
267 "zfcp_cfdc failed\n");
268 goto out_misc; 247 goto out_misc;
269 } 248 }
270 249
@@ -277,7 +256,7 @@ zfcp_module_init(void)
277 /* setup dynamic I/O */ 256 /* setup dynamic I/O */
278 retval = zfcp_ccw_register(); 257 retval = zfcp_ccw_register();
279 if (retval) { 258 if (retval) {
280 ZFCP_LOG_NORMAL("registration with common I/O layer failed\n"); 259 pr_err("zfcp: Registration with common I/O layer failed.\n");
281 goto out_ccw_register; 260 goto out_ccw_register;
282 } 261 }
283 262
@@ -300,14 +279,10 @@ zfcp_module_init(void)
300 return retval; 279 return retval;
301} 280}
302 281
303#undef ZFCP_LOG_AREA
304
305/****************************************************************/ 282/****************************************************************/
306/****** Functions for configuration/set-up of structures ********/ 283/****** Functions for configuration/set-up of structures ********/
307/****************************************************************/ 284/****************************************************************/
308 285
309#define ZFCP_LOG_AREA ZFCP_LOG_AREA_CONFIG
310
311/** 286/**
312 * zfcp_get_unit_by_lun - find unit in unit list of port by FCP LUN 287 * zfcp_get_unit_by_lun - find unit in unit list of port by FCP LUN
313 * @port: pointer to port to search for unit 288 * @port: pointer to port to search for unit
@@ -598,6 +573,8 @@ static void _zfcp_status_read_scheduler(struct work_struct *work)
598 * All adapter internal structures are set up. 573 * All adapter internal structures are set up.
599 * Proc-fs entries are also created. 574 * Proc-fs entries are also created.
600 * 575 *
576 * FIXME: Use -ENOMEM as return code for allocation failures
577 *
601 * returns: 0 if a new adapter was successfully enqueued 578 * returns: 0 if a new adapter was successfully enqueued
602 * ZFCP_KNOWN if an adapter with this devno was already present 579 * ZFCP_KNOWN if an adapter with this devno was already present
603 * -ENOMEM if alloc failed 580 * -ENOMEM if alloc failed
@@ -615,11 +592,8 @@ zfcp_adapter_enqueue(struct ccw_device *ccw_device)
615 592
616 /* try to allocate new adapter data structure (zeroed) */ 593 /* try to allocate new adapter data structure (zeroed) */
617 adapter = kzalloc(sizeof (struct zfcp_adapter), GFP_KERNEL); 594 adapter = kzalloc(sizeof (struct zfcp_adapter), GFP_KERNEL);
618 if (!adapter) { 595 if (!adapter)
619 ZFCP_LOG_INFO("error: allocation of base adapter "
620 "structure failed\n");
621 goto out; 596 goto out;
622 }
623 597
624 ccw_device->handler = NULL; 598 ccw_device->handler = NULL;
625 599
@@ -760,7 +734,6 @@ zfcp_adapter_dequeue(struct zfcp_adapter *adapter)
760 zfcp_reqlist_free(adapter); 734 zfcp_reqlist_free(adapter);
761 kfree(adapter->fc_stats); 735 kfree(adapter->fc_stats);
762 kfree(adapter->stats_reset_data); 736 kfree(adapter->stats_reset_data);
763 ZFCP_LOG_TRACE("freeing adapter structure\n");
764 kfree(adapter); 737 kfree(adapter);
765 out: 738 out:
766 return; 739 return;
@@ -908,12 +881,8 @@ zfcp_nameserver_enqueue(struct zfcp_adapter *adapter)
908 881
909 port = zfcp_port_enqueue(adapter, 0, ZFCP_STATUS_PORT_WKA, 882 port = zfcp_port_enqueue(adapter, 0, ZFCP_STATUS_PORT_WKA,
910 ZFCP_DID_DIRECTORY_SERVICE); 883 ZFCP_DID_DIRECTORY_SERVICE);
911 if (!port) { 884 if (!port)
912 ZFCP_LOG_INFO("error: enqueue of nameserver port for "
913 "adapter %s failed\n",
914 zfcp_get_busid_by_adapter(adapter));
915 return -ENXIO; 885 return -ENXIO;
916 }
917 zfcp_port_put(port); 886 zfcp_port_put(port);
918 887
919 return 0; 888 return 0;
@@ -946,5 +915,3 @@ int zfcp_sg_setup_table(struct scatterlist *sg, int count)
946 } 915 }
947 return 0; 916 return 0;
948} 917}
949
950#undef ZFCP_LOG_AREA