diff --git a/drivers/net/ehea/ehea.h b/drivers/net/ehea/ehea.h
index 45e709f..8e745e7 100644
--- a/drivers/net/ehea/ehea.h
+++ b/drivers/net/ehea/ehea.h
@@ -130,6 +130,19 @@
 
 /* utility functions */
 
+#define ehea_info(fmt, args...) \
+	printk(KERN_INFO DRV_NAME ": " fmt "\n", ## args)
+
+#define ehea_error(fmt, args...) \
+	printk(KERN_ERR DRV_NAME ": Error in %s: " fmt "\n", __func__, ## args)
+
+#ifdef DEBUG
+#define ehea_debug(fmt, args...) \
+	printk(KERN_DEBUG DRV_NAME ": " fmt, ## args)
+#else
+#define ehea_debug(fmt, args...) do {} while (0)
+#endif
+
 void ehea_dump(void *adr, int len, char *msg);
 
 #define EHEA_BMASK(pos, length) (((pos) << 16) + (length))
diff --git a/drivers/net/ehea/ehea_ethtool.c b/drivers/net/ehea/ehea_ethtool.c
index 273fedb..75b099c 100644
--- a/drivers/net/ehea/ehea_ethtool.c
+++ b/drivers/net/ehea/ehea_ethtool.c
@@ -26,8 +26,6 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-
 #include "ehea.h"
 #include "ehea_phyp.h"
 
@@ -120,10 +118,10 @@
 	ret = ehea_set_portspeed(port, sp);
 
 	if (!ret)
-		netdev_info(dev,
-			    "Port speed successfully set: %dMbps %s Duplex\n",
-			    port->port_speed,
-			    port->full_duplex == 1 ? "Full" : "Half");
+		ehea_info("%s: Port speed successfully set: %dMbps "
+			  "%s Duplex",
+			  port->netdev->name, port->port_speed,
+			  port->full_duplex == 1 ? "Full" : "Half");
 out:
 	return ret;
 }
@@ -136,10 +134,10 @@
 	ret = ehea_set_portspeed(port, EHEA_SPEED_AUTONEG);
 
 	if (!ret)
-		netdev_info(port->netdev,
-			    "Port speed successfully set: %dMbps %s Duplex\n",
-			    port->port_speed,
-			    port->full_duplex == 1 ? "Full" : "Half");
+		ehea_info("%s: Port speed successfully set: %dMbps "
+			  "%s Duplex",
+			  port->netdev->name, port->port_speed,
+			  port->full_duplex == 1 ? "Full" : "Half");
 	return ret;
 }
 
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c
index f700c76..a84c389 100644
--- a/drivers/net/ehea/ehea_main.c
+++ b/drivers/net/ehea/ehea_main.c
@@ -26,8 +26,6 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-
 #include <linux/in.h>
 #include <linux/ip.h>
 #include <linux/tcp.h>
@@ -138,8 +136,8 @@
 	int x;
 	unsigned char *deb = adr;
 	for (x = 0; x < len; x += 16) {
-		pr_info("%s adr=%p ofs=%04x %016llx %016llx\n",
-			msg, deb, x, *((u64 *)&deb[0]), *((u64 *)&deb[8]));
+		printk(DRV_NAME " %s adr=%p ofs=%04x %016llx %016llx\n", msg,
+			  deb, x, *((u64 *)&deb[0]), *((u64 *)&deb[8]));
 		deb += 16;
 	}
 }
@@ -339,7 +337,7 @@
 
 	cb2 = (void *)get_zeroed_page(GFP_KERNEL);
 	if (!cb2) {
-		netdev_err(dev, "no mem for cb2\n");
+		ehea_error("no mem for cb2");
 		goto out;
 	}
 
@@ -347,7 +345,7 @@
 				      port->logical_port_id,
 				      H_PORT_CB2, H_PORT_CB2_ALL, cb2);
 	if (hret != H_SUCCESS) {
-		netdev_err(dev, "query_ehea_port failed\n");
+		ehea_error("query_ehea_port failed");
 		goto out_herr;
 	}
 
@@ -463,9 +461,8 @@
 		if (!skb) {
 			q_skba->os_skbs = fill_wqes - i;
 			if (q_skba->os_skbs == q_skba->len - 2) {
-				netdev_info(pr->port->netdev,
-					    "rq%i ran dry - no mem for skb\n",
-					    rq_nr);
+				ehea_info("%s: rq%i ran dry - no mem for skb",
+					  pr->port->netdev->name, rq_nr);
 				ret = -ENOMEM;
 			}
 			break;
@@ -630,8 +627,8 @@
 
 	if (cqe->status & EHEA_CQE_STAT_FAT_ERR_MASK) {
 		if (netif_msg_rx_err(pr->port)) {
-			pr_err("Critical receive error for QP %d. Resetting port.\n",
-			       pr->qp->init_attr.qp_nr);
+			ehea_error("Critical receive error for QP %d. "
+				   "Resetting port.", pr->qp->init_attr.qp_nr);
 			ehea_dump(cqe, sizeof(*cqe), "CQE");
 		}
 		ehea_schedule_port_reset(pr->port);
@@ -733,8 +730,8 @@
 							  skb_arr_rq1_len,
 							  wqe_index);
 				if (unlikely(!skb)) {
-					netif_err(port, rx_err, dev,
-						  "LL rq1: skb=NULL\n");
+					if (netif_msg_rx_err(port))
+						ehea_error("LL rq1: skb=NULL");
 
 					skb = netdev_alloc_skb(dev,
 							       EHEA_L_PKT_SIZE);
@@ -749,8 +746,8 @@
 				skb = get_skb_by_index(skb_arr_rq2,
 						       skb_arr_rq2_len, cqe);
 				if (unlikely(!skb)) {
-					netif_err(port, rx_err, dev,
-						  "rq2: skb=NULL\n");
+					if (netif_msg_rx_err(port))
+						ehea_error("rq2: skb=NULL");
 					break;
 				}
 				ehea_fill_skb(dev, skb, cqe);
@@ -760,8 +757,8 @@
 				skb = get_skb_by_index(skb_arr_rq3,
 						       skb_arr_rq3_len, cqe);
 				if (unlikely(!skb)) {
-					netif_err(port, rx_err, dev,
-						  "rq3: skb=NULL\n");
+					if (netif_msg_rx_err(port))
+						ehea_error("rq3: skb=NULL");
 					break;
 				}
 				ehea_fill_skb(dev, skb, cqe);
@@ -833,7 +830,7 @@
 					 msecs_to_jiffies(100));
 
 		if (!ret) {
-			pr_err("HW/SW queues out of sync\n");
+			ehea_error("HW/SW queues out of sync");
 			ehea_schedule_port_reset(pr->port);
 			return;
 		}
@@ -866,14 +863,14 @@
 		}
 
 		if (cqe->status & EHEA_CQE_STAT_ERR_MASK) {
-			pr_err("Bad send completion status=0x%04X\n",
-			       cqe->status);
+			ehea_error("Bad send completion status=0x%04X",
+				   cqe->status);
 
 			if (netif_msg_tx_err(pr->port))
 				ehea_dump(cqe, sizeof(*cqe), "Send CQE");
 
 			if (cqe->status & EHEA_CQE_STAT_RESET_MASK) {
-				pr_err("Resetting port\n");
+				ehea_error("Resetting port");
 				ehea_schedule_port_reset(pr->port);
 				break;
 			}
@@ -991,8 +988,8 @@
 
 	while (eqe) {
 		qp_token = EHEA_BMASK_GET(EHEA_EQE_QP_TOKEN, eqe->entry);
-		pr_err("QP aff_err: entry=0x%llx, token=0x%x\n",
-		       eqe->entry, qp_token);
+		ehea_error("QP aff_err: entry=0x%llx, token=0x%x",
+			   eqe->entry, qp_token);
 
 		qp = port->port_res[qp_token].qp;
 
@@ -1010,7 +1007,7 @@
 	}
 
 	if (reset_port) {
-		pr_err("Resetting port\n");
+		ehea_error("Resetting port");
 		ehea_schedule_port_reset(port);
 	}
 
@@ -1038,7 +1035,7 @@
 	/* may be called via ehea_neq_tasklet() */
 	cb0 = (void *)get_zeroed_page(GFP_ATOMIC);
 	if (!cb0) {
-		pr_err("no mem for cb0\n");
+		ehea_error("no mem for cb0");
 		ret = -ENOMEM;
 		goto out;
 	}
@@ -1130,7 +1127,7 @@
 
 	cb4 = (void *)get_zeroed_page(GFP_KERNEL);
 	if (!cb4) {
-		pr_err("no mem for cb4\n");
+		ehea_error("no mem for cb4");
 		ret = -ENOMEM;
 		goto out;
 	}
@@ -1181,16 +1178,16 @@
 				break;
 			}
 		} else {
-			pr_err("Failed sensing port speed\n");
+			ehea_error("Failed sensing port speed");
 			ret = -EIO;
 		}
 	} else {
 		if (hret == H_AUTHORITY) {
-			pr_info("Hypervisor denied setting port speed\n");
+			ehea_info("Hypervisor denied setting port speed");
 			ret = -EPERM;
 		} else {
 			ret = -EIO;
-			pr_err("Failed setting port speed\n");
+			ehea_error("Failed setting port speed");
 		}
 	}
 	if (!prop_carrier_state || (port->phy_link == EHEA_PHY_LINK_UP))
@@ -1207,78 +1204,80 @@
 	u8 ec;
 	u8 portnum;
 	struct ehea_port *port;
-	struct net_device *dev;
 
 	ec = EHEA_BMASK_GET(NEQE_EVENT_CODE, eqe);
 	portnum = EHEA_BMASK_GET(NEQE_PORTNUM, eqe);
 	port = ehea_get_port(adapter, portnum);
-	dev = port->netdev;
 
 	switch (ec) {
 	case EHEA_EC_PORTSTATE_CHG:	/* port state change */
 
 		if (!port) {
-			netdev_err(dev, "unknown portnum %x\n", portnum);
+			ehea_error("unknown portnum %x", portnum);
 			break;
 		}
 
 		if (EHEA_BMASK_GET(NEQE_PORT_UP, eqe)) {
-			if (!netif_carrier_ok(dev)) {
+			if (!netif_carrier_ok(port->netdev)) {
 				ret = ehea_sense_port_attr(port);
 				if (ret) {
-					netdev_err(dev, "failed resensing port attributes\n");
+					ehea_error("failed resensing port "
+						   "attributes");
 					break;
 				}
 
-				netif_info(port, link, dev,
-					   "Logical port up: %dMbps %s Duplex\n",
-					   port->port_speed,
-					   port->full_duplex == 1 ?
-					   "Full" : "Half");
+				if (netif_msg_link(port))
+					ehea_info("%s: Logical port up: %dMbps "
+						  "%s Duplex",
+						  port->netdev->name,
+						  port->port_speed,
+						  port->full_duplex ==
+						  1 ? "Full" : "Half");
 
-				netif_carrier_on(dev);
-				netif_wake_queue(dev);
+				netif_carrier_on(port->netdev);
+				netif_wake_queue(port->netdev);
 			}
 		} else
-			if (netif_carrier_ok(dev)) {
-				netif_info(port, link, dev,
-					   "Logical port down\n");
-				netif_carrier_off(dev);
-				netif_stop_queue(dev);
+			if (netif_carrier_ok(port->netdev)) {
+				if (netif_msg_link(port))
+					ehea_info("%s: Logical port down",
+						  port->netdev->name);
+				netif_carrier_off(port->netdev);
+				netif_stop_queue(port->netdev);
 			}
 
 		if (EHEA_BMASK_GET(NEQE_EXTSWITCH_PORT_UP, eqe)) {
 			port->phy_link = EHEA_PHY_LINK_UP;
-			netif_info(port, link, dev,
-				   "Physical port up\n");
+			if (netif_msg_link(port))
+				ehea_info("%s: Physical port up",
+					  port->netdev->name);
 			if (prop_carrier_state)
-				netif_carrier_on(dev);
+				netif_carrier_on(port->netdev);
 		} else {
 			port->phy_link = EHEA_PHY_LINK_DOWN;
-			netif_info(port, link, dev,
-				   "Physical port down\n");
+			if (netif_msg_link(port))
+				ehea_info("%s: Physical port down",
+					  port->netdev->name);
 			if (prop_carrier_state)
-				netif_carrier_off(dev);
+				netif_carrier_off(port->netdev);
 		}
 
 		if (EHEA_BMASK_GET(NEQE_EXTSWITCH_PRIMARY, eqe))
-			netdev_info(dev,
-				    "External switch port is primary port\n");
+			ehea_info("External switch port is primary port");
 		else
-			netdev_info(dev,
-				    "External switch port is backup port\n");
+			ehea_info("External switch port is backup port");
 
 		break;
 	case EHEA_EC_ADAPTER_MALFUNC:
-		netdev_err(dev, "Adapter malfunction\n");
+		ehea_error("Adapter malfunction");
 		break;
 	case EHEA_EC_PORT_MALFUNC:
-		netdev_info(dev, "Port malfunction\n");
-		netif_carrier_off(dev);
-		netif_stop_queue(dev);
+		ehea_info("Port malfunction: Device: %s", port->netdev->name);
+		netif_carrier_off(port->netdev);
+		netif_stop_queue(port->netdev);
 		break;
 	default:
-		netdev_err(dev, "unknown event code %x, eqe=0x%llX\n", ec, eqe);
+		ehea_error("unknown event code %x, eqe=0x%llX", ec, eqe);
 		break;
 	}
 }
@@ -1290,13 +1289,13 @@
 	u64 event_mask;
 
 	eqe = ehea_poll_eq(adapter->neq);
-	pr_debug("eqe=%p\n", eqe);
+	ehea_debug("eqe=%p", eqe);
 
 	while (eqe) {
-		pr_debug("*eqe=%lx\n", eqe->entry);
+		ehea_debug("*eqe=%lx", eqe->entry);
 		ehea_parse_eqe(adapter, eqe->entry);
 		eqe = ehea_poll_eq(adapter->neq);
-		pr_debug("next eqe=%p\n", eqe);
+		ehea_debug("next eqe=%p", eqe);
 	}
 
 	event_mask = EHEA_BMASK_SET(NELR_PORTSTATE_CHG, 1)
@@ -1345,14 +1344,14 @@
 				  ehea_qp_aff_irq_handler,
 				  IRQF_DISABLED, port->int_aff_name, port);
 	if (ret) {
-		netdev_err(dev, "failed registering irq for qp_aff_irq_handler:ist=%X\n",
-			   port->qp_eq->attr.ist1);
+		ehea_error("failed registering irq for qp_aff_irq_handler:"
+			   "ist=%X", port->qp_eq->attr.ist1);
 		goto out_free_qpeq;
 	}
 
-	netif_info(port, ifup, dev,
-		   "irq_handle 0x%X for function qp_aff_irq_handler registered\n",
-		   port->qp_eq->attr.ist1);
+	if (netif_msg_ifup(port))
+		ehea_info("irq_handle 0x%X for function qp_aff_irq_handler "
+			  "registered", port->qp_eq->attr.ist1);
 
 
 	for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) {
@@ -1364,13 +1363,14 @@
 					  IRQF_DISABLED, pr->int_send_name,
 					  pr);
 		if (ret) {
-			netdev_err(dev, "failed registering irq for ehea_queue port_res_nr:%d, ist=%X\n",
-				   i, pr->eq->attr.ist1);
+			ehea_error("failed registering irq for ehea_queue "
+				   "port_res_nr:%d, ist=%X", i,
+				   pr->eq->attr.ist1);
 			goto out_free_req;
 		}
-		netif_info(port, ifup, dev,
-			   "irq_handle 0x%X for function ehea_queue_int %d registered\n",
-			   pr->eq->attr.ist1, i);
+		if (netif_msg_ifup(port))
+			ehea_info("irq_handle 0x%X for function ehea_queue_int "
+				  "%d registered", pr->eq->attr.ist1, i);
 	}
 out:
 	return ret;
@@ -1401,16 +1401,16 @@
 	for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) {
 		pr = &port->port_res[i];
 		ibmebus_free_irq(pr->eq->attr.ist1, pr);
-		netif_info(port, intr, dev,
-			   "free send irq for res %d with handle 0x%X\n",
-			   i, pr->eq->attr.ist1);
+		if (netif_msg_intr(port))
+			ehea_info("free send irq for res %d with handle 0x%X",
+				  i, pr->eq->attr.ist1);
 	}
 
 	/* associated events */
 	ibmebus_free_irq(port->qp_eq->attr.ist1, port);
-	netif_info(port, intr, dev,
-		   "associated event interrupt for handle 0x%X freed\n",
-		   port->qp_eq->attr.ist1);
+	if (netif_msg_intr(port))
+		ehea_info("associated event interrupt for handle 0x%X freed",
+			  port->qp_eq->attr.ist1);
 }
 
 static int ehea_configure_port(struct ehea_port *port)
@@ -1479,7 +1479,7 @@
 out_free:
 	ehea_rem_mr(&pr->send_mr);
 out:
-	pr_err("Generating SMRS failed\n");
+	ehea_error("Generating SMRS failed\n");
 	return -EIO;
 }
 
@@ -1534,7 +1534,7 @@
 
 	pr->eq = ehea_create_eq(adapter, eq_type, EHEA_MAX_ENTRIES_EQ, 0);
 	if (!pr->eq) {
-		pr_err("create_eq failed (eq)\n");
+		ehea_error("create_eq failed (eq)");
 		goto out_free;
 	}
 
@@ -1542,7 +1542,7 @@
 				     pr->eq->fw_handle,
 				     port->logical_port_id);
 	if (!pr->recv_cq) {
-		pr_err("create_cq failed (cq_recv)\n");
+		ehea_error("create_cq failed (cq_recv)");
 		goto out_free;
 	}
 
@@ -1550,19 +1550,19 @@
 				     pr->eq->fw_handle,
 				     port->logical_port_id);
 	if (!pr->send_cq) {
-		pr_err("create_cq failed (cq_send)\n");
+		ehea_error("create_cq failed (cq_send)");
 		goto out_free;
 	}
 
 	if (netif_msg_ifup(port))
-		pr_info("Send CQ: act_nr_cqes=%d, Recv CQ: act_nr_cqes=%d\n",
-			pr->send_cq->attr.act_nr_of_cqes,
-			pr->recv_cq->attr.act_nr_of_cqes);
+		ehea_info("Send CQ: act_nr_cqes=%d, Recv CQ: act_nr_cqes=%d",
+			  pr->send_cq->attr.act_nr_of_cqes,
+			  pr->recv_cq->attr.act_nr_of_cqes);
 
 	init_attr = kzalloc(sizeof(*init_attr), GFP_KERNEL);
 	if (!init_attr) {
 		ret = -ENOMEM;
-		pr_err("no mem for ehea_qp_init_attr\n");
+		ehea_error("no mem for ehea_qp_init_attr");
 		goto out_free;
 	}
 
@@ -1587,18 +1587,18 @@
 
 	pr->qp = ehea_create_qp(adapter, adapter->pd, init_attr);
 	if (!pr->qp) {
-		pr_err("create_qp failed\n");
+		ehea_error("create_qp failed");
 		ret = -EIO;
 		goto out_free;
 	}
 
 	if (netif_msg_ifup(port))
-		pr_info("QP: qp_nr=%d\n act_nr_snd_wqe=%d\n nr_rwqe_rq1=%d\n nr_rwqe_rq2=%d\n nr_rwqe_rq3=%d\n",
-			init_attr->qp_nr,
-			init_attr->act_nr_send_wqes,
-			init_attr->act_nr_rwqes_rq1,
-			init_attr->act_nr_rwqes_rq2,
-			init_attr->act_nr_rwqes_rq3);
+		ehea_info("QP: qp_nr=%d\n act_nr_snd_wqe=%d\n nr_rwqe_rq1=%d\n "
+			  "nr_rwqe_rq2=%d\n nr_rwqe_rq3=%d", init_attr->qp_nr,
+			  init_attr->act_nr_send_wqes,
+			  init_attr->act_nr_rwqes_rq1,
+			  init_attr->act_nr_rwqes_rq2,
+			  init_attr->act_nr_rwqes_rq3);
 
 	pr->sq_skba_size = init_attr->act_nr_send_wqes + 1;
 
@@ -1749,7 +1749,7 @@
 			swqe->descriptors++;
 		}
 	} else
-		pr_err("cannot handle fragmented headers\n");
+		ehea_error("cannot handle fragmented headers");
 }
 
 static void write_swqe2_nonTSO(struct sk_buff *skb,
@@ -1845,8 +1845,8 @@
 				     port->logical_port_id,
 				     reg_type, port->mac_addr, 0, hcallid);
 	if (hret != H_SUCCESS) {
-		pr_err("%sregistering bc address failed (tagged)\n",
-		       hcallid == H_REG_BCMC ? "" : "de");
+		ehea_error("%sregistering bc address failed (tagged)",
+			   hcallid == H_REG_BCMC ? "" : "de");
 		ret = -EIO;
 		goto out_herr;
 	}
@@ -1857,8 +1857,8 @@
 				     port->logical_port_id,
 				     reg_type, port->mac_addr, 0, hcallid);
 	if (hret != H_SUCCESS) {
-		pr_err("%sregistering bc address failed (vlan)\n",
-		       hcallid == H_REG_BCMC ? "" : "de");
+		ehea_error("%sregistering bc address failed (vlan)",
+			   hcallid == H_REG_BCMC ? "" : "de");
 		ret = -EIO;
 	}
 out_herr:
@@ -1880,7 +1880,7 @@
 
 	cb0 = (void *)get_zeroed_page(GFP_KERNEL);
 	if (!cb0) {
-		pr_err("no mem for cb0\n");
+		ehea_error("no mem for cb0");
 		ret = -ENOMEM;
 		goto out;
 	}
@@ -1928,11 +1928,11 @@
 static void ehea_promiscuous_error(u64 hret, int enable)
 {
 	if (hret == H_AUTHORITY)
-		pr_info("Hypervisor denied %sabling promiscuous mode\n",
-			enable == 1 ? "en" : "dis");
+		ehea_info("Hypervisor denied %sabling promiscuous mode",
+			  enable == 1 ? "en" : "dis");
 	else
-		pr_err("failed %sabling promiscuous mode\n",
-		       enable == 1 ? "en" : "dis");
+		ehea_error("failed %sabling promiscuous mode",
+			   enable == 1 ? "en" : "dis");
 }
 
 static void ehea_promiscuous(struct net_device *dev, int enable)
@@ -1946,7 +1946,7 @@
 
 	cb7 = (void *)get_zeroed_page(GFP_ATOMIC);
 	if (!cb7) {
-		pr_err("no mem for cb7\n");
+		ehea_error("no mem for cb7");
 		goto out;
 	}
 
@@ -2006,7 +2006,7 @@
 		hret = ehea_multicast_reg_helper(port, mc_entry->macaddr,
 						 H_DEREG_BCMC);
 		if (hret) {
-			pr_err("failed deregistering mcast MAC\n");
+			ehea_error("failed deregistering mcast MAC");
 			ret = -EIO;
 		}
 
@@ -2029,8 +2029,7 @@
 			if (!hret)
 				port->allmulti = 1;
 			else
-				netdev_err(dev,
-					   "failed enabling IFF_ALLMULTI\n");
+				ehea_error("failed enabling IFF_ALLMULTI");
 		}
 	} else
 		if (!enable) {
@@ -2039,8 +2038,7 @@
 			if (!hret)
 				port->allmulti = 0;
 			else
-				netdev_err(dev,
-					   "failed disabling IFF_ALLMULTI\n");
+				ehea_error("failed disabling IFF_ALLMULTI");
 		}
 }
 
@@ -2051,7 +2049,7 @@
 
 	ehea_mcl_entry = kzalloc(sizeof(*ehea_mcl_entry), GFP_ATOMIC);
 	if (!ehea_mcl_entry) {
-		pr_err("no mem for mcl_entry\n");
+		ehea_error("no mem for mcl_entry");
 		return;
 	}
 
@@ -2064,7 +2062,7 @@
 	if (!hret)
 		list_add(&ehea_mcl_entry->list, &port->mc_list->list);
 	else {
-		pr_err("failed registering mcast MAC\n");
+		ehea_error("failed registering mcast MAC");
 		kfree(ehea_mcl_entry);
 	}
 }
@@ -2097,8 +2095,9 @@
 		}
 
 		if (netdev_mc_count(dev) > port->adapter->max_mc_mac) {
-			pr_info("Mcast registration limit reached (0x%llx). Use ALLMULTI!\n",
-				port->adapter->max_mc_mac);
+			ehea_info("Mcast registration limit reached (0x%llx). "
+				  "Use ALLMULTI!",
+				  port->adapter->max_mc_mac);
 			goto out;
 		}
 
@@ -2304,10 +2303,10 @@
 	}
 	pr->swqe_id_counter += 1;
 
-	netif_info(port, tx_queued, dev,
-		   "post swqe on QP %d\n", pr->qp->init_attr.qp_nr);
-	if (netif_msg_tx_queued(port))
+	if (netif_msg_tx_queued(port)) {
+		ehea_info("post swqe on QP %d", pr->qp->init_attr.qp_nr);
 		ehea_dump(swqe, 512, "swqe");
+	}
 
 	if (unlikely(test_bit(__EHEA_STOP_XFER, &ehea_driver_flags))) {
 		netif_stop_queue(dev);
@@ -2343,14 +2342,14 @@
 
 	cb1 = (void *)get_zeroed_page(GFP_KERNEL);
 	if (!cb1) {
-		pr_err("no mem for cb1\n");
+		ehea_error("no mem for cb1");
 		goto out;
 	}
 
 	hret = ehea_h_modify_ehea_port(adapter->handle, port->logical_port_id,
 				       H_PORT_CB1, H_PORT_CB1_ALL, cb1);
 	if (hret != H_SUCCESS)
-		pr_err("modify_ehea_port failed\n");
+		ehea_error("modify_ehea_port failed");
 
 	free_page((unsigned long)cb1);
 out:
@@ -2367,14 +2366,14 @@
 
 	cb1 = (void *)get_zeroed_page(GFP_KERNEL);
 	if (!cb1) {
-		pr_err("no mem for cb1\n");
+		ehea_error("no mem for cb1");
 		goto out;
 	}
 
 	hret = ehea_h_query_ehea_port(adapter->handle, port->logical_port_id,
 				      H_PORT_CB1, H_PORT_CB1_ALL, cb1);
 	if (hret != H_SUCCESS) {
-		pr_err("query_ehea_port failed\n");
+		ehea_error("query_ehea_port failed");
 		goto out;
 	}
 
@@ -2384,7 +2383,7 @@
 	hret = ehea_h_modify_ehea_port(adapter->handle, port->logical_port_id,
 				       H_PORT_CB1, H_PORT_CB1_ALL, cb1);
 	if (hret != H_SUCCESS)
-		pr_err("modify_ehea_port failed\n");
+		ehea_error("modify_ehea_port failed");
 out:
 	free_page((unsigned long)cb1);
 	return;
@@ -2402,14 +2401,14 @@
 
 	cb1 = (void *)get_zeroed_page(GFP_KERNEL);
 	if (!cb1) {
-		pr_err("no mem for cb1\n");
+		ehea_error("no mem for cb1");
 		goto out;
 	}
 
 	hret = ehea_h_query_ehea_port(adapter->handle, port->logical_port_id,
 				      H_PORT_CB1, H_PORT_CB1_ALL, cb1);
 	if (hret != H_SUCCESS) {
-		pr_err("query_ehea_port failed\n");
+		ehea_error("query_ehea_port failed");
 		goto out;
 	}
 
@@ -2419,7 +2418,7 @@
 	hret = ehea_h_modify_ehea_port(adapter->handle, port->logical_port_id,
 				       H_PORT_CB1, H_PORT_CB1_ALL, cb1);
 	if (hret != H_SUCCESS)
-		pr_err("modify_ehea_port failed\n");
+		ehea_error("modify_ehea_port failed");
 out:
 	free_page((unsigned long)cb1);
 }
@@ -2441,7 +2440,7 @@
 	hret = ehea_h_query_ehea_qp(adapter->handle, 0, qp->fw_handle,
 				    EHEA_BMASK_SET(H_QPCB0_ALL, 0xFFFF), cb0);
 	if (hret != H_SUCCESS) {
-		pr_err("query_ehea_qp failed (1)\n");
+		ehea_error("query_ehea_qp failed (1)");
 		goto out;
 	}
 
@@ -2450,14 +2449,14 @@
 				     EHEA_BMASK_SET(H_QPCB0_QP_CTL_REG, 1), cb0,
 				     &dummy64, &dummy64, &dummy16, &dummy16);
 	if (hret != H_SUCCESS) {
-		pr_err("modify_ehea_qp failed (1)\n");
+		ehea_error("modify_ehea_qp failed (1)");
 		goto out;
 	}
 
 	hret = ehea_h_query_ehea_qp(adapter->handle, 0, qp->fw_handle,
 				    EHEA_BMASK_SET(H_QPCB0_ALL, 0xFFFF), cb0);
 	if (hret != H_SUCCESS) {
-		pr_err("query_ehea_qp failed (2)\n");
+		ehea_error("query_ehea_qp failed (2)");
 		goto out;
 	}
 
@@ -2466,14 +2465,14 @@
 				     EHEA_BMASK_SET(H_QPCB0_QP_CTL_REG, 1), cb0,
 				     &dummy64, &dummy64, &dummy16, &dummy16);
 	if (hret != H_SUCCESS) {
-		pr_err("modify_ehea_qp failed (2)\n");
+		ehea_error("modify_ehea_qp failed (2)");
 		goto out;
 	}
 
 	hret = ehea_h_query_ehea_qp(adapter->handle, 0, qp->fw_handle,
 				    EHEA_BMASK_SET(H_QPCB0_ALL, 0xFFFF), cb0);
 	if (hret != H_SUCCESS) {
-		pr_err("query_ehea_qp failed (3)\n");
+		ehea_error("query_ehea_qp failed (3)");
 		goto out;
 	}
 
@@ -2482,14 +2481,14 @@
 				     EHEA_BMASK_SET(H_QPCB0_QP_CTL_REG, 1), cb0,
 				     &dummy64, &dummy64, &dummy16, &dummy16);
 	if (hret != H_SUCCESS) {
-		pr_err("modify_ehea_qp failed (3)\n");
+		ehea_error("modify_ehea_qp failed (3)");
 		goto out;
 	}
 
 	hret = ehea_h_query_ehea_qp(adapter->handle, 0, qp->fw_handle,
 				    EHEA_BMASK_SET(H_QPCB0_ALL, 0xFFFF), cb0);
 	if (hret != H_SUCCESS) {
-		pr_err("query_ehea_qp failed (4)\n");
+		ehea_error("query_ehea_qp failed (4)");
 		goto out;
 	}
 
@@ -2510,7 +2509,7 @@
 				   EHEA_MAX_ENTRIES_EQ, 1);
 	if (!port->qp_eq) {
 		ret = -EINVAL;
-		pr_err("ehea_create_eq failed (qp_eq)\n");
+		ehea_error("ehea_create_eq failed (qp_eq)");
 		goto out_kill_eq;
 	}
 
@@ -2591,27 +2590,27 @@
 	ret = ehea_port_res_setup(port, port->num_def_qps,
 				  port->num_add_tx_qps);
 	if (ret) {
-		netdev_err(dev, "port_res_failed\n");
+		ehea_error("port_res_failed");
 		goto out;
 	}
 
 	/* Set default QP for this port */
 	ret = ehea_configure_port(port);
 	if (ret) {
-		netdev_err(dev, "ehea_configure_port failed. ret:%d\n", ret);
+		ehea_error("ehea_configure_port failed. ret:%d", ret);
 		goto out_clean_pr;
 	}
 
 	ret = ehea_reg_interrupts(dev);
 	if (ret) {
-		netdev_err(dev, "reg_interrupts failed. ret:%d\n", ret);
+		ehea_error("reg_interrupts failed. ret:%d", ret);
 		goto out_clean_pr;
 	}
 
 	for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) {
 		ret = ehea_activate_qp(port->adapter, port->port_res[i].qp);
 		if (ret) {
-			netdev_err(dev, "activate_qp failed\n");
+			ehea_error("activate_qp failed");
 			goto out_free_irqs;
 		}
 	}
@@ -2619,7 +2618,7 @@
 	for (i = 0; i < port->num_def_qps; i++) {
 		ret = ehea_fill_port_res(&port->port_res[i]);
 		if (ret) {
-			netdev_err(dev, "out_free_irqs\n");
+			ehea_error("out_free_irqs");
 			goto out_free_irqs;
 		}
 	}
@@ -2642,7 +2641,7 @@
 	ehea_clean_all_portres(port);
 out:
 	if (ret)
-		netdev_info(dev, "Failed starting. ret=%i\n", ret);
+		ehea_info("Failed starting %s. ret=%i", dev->name, ret);
 
 	ehea_update_bcmc_registrations();
 	ehea_update_firmware_handles();
@@ -2673,7 +2672,8 @@
 
 	mutex_lock(&port->port_lock);
 
-	netif_info(port, ifup, dev, "enabling port\n");
+	if (netif_msg_ifup(port))
+		ehea_info("enabling port %s", dev->name);
 
 	ret = ehea_up(dev);
 	if (!ret) {
@@ -2708,7 +2708,8 @@
 
 	ret = ehea_clean_all_portres(port);
 	if (ret)
-		netdev_info(dev, "Failed freeing resources. ret=%i\n", ret);
+		ehea_info("Failed freeing resources for %s. ret=%i",
+			  dev->name, ret);
 
 	ehea_update_firmware_handles();
 
@@ -2720,7 +2721,8 @@
 	int ret;
 	struct ehea_port *port = netdev_priv(dev);
 
-	netif_info(port, ifdown, dev, "disabling port\n");
+	if (netif_msg_ifdown(port))
+		ehea_info("disabling port %s", dev->name);
 
 	set_bit(__EHEA_DISABLE_PORT_RESET, &port->flags);
 	cancel_work_sync(&port->reset_task);
@@ -2761,7 +2763,7 @@
 			 msecs_to_jiffies(100));
 
 		if (!ret) {
-			pr_err("WARNING: sq not flushed completely\n");
+			ehea_error("WARNING: sq not flushed completely");
 			break;
 		}
 	}
@@ -2797,7 +2799,7 @@
 					    EHEA_BMASK_SET(H_QPCB0_ALL, 0xFFFF),
 					    cb0);
 		if (hret != H_SUCCESS) {
-			pr_err("query_ehea_qp failed (1)\n");
+			ehea_error("query_ehea_qp failed (1)");
 			goto out;
 		}
 
@@ -2809,7 +2811,7 @@
 							    1), cb0, &dummy64,
 					     &dummy64, &dummy16, &dummy16);
 		if (hret != H_SUCCESS) {
-			pr_err("modify_ehea_qp failed (1)\n");
+			ehea_error("modify_ehea_qp failed (1)");
 			goto out;
 		}
 
@@ -2817,14 +2819,14 @@
 					    EHEA_BMASK_SET(H_QPCB0_ALL, 0xFFFF),
 					    cb0);
 		if (hret != H_SUCCESS) {
-			pr_err("query_ehea_qp failed (2)\n");
+			ehea_error("query_ehea_qp failed (2)");
 			goto out;
 		}
 
 		/* deregister shared memory regions */
 		dret = ehea_rem_smrs(pr);
 		if (dret) {
-			pr_err("unreg shared memory region failed\n");
+			ehea_error("unreg shared memory region failed");
 			goto out;
 		}
 	}
@@ -2893,7 +2895,7 @@
 
 		ret = ehea_gen_smrs(pr);
 		if (ret) {
-			netdev_err(dev, "creation of shared memory regions failed\n");
+			ehea_error("creation of shared memory regions failed");
 			goto out;
 		}
 
@@ -2904,7 +2906,7 @@
 					    EHEA_BMASK_SET(H_QPCB0_ALL, 0xFFFF),
 					    cb0);
 		if (hret != H_SUCCESS) {
-			netdev_err(dev, "query_ehea_qp failed (1)\n");
+			ehea_error("query_ehea_qp failed (1)");
 			goto out;
 		}
 
@@ -2916,7 +2918,7 @@
 							    1), cb0, &dummy64,
 					     &dummy64, &dummy16, &dummy16);
 		if (hret != H_SUCCESS) {
-			netdev_err(dev, "modify_ehea_qp failed (1)\n");
+			ehea_error("modify_ehea_qp failed (1)");
 			goto out;
 		}
 
@@ -2924,7 +2926,7 @@
 					    EHEA_BMASK_SET(H_QPCB0_ALL, 0xFFFF),
 					    cb0);
 		if (hret != H_SUCCESS) {
-			netdev_err(dev, "query_ehea_qp failed (2)\n");
+			ehea_error("query_ehea_qp failed (2)");
 			goto out;
 		}
 
@@ -2961,7 +2963,8 @@
 
 	ehea_set_multicast_list(dev);
 
-	netif_info(port, timer, dev, "reset successful\n");
+	if (netif_msg_timer(port))
+		ehea_info("Device %s resetted successfully", dev->name);
 
 	port_napi_enable(port);
 
@@ -2976,7 +2979,7 @@
 	int ret, i;
 	struct ehea_adapter *adapter;
 
-	pr_info("LPAR memory changed - re-initializing driver\n");
+	ehea_info("LPAR memory changed - re-initializing driver");
 
 	list_for_each_entry(adapter, &adapter_list, list)
 		if (adapter->active_ports) {
@@ -3008,7 +3011,8 @@
 			/* Unregister old memory region */
 			ret = ehea_rem_mr(&adapter->mr);
 			if (ret) {
-				pr_err("unregister MR failed - driver inoperable!\n");
+				ehea_error("unregister MR failed - driver"
+					   " inoperable!");
 				goto out;
 			}
 		}
@@ -3020,7 +3024,8 @@
 			/* Register new memory region */
 			ret = ehea_reg_kernel_mr(adapter, &adapter->mr);
 			if (ret) {
-				pr_err("register MR failed - driver inoperable!\n");
+				ehea_error("register MR failed - driver"
+					   " inoperable!");
 				goto out;
 			}
 
@@ -3043,7 +3048,7 @@
 				}
 			}
 		}
-	pr_info("re-initializing driver complete\n");
+	ehea_info("re-initializing driver complete");
 out:
 	return;
 }
@@ -3096,7 +3101,7 @@
 	/* (Try to) enable *jumbo frames */
 	cb4 = (void *)get_zeroed_page(GFP_KERNEL);
 	if (!cb4) {
-		pr_err("no mem for cb4\n");
+		ehea_error("no mem for cb4");
 		ret = -ENOMEM;
 		goto out;
 	} else {
@@ -3158,13 +3163,13 @@
 
 	ret = of_device_register(&port->ofdev);
 	if (ret) {
-		pr_err("failed to register device. ret=%d\n", ret);
+		ehea_error("failed to register device. ret=%d", ret);
 		goto out;
 	}
 
 	ret = device_create_file(&port->ofdev.dev, &dev_attr_log_port_id);
 	if (ret) {
-		pr_err("failed to register attributes, ret=%d\n", ret);
+		ehea_error("failed to register attributes, ret=%d", ret);
 		goto out_unreg_of_dev;
 	}
 
@@ -3214,7 +3219,7 @@
 	dev = alloc_etherdev(sizeof(struct ehea_port));
 
 	if (!dev) {
-		pr_err("no mem for net_device\n");
+		ehea_error("no mem for net_device");
 		ret = -ENOMEM;
 		goto out_err;
 	}
@@ -3265,7 +3270,7 @@
 
 	ret = register_netdev(dev);
 	if (ret) {
-		pr_err("register_netdev failed. ret=%d\n", ret);
+		ehea_error("register_netdev failed. ret=%d", ret);
 		goto out_unreg_port;
 	}
 
@@ -3273,10 +3278,11 @@
 
 	ret = ehea_get_jumboframe_status(port, &jumbo);
 	if (ret)
-		netdev_err(dev, "failed determining jumbo frame status\n");
+		ehea_error("failed determining jumbo frame status for %s",
+			   port->netdev->name);
 
-	netdev_info(dev, "Jumbo frames are %sabled\n",
-		    jumbo == 1 ? "en" : "dis");
+	ehea_info("%s: Jumbo frames are %sabled", dev->name,
+		  jumbo == 1 ? "en" : "dis");
 
 	adapter->active_ports++;
 
@@ -3292,8 +3298,8 @@
 	free_netdev(dev);
 
 out_err:
-	pr_err("setting up logical port with id=%d failed, ret=%d\n",
-	       logical_port_id, ret);
+	ehea_error("setting up logical port with id=%d failed, ret=%d",
+		   logical_port_id, ret);
 	return NULL;
 }
 
@@ -3321,13 +3327,13 @@
 		dn_log_port_id = of_get_property(eth_dn, "ibm,hea-port-no",
 						 NULL);
 		if (!dn_log_port_id) {
-			pr_err("bad device node: eth_dn name=%s\n",
-			       eth_dn->full_name);
+			ehea_error("bad device node: eth_dn name=%s",
+				   eth_dn->full_name);
 			continue;
 		}
 
 		if (ehea_add_adapter_mr(adapter)) {
-			pr_err("creating MR failed\n");
+			ehea_error("creating MR failed");
 			of_node_put(eth_dn);
 			return -EIO;
 		}
@@ -3336,8 +3342,9 @@
 							  *dn_log_port_id,
 							  eth_dn);
 		if (adapter->port[i])
-			netdev_info(adapter->port[i]->netdev,
-				    "logical port id #%d\n", *dn_log_port_id);
+			ehea_info("%s -> logical port id #%d",
+				  adapter->port[i]->netdev->name,
+				  *dn_log_port_id);
 		else
 			ehea_remove_adapter_mr(adapter);
 
@@ -3382,20 +3389,21 @@
 	port = ehea_get_port(adapter, logical_port_id);
 
 	if (port) {
-		netdev_info(port->netdev, "adding port with logical port id=%d failed: port already configured\n",
-			    logical_port_id);
+		ehea_info("adding port with logical port id=%d failed. port "
+			  "already configured as %s.", logical_port_id,
+			  port->netdev->name);
 		return -EINVAL;
 	}
 
 	eth_dn = ehea_get_eth_dn(adapter, logical_port_id);
 
 	if (!eth_dn) {
-		pr_info("no logical port with id %d found\n", logical_port_id);
+		ehea_info("no logical port with id %d found", logical_port_id);
 		return -EINVAL;
 	}
 
 	if (ehea_add_adapter_mr(adapter)) {
-		pr_err("creating MR failed\n");
+		ehea_error("creating MR failed");
 		return -EIO;
 	}
 
@@ -3410,8 +3418,8 @@
 				break;
 			}
 
-		netdev_info(port->netdev, "added: (logical port id=%d)\n",
-			    logical_port_id);
+		ehea_info("added %s (logical port id=%d)", port->netdev->name,
+			  logical_port_id);
 	} else {
 		ehea_remove_adapter_mr(adapter);
 		return -EIO;
@@ -3434,8 +3442,8 @@
 	port = ehea_get_port(adapter, logical_port_id);
 
 	if (port) {
-		netdev_info(port->netdev, "removed: (logical port id=%d)\n",
-			    logical_port_id);
+		ehea_info("removed %s (logical port id=%d)", port->netdev->name,
+			  logical_port_id);
 
 		ehea_shutdown_single_port(port);
 
@@ -3445,8 +3453,8 @@
 				break;
 			}
 	} else {
-		pr_err("removing port with logical port id=%d failed. port not configured.\n",
-		       logical_port_id);
+		ehea_error("removing port with logical port id=%d failed. port "
+			   "not configured.", logical_port_id);
 		return -EINVAL;
 	}
 
@@ -3483,7 +3491,7 @@
 	int ret;
 
 	if (!dev || !dev->dev.of_node) {
-		pr_err("Invalid ibmebus device probed\n");
+		ehea_error("Invalid ibmebus device probed");
 		return -EINVAL;
 	}
 
@@ -3631,17 +3639,17 @@
 
 	switch (action) {
 	case MEM_CANCEL_OFFLINE:
-		pr_info("memory offlining canceled\n");
+		ehea_info("memory offlining canceled");
 		/* Readd canceled memory block */
 	case MEM_ONLINE:
-		pr_info("memory is going online\n");
+		ehea_info("memory is going online");
 		set_bit(__EHEA_STOP_XFER, &ehea_driver_flags);
 		if (ehea_add_sect_bmap(arg->start_pfn, arg->nr_pages))
 			goto out_unlock;
 		ehea_rereg_mrs(NULL);
 		break;
 	case MEM_GOING_OFFLINE:
-		pr_info("memory is going offline\n");
+		ehea_info("memory is going offline");
 		set_bit(__EHEA_STOP_XFER, &ehea_driver_flags);
 		if (ehea_rem_sect_bmap(arg->start_pfn, arg->nr_pages))
 			goto out_unlock;
@@ -3667,7 +3675,7 @@
 				unsigned long action, void *unused)
 {
 	if (action == SYS_RESTART) {
-		pr_info("Reboot: freeing all eHEA resources\n");
+		ehea_info("Reboot: freeing all eHEA resources");
 		ibmebus_unregister_driver(&ehea_driver);
 	}
 	return NOTIFY_DONE;
@@ -3683,22 +3691,22 @@
 
 	if ((rq1_entries < EHEA_MIN_ENTRIES_QP) ||
 	    (rq1_entries > EHEA_MAX_ENTRIES_RQ1)) {
-		pr_info("Bad parameter: rq1_entries\n");
+		ehea_info("Bad parameter: rq1_entries");
 		ret = -EINVAL;
 	}
 	if ((rq2_entries < EHEA_MIN_ENTRIES_QP) ||
 	    (rq2_entries > EHEA_MAX_ENTRIES_RQ2)) {
-		pr_info("Bad parameter: rq2_entries\n");
+		ehea_info("Bad parameter: rq2_entries");
 		ret = -EINVAL;
 	}
 	if ((rq3_entries < EHEA_MIN_ENTRIES_QP) ||
 	    (rq3_entries > EHEA_MAX_ENTRIES_RQ3)) {
-		pr_info("Bad parameter: rq3_entries\n");
+		ehea_info("Bad parameter: rq3_entries");
 		ret = -EINVAL;
 	}
 	if ((sq_entries < EHEA_MIN_ENTRIES_QP) ||
 	    (sq_entries > EHEA_MAX_ENTRIES_SQ)) {
-		pr_info("Bad parameter: sq_entries\n");
+		ehea_info("Bad parameter: sq_entries");
 		ret = -EINVAL;
 	}
 
@@ -3718,7 +3726,8 @@
 {
 	int ret;
 
-	pr_info("IBM eHEA ethernet device driver (Release %s)\n", DRV_VERSION);
+	printk(KERN_INFO "IBM eHEA ethernet device driver (Release %s)\n",
+	       DRV_VERSION);
 
 
 	INIT_WORK(&ehea_rereg_mr_task, ehea_rereg_mrs);
@@ -3738,27 +3747,27 @@
 
 	ret = register_reboot_notifier(&ehea_reboot_nb);
 	if (ret)
-		pr_info("failed registering reboot notifier\n");
+		ehea_info("failed registering reboot notifier");
 
 	ret = register_memory_notifier(&ehea_mem_nb);
 	if (ret)
-		pr_info("failed registering memory remove notifier\n");
+		ehea_info("failed registering memory remove notifier");
 
 	ret = crash_shutdown_register(ehea_crash_handler);
 	if (ret)
-		pr_info("failed registering crash handler\n");
+		ehea_info("failed registering crash handler");
 
 	ret = ibmebus_register_driver(&ehea_driver);
 	if (ret) {
-		pr_err("failed registering eHEA device driver on ebus\n");
+		ehea_error("failed registering eHEA device driver on ebus");
 		goto out2;
 	}
 
 	ret = driver_create_file(&ehea_driver.driver,
 				 &driver_attr_capabilities);
 	if (ret) {
-		pr_err("failed to register capabilities attribute, ret=%d\n",
-		       ret);
+		ehea_error("failed to register capabilities attribute, ret=%d",
+			   ret);
 		goto out3;
 	}
 
@@ -3784,7 +3793,7 @@
 	unregister_reboot_notifier(&ehea_reboot_nb);
 	ret = crash_shutdown_unregister(ehea_crash_handler);
 	if (ret)
-		pr_info("failed unregistering crash handler\n");
+		ehea_info("failed unregistering crash handler");
 	unregister_memory_notifier(&ehea_mem_nb);
 	kfree(ehea_fw_handles.arr);
 	kfree(ehea_bcmc_regs.arr);
diff --git a/drivers/net/ehea/ehea_phyp.c b/drivers/net/ehea/ehea_phyp.c
index 0506967..8fe9dca 100644
--- a/drivers/net/ehea/ehea_phyp.c
+++ b/drivers/net/ehea/ehea_phyp.c
@@ -26,8 +26,6 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-
 #include "ehea_phyp.h"
 
 
@@ -69,11 +67,12 @@
 		}
 
 		if (ret < H_SUCCESS)
-			pr_err("opcode=%lx ret=%lx"
-			       " arg1=%lx arg2=%lx arg3=%lx arg4=%lx"
-			       " arg5=%lx arg6=%lx arg7=%lx\n",
-			       opcode, ret,
-			       arg1, arg2, arg3, arg4, arg5, arg6, arg7);
+			ehea_error("opcode=%lx ret=%lx"
+				   " arg1=%lx arg2=%lx arg3=%lx arg4=%lx"
+				   " arg5=%lx arg6=%lx arg7=%lx ",
+				   opcode, ret,
+				   arg1, arg2, arg3, arg4, arg5,
+				   arg6, arg7);
 
 		return ret;
 	}
@@ -115,18 +114,19 @@
 		    && (((cb_cat == H_PORT_CB4) && ((arg3 == H_PORT_CB4_JUMBO)
 		    || (arg3 == H_PORT_CB4_SPEED))) || ((cb_cat == H_PORT_CB7)
 		    && (arg3 == H_PORT_CB7_DUCQPN)))))
-			pr_err("opcode=%lx ret=%lx"
-			       " arg1=%lx arg2=%lx arg3=%lx arg4=%lx"
-			       " arg5=%lx arg6=%lx arg7=%lx arg8=%lx"
-			       " arg9=%lx"
-			       " out1=%lx out2=%lx out3=%lx out4=%lx"
-			       " out5=%lx out6=%lx out7=%lx out8=%lx"
-			       " out9=%lx\n",
-			       opcode, ret,
-			       arg1, arg2, arg3, arg4, arg5,
-			       arg6, arg7, arg8, arg9,
-			       outs[0], outs[1], outs[2], outs[3], outs[4],
-			       outs[5], outs[6], outs[7], outs[8]);
+			ehea_error("opcode=%lx ret=%lx"
+				   " arg1=%lx arg2=%lx arg3=%lx arg4=%lx"
+				   " arg5=%lx arg6=%lx arg7=%lx arg8=%lx"
+				   " arg9=%lx"
+				   " out1=%lx out2=%lx out3=%lx out4=%lx"
+				   " out5=%lx out6=%lx out7=%lx out8=%lx"
+				   " out9=%lx",
+				   opcode, ret,
+				   arg1, arg2, arg3, arg4, arg5,
+				   arg6, arg7, arg8, arg9,
+				   outs[0], outs[1], outs[2], outs[3],
+				   outs[4], outs[5], outs[6], outs[7],
+				   outs[8]);
 		return ret;
 	}
 
@@ -515,7 +515,7 @@
 			     const u64 log_pageaddr, const u64 count)
 {
 	if ((count > 1) && (log_pageaddr & ~PAGE_MASK)) {
-		pr_err("not on pageboundary\n");
+		ehea_error("not on pageboundary");
 		return H_PARAMETER;
 	}
 
diff --git a/drivers/net/ehea/ehea_qmr.c b/drivers/net/ehea/ehea_qmr.c
index cd44bb8..89128b63 100644
--- a/drivers/net/ehea/ehea_qmr.c
+++ b/drivers/net/ehea/ehea_qmr.c
@@ -26,8 +26,6 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-
 #include <linux/mm.h>
 #include <linux/slab.h>
 #include "ehea.h"
@@ -47,7 +45,7 @@
 		queue->current_q_offset -= queue->pagesize;
 		retvalue = NULL;
 	} else if (((u64) retvalue) & (EHEA_PAGESIZE-1)) {
-		pr_err("not on pageboundary\n");
+		ehea_error("not on pageboundary");
 		retvalue = NULL;
 	}
 	return retvalue;
@@ -60,15 +58,15 @@
 	int i, k;
 
 	if ((pagesize > PAGE_SIZE) || (!pages_per_kpage)) {
-		pr_err("pagesize conflict! kernel pagesize=%d, ehea pagesize=%d\n",
-		       (int)PAGE_SIZE, (int)pagesize);
+		ehea_error("pagesize conflict! kernel pagesize=%d, "
+			   "ehea pagesize=%d", (int)PAGE_SIZE, (int)pagesize);
 		return -EINVAL;
 	}
 
 	queue->queue_length = nr_of_pages * pagesize;
 	queue->queue_pages = kmalloc(nr_of_pages * sizeof(void *), GFP_KERNEL);
 	if (!queue->queue_pages) {
-		pr_err("no mem for queue_pages\n");
+		ehea_error("no mem for queue_pages");
 		return -ENOMEM;
 	}
 
@@ -132,7 +130,7 @@
 
 	cq = kzalloc(sizeof(*cq), GFP_KERNEL);
 	if (!cq) {
-		pr_err("no mem for cq\n");
+		ehea_error("no mem for cq");
 		goto out_nomem;
 	}
 
@@ -149,7 +147,7 @@
 	hret = ehea_h_alloc_resource_cq(adapter->handle, &cq->attr,
 					&cq->fw_handle, &cq->epas);
 	if (hret != H_SUCCESS) {
-		pr_err("alloc_resource_cq failed\n");
+		ehea_error("alloc_resource_cq failed");
 		goto out_freemem;
 	}
 
@@ -161,7 +159,7 @@
 	for (counter = 0; counter < cq->attr.nr_pages; counter++) {
 		vpage = hw_qpageit_get_inc(&cq->hw_queue);
 		if (!vpage) {
-			pr_err("hw_qpageit_get_inc failed\n");
+			ehea_error("hw_qpageit_get_inc failed");
 			goto out_kill_hwq;
 		}
 
@@ -170,8 +168,9 @@
 					     0, EHEA_CQ_REGISTER_ORIG,
 					     cq->fw_handle, rpage, 1);
 		if (hret < H_SUCCESS) {
-			pr_err("register_rpage_cq failed ehea_cq=%p hret=%llx counter=%i act_pages=%i\n",
-			       cq, hret, counter, cq->attr.nr_pages);
+			ehea_error("register_rpage_cq failed ehea_cq=%p "
+				   "hret=%llx counter=%i act_pages=%i",
+				   cq, hret, counter, cq->attr.nr_pages);
 			goto out_kill_hwq;
 		}
 
@@ -179,14 +178,14 @@
 			vpage = hw_qpageit_get_inc(&cq->hw_queue);
 
 			if ((hret != H_SUCCESS) || (vpage)) {
-				pr_err("registration of pages not complete hret=%llx\n",
-				       hret);
+				ehea_error("registration of pages not "
+					   "complete hret=%llx\n", hret);
 				goto out_kill_hwq;
 			}
 		} else {
 			if (hret != H_PAGE_REGISTERED) {
-				pr_err("CQ: registration of page failed hret=%llx\n",
-				       hret);
+				ehea_error("CQ: registration of page failed "
+					   "hret=%llx\n", hret);
 				goto out_kill_hwq;
 			}
 		}
@@ -242,7 +241,7 @@
 	}
 
 	if (hret != H_SUCCESS) {
-		pr_err("destroy CQ failed\n");
+		ehea_error("destroy CQ failed");
 		return -EIO;
 	}
 
@@ -260,7 +259,7 @@
 
 	eq = kzalloc(sizeof(*eq), GFP_KERNEL);
 	if (!eq) {
-		pr_err("no mem for eq\n");
+		ehea_error("no mem for eq");
 		return NULL;
 	}
 
@@ -273,21 +272,21 @@
 	hret = ehea_h_alloc_resource_eq(adapter->handle,
 					&eq->attr, &eq->fw_handle);
 	if (hret != H_SUCCESS) {
-		pr_err("alloc_resource_eq failed\n");
+		ehea_error("alloc_resource_eq failed");
 		goto out_freemem;
 	}
 
 	ret = hw_queue_ctor(&eq->hw_queue, eq->attr.nr_pages,
 			    EHEA_PAGESIZE, sizeof(struct ehea_eqe));
 	if (ret) {
-		pr_err("can't allocate eq pages\n");
+		ehea_error("can't allocate eq pages");
 		goto out_freeres;
 	}
 
 	for (i = 0; i < eq->attr.nr_pages; i++) {
 		vpage = hw_qpageit_get_inc(&eq->hw_queue);
 		if (!vpage) {
-			pr_err("hw_qpageit_get_inc failed\n");
+			ehea_error("hw_qpageit_get_inc failed");
 			hret = H_RESOURCE;
 			goto out_kill_hwq;
 		}
@@ -371,7 +370,7 @@
 	}
 
 	if (hret != H_SUCCESS) {
-		pr_err("destroy EQ failed\n");
+		ehea_error("destroy EQ failed");
 		return -EIO;
 	}
 
@@ -396,7 +395,7 @@
 	for (cnt = 0; cnt < nr_pages; cnt++) {
 		vpage = hw_qpageit_get_inc(hw_queue);
 		if (!vpage) {
-			pr_err("hw_qpageit_get_inc failed\n");
+			ehea_error("hw_qpageit_get_inc failed");
 			goto out_kill_hwq;
 		}
 		rpage = virt_to_abs(vpage);
@@ -404,7 +403,7 @@
 					     0, h_call_q_selector,
 					     qp->fw_handle, rpage, 1);
 		if (hret < H_SUCCESS) {
-			pr_err("register_rpage_qp failed\n");
+			ehea_error("register_rpage_qp failed");
 			goto out_kill_hwq;
 		}
 	}
@@ -433,7 +432,7 @@
 
 	qp = kzalloc(sizeof(*qp), GFP_KERNEL);
 	if (!qp) {
-		pr_err("no mem for qp\n");
+		ehea_error("no mem for qp");
 		return NULL;
 	}
 
@@ -442,7 +441,7 @@
 	hret = ehea_h_alloc_resource_qp(adapter->handle, init_attr, pd,
 					&qp->fw_handle, &qp->epas);
 	if (hret != H_SUCCESS) {
-		pr_err("ehea_h_alloc_resource_qp failed\n");
+		ehea_error("ehea_h_alloc_resource_qp failed");
 		goto out_freemem;
 	}
 
@@ -456,7 +455,7 @@
 				     init_attr->act_wqe_size_enc_sq, adapter,
 				     0);
 	if (ret) {
-		pr_err("can't register for sq ret=%x\n", ret);
+		ehea_error("can't register for sq ret=%x", ret);
 		goto out_freeres;
 	}
 
@@ -466,7 +465,7 @@
 				     init_attr->act_wqe_size_enc_rq1,
 				     adapter, 1);
 	if (ret) {
-		pr_err("can't register for rq1 ret=%x\n", ret);
+		ehea_error("can't register for rq1 ret=%x", ret);
 		goto out_kill_hwsq;
 	}
 
@@ -477,7 +476,7 @@
 					     init_attr->act_wqe_size_enc_rq2,
 					     adapter, 2);
 		if (ret) {
-			pr_err("can't register for rq2 ret=%x\n", ret);
+			ehea_error("can't register for rq2 ret=%x", ret);
 			goto out_kill_hwr1q;
 		}
 	}
@@ -489,7 +488,7 @@
 					     init_attr->act_wqe_size_enc_rq3,
 					     adapter, 3);
 		if (ret) {
-			pr_err("can't register for rq3 ret=%x\n", ret);
+			ehea_error("can't register for rq3 ret=%x", ret);
 			goto out_kill_hwr2q;
 		}
 	}
@@ -554,7 +553,7 @@
 	}
 
 	if (hret != H_SUCCESS) {
-		pr_err("destroy QP failed\n");
+		ehea_error("destroy QP failed");
 		return -EIO;
 	}
 
@@ -843,7 +842,7 @@
 		    (hret != H_PAGE_REGISTERED)) {
 			ehea_h_free_resource(adapter->handle, mr->handle,
 					     FORCE_FREE);
-			pr_err("register_rpage_mr failed\n");
+			ehea_error("register_rpage_mr failed");
 			return hret;
 		}
 	}
@@ -897,7 +896,7 @@
 
 	pt = (void *)get_zeroed_page(GFP_KERNEL);
 	if (!pt) {
-		pr_err("no mem\n");
+		ehea_error("no mem");
 		ret = -ENOMEM;
 		goto out;
 	}
@@ -907,14 +906,14 @@
 					&mr->handle, &mr->lkey);
 
 	if (hret != H_SUCCESS) {
-		pr_err("alloc_resource_mr failed\n");
+		ehea_error("alloc_resource_mr failed");
 		ret = -EIO;
 		goto out;
 	}
 
 	if (!ehea_bmap) {
 		ehea_h_free_resource(adapter->handle, mr->handle, FORCE_FREE);
-		pr_err("no busmap available\n");
+		ehea_error("no busmap available");
 		ret = -EIO;
 		goto out;
 	}
@@ -930,7 +929,7 @@
 
 	if (hret != H_SUCCESS) {
 		ehea_h_free_resource(adapter->handle, mr->handle, FORCE_FREE);
-		pr_err("registering mr failed\n");
+		ehea_error("registering mr failed");
 		ret = -EIO;
 		goto out;
 	}
@@ -953,7 +952,7 @@
 	hret = ehea_h_free_resource(mr->adapter->handle, mr->handle,
 				    FORCE_FREE);
 	if (hret != H_SUCCESS) {
-		pr_err("destroy MR failed\n");
+		ehea_error("destroy MR failed");
 		return -EIO;
 	}
 
@@ -988,14 +987,14 @@
 		length = EHEA_PAGESIZE;
 
 	if (type == EHEA_AER_RESTYPE_QP)
-		pr_err("QP (resource=%llX) state: AER=0x%llX, AERR=0x%llX, port=%llX\n",
-		       resource, data[6], data[12], data[22]);
+		ehea_error("QP (resource=%llX) state: AER=0x%llX, AERR=0x%llX, "
+			   "port=%llX", resource, data[6], data[12], data[22]);
 	else if (type == EHEA_AER_RESTYPE_CQ)
-		pr_err("CQ (resource=%llX) state: AER=0x%llX\n",
-		       resource, data[6]);
+		ehea_error("CQ (resource=%llX) state: AER=0x%llX", resource,
+			   data[6]);
 	else if (type == EHEA_AER_RESTYPE_EQ)
-		pr_err("EQ (resource=%llX) state: AER=0x%llX\n",
-		       resource, data[6]);
+		ehea_error("EQ (resource=%llX) state: AER=0x%llX", resource,
+			   data[6]);
 
 	ehea_dump(data, length, "error data");
 }
@@ -1009,7 +1008,7 @@
 
 	rblock = (void *)get_zeroed_page(GFP_KERNEL);
 	if (!rblock) {
-		pr_err("Cannot allocate rblock memory\n");
+		ehea_error("Cannot allocate rblock memory.");
 		goto out;
 	}
 
@@ -1021,9 +1020,9 @@
 		*aerr = rblock[12];
 		print_error_data(rblock);
 	} else if (ret == H_R_STATE) {
-		pr_err("No error data available: %llX\n", res_handle);
+		ehea_error("No error data available: %llX.", res_handle);
 	} else
-		pr_err("Error data could not be fetched: %llX\n", res_handle);
+		ehea_error("Error data could not be fetched: %llX", res_handle);
 
 	free_page((unsigned long)rblock);
 out:
