diff options
author | Bogdan Hamciuc <bogdan.hamciuc@freescale.com> | 2013-04-05 08:34:58 (GMT) |
---|---|---|
committer | Fleming Andrew-AFLEMING <AFLEMING@freescale.com> | 2013-04-08 23:25:14 (GMT) |
commit | b82fa0cdf48483b3a7182fa2c1f0ef569d442163 (patch) | |
tree | a4e31b7c7a715d8892a78eac974e23a5c48d8b3d /drivers/net/ethernet | |
parent | 536b2f172a871f260eeaba0715c9ac9dbc49f9dd (diff) | |
download | linux-fsl-qoriq-b82fa0cdf48483b3a7182fa2c1f0ef569d442163.tar.xz |
dpaa_eth: Use standard printing API
Replace dpaa_eth_*() and cpu_**() macros with standard printing calls.
Signed-off-by: Bogdan Hamciuc <bogdan.hamciuc@freescale.com>
(cherry picked from commit 1dc1a7386b52b0249d6a5396e547119f1a83151f)
Conflicts:
drivers/net/ethernet/freescale/dpa/dpa-ethtool.c
Change-Id: I5fc6cd3532c2fd39e72ac0531a85fdef028bb967
Reviewed-on: http://git.am.freescale.net:8181/1059
Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Tested-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r-- | drivers/net/ethernet/freescale/dpa/dpa-ethtool.c | 34 | ||||
-rw-r--r-- | drivers/net/ethernet/freescale/dpa/dpaa_eth-common.h | 88 | ||||
-rw-r--r-- | drivers/net/ethernet/freescale/dpa/dpaa_eth.c | 155 | ||||
-rw-r--r-- | drivers/net/ethernet/freescale/dpa/dpaa_eth_sg.c | 24 | ||||
-rw-r--r-- | drivers/net/ethernet/freescale/dpa/mac-api.c | 72 | ||||
-rw-r--r-- | drivers/net/ethernet/freescale/dpa/mac.c | 56 | ||||
-rw-r--r-- | drivers/net/ethernet/freescale/dpa/offline_port.c | 65 |
7 files changed, 220 insertions, 274 deletions
diff --git a/drivers/net/ethernet/freescale/dpa/dpa-ethtool.c b/drivers/net/ethernet/freescale/dpa/dpa-ethtool.c index 4189875..1bdd8d2 100644 --- a/drivers/net/ethernet/freescale/dpa/dpa-ethtool.c +++ b/drivers/net/ethernet/freescale/dpa/dpa-ethtool.c @@ -29,6 +29,10 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#define pr_fmt(fmt) \ + KBUILD_MODNAME ": %s:%hu:%s() " fmt, \ + KBUILD_BASENAME".c", __LINE__, __func__ + #include <linux/string.h> #include "dpaa_eth.h" @@ -41,17 +45,17 @@ static int __cold dpa_get_settings(struct net_device *net_dev, struct ethtool_cm priv = netdev_priv(net_dev); if (priv->mac_dev == NULL) { - cpu_netdev_info(net_dev, "This is a MAC-less interface\n"); + netdev_info(net_dev, "This is a MAC-less interface\n"); return -ENODEV; } if (unlikely(priv->mac_dev->phy_dev == NULL)) { - cpu_netdev_err(net_dev, "phy device not initialized\n"); + netdev_err(net_dev, "phy device not initialized\n"); return -ENODEV; } _errno = phy_ethtool_gset(priv->mac_dev->phy_dev, et_cmd); if (unlikely(_errno < 0)) - cpu_netdev_err(net_dev, "phy_ethtool_gset() = %d\n", _errno); + netdev_err(net_dev, "phy_ethtool_gset() = %d\n", _errno); return _errno; } @@ -64,17 +68,17 @@ static int __cold dpa_set_settings(struct net_device *net_dev, struct ethtool_cm priv = netdev_priv(net_dev); if (priv->mac_dev == NULL) { - cpu_netdev_info(net_dev, "This is a MAC-less interface\n"); + netdev_info(net_dev, "This is a MAC-less interface\n"); return -ENODEV; } if (unlikely(priv->mac_dev->phy_dev == NULL)) { - cpu_netdev_err(net_dev, "phy device not initialized\n"); + netdev_err(net_dev, "phy device not initialized\n"); return -ENODEV; } _errno = phy_ethtool_sset(priv->mac_dev->phy_dev, et_cmd); if (unlikely(_errno < 0)) - cpu_netdev_err(net_dev, "phy_ethtool_sset() = %d\n", _errno); + netdev_err(net_dev, "phy_ethtool_sset() = %d\n", _errno); return _errno; } @@ -90,9 +94,9 @@ static void __cold dpa_get_drvinfo(struct net_device *net_dev, struct ethtool_dr _errno = snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version), "%X", 0); if (unlikely(_errno >= sizeof(drvinfo->fw_version))) { /* Truncated output */ - cpu_netdev_notice(net_dev, "snprintf() = %d\n", _errno); + netdev_notice(net_dev, "snprintf() = %d\n", _errno); } else if (unlikely(_errno < 0)) { - cpu_netdev_warn(net_dev, "snprintf() = %d\n", _errno); + netdev_warn(net_dev, "snprintf() = %d\n", _errno); memset(drvinfo->fw_version, 0, sizeof(drvinfo->fw_version)); } strncpy(drvinfo->bus_info, dev_name(net_dev->dev.parent->parent), @@ -117,11 +121,11 @@ int __cold dpa_nway_reset(struct net_device *net_dev) priv = netdev_priv(net_dev); if (priv->mac_dev == NULL) { - cpu_netdev_info(net_dev, "This is a MAC-less interface\n"); + netdev_info(net_dev, "This is a MAC-less interface\n"); return -ENODEV; } if (unlikely(priv->mac_dev->phy_dev == NULL)) { - cpu_netdev_err(net_dev, "phy device not initialized\n"); + netdev_err(net_dev, "phy device not initialized\n"); return -ENODEV; } @@ -129,7 +133,7 @@ int __cold dpa_nway_reset(struct net_device *net_dev) if (priv->mac_dev->phy_dev->autoneg) { _errno = phy_start_aneg(priv->mac_dev->phy_dev); if (unlikely(_errno < 0)) - cpu_netdev_err(net_dev, "phy_start_aneg() = %d\n", + netdev_err(net_dev, "phy_start_aneg() = %d\n", _errno); } @@ -156,11 +160,11 @@ void __cold dpa_get_pauseparam(struct net_device *net_dev, struct ethtool_pausep priv = netdev_priv(net_dev); if (priv->mac_dev == NULL) { - cpu_netdev_info(net_dev, "This is a MAC-less interface\n"); + netdev_info(net_dev, "This is a MAC-less interface\n"); return; } if (unlikely(priv->mac_dev->phy_dev == NULL)) { - cpu_netdev_err(net_dev, "phy device not initialized\n"); + netdev_err(net_dev, "phy device not initialized\n"); return; } @@ -174,11 +178,11 @@ int __cold dpa_set_pauseparam(struct net_device *net_dev, struct ethtool_pausepa priv = netdev_priv(net_dev); if (priv->mac_dev == NULL) { - cpu_netdev_info(net_dev, "This is a MAC-less interface\n"); + netdev_info(net_dev, "This is a MAC-less interface\n"); return -ENODEV; } if (unlikely(priv->mac_dev->phy_dev == NULL)) { - cpu_netdev_err(net_dev, "phy device not initialized\n"); + netdev_err(net_dev, "phy device not initialized\n"); return -ENODEV; } diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth-common.h b/drivers/net/ethernet/freescale/dpa/dpaa_eth-common.h index 58a71cf..8bfb557 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_eth-common.h +++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth-common.h @@ -37,9 +37,6 @@ #include <linux/device.h> /* dev_*() */ #include <linux/smp.h> /* smp_processor_id() */ -/* The basename of the source file is being compiled */ -#define __file__ KBUILD_BASENAME".c" - #define __hot /* @@ -65,91 +62,6 @@ #define cpu_printk(level, format, arg...) \ pr_##level("cpu%d: " format, raw_smp_processor_id(), ##arg) -#define cpu_pr_emerg(format, arg...) \ - cpu_printk(emerg, format, ##arg) -#define cpu_pr_alert(format, arg...) \ - cpu_printk(alert, format, ##arg) -#define cpu_pr_crit(format, arg...) \ - cpu_printk(crit, format, ##arg) -#define cpu_pr_err(format, arg...) \ - cpu_printk(err, format, ##arg) -#define cpu_pr_warning(format, arg...) \ - cpu_printk(warning, format, ##arg) -#define cpu_pr_notice(format, arg...) \ - cpu_printk(notice, format, ##arg) -#define cpu_pr_info(format, arg...) \ - cpu_printk(info, format, ##arg) -#define cpu_pr_debug(format, arg...) \ - cpu_printk(debug, format, ##arg) - -/* Keep this in sync with the dev_*() definitions from linux/device.h */ -#define cpu_dev_printk(level, dev, format, arg...) \ - cpu_pr_##level("%s: %s: " format, dev_driver_string(dev), \ - dev_name(dev), ##arg) - -#define cpu_dev_emerg(dev, format, arg...) \ - cpu_dev_printk(emerg, dev, format, ##arg) -#define cpu_dev_alert(dev, format, arg...) \ - cpu_dev_printk(alert, dev, format, ##arg) -#define cpu_dev_crit(dev, format, arg...) \ - cpu_dev_printk(crit, dev, format, ##arg) -#define cpu_dev_err(dev, format, arg...) \ - cpu_dev_printk(err, dev, format, ##arg) -#define cpu_dev_warn(dev, format, arg...) \ - cpu_dev_printk(warning, dev, format, ##arg) -#define cpu_dev_notice(dev, format, arg...) \ - cpu_dev_printk(notice, dev, format, ##arg) -#define cpu_dev_info(dev, format, arg...) \ - cpu_dev_printk(info, dev, format, ##arg) -#define cpu_dev_dbg(dev, format, arg...) \ - cpu_dev_printk(debug, dev, format, ##arg) - -#define dpaa_eth_printk(level, dev, format, arg...) \ - cpu_dev_printk(level, dev, "%s:%hu:%s() " format, \ - __file__, __LINE__, __func__, ##arg) - -#define dpaa_eth_emerg(dev, format, arg...) \ - dpaa_eth_printk(emerg, dev, format, ##arg) -#define dpaa_eth_alert(dev, format, arg...) \ - dpaa_eth_printk(alert, dev, format, ##arg) -#define dpaa_eth_crit(dev, format, arg...) \ - dpaa_eth_printk(crit, dev, format, ##arg) -#define dpaa_eth_err(dev, format, arg...) \ - dpaa_eth_printk(err, dev, format, ##arg) -#define dpaa_eth_warning(dev, format, arg...) \ - dpaa_eth_printk(warning, dev, format, ##arg) -#define dpaa_eth_notice(dev, format, arg...) \ - dpaa_eth_printk(notice, dev, format, ##arg) -#define dpaa_eth_info(dev, format, arg...) \ - dpaa_eth_printk(info, dev, format, ##arg) -#define dpaa_eth_debug(dev, format, arg...) \ - dpaa_eth_printk(debug, dev, format, ##arg) - -#define cpu_netdev_emerg(net_dev, format, arg...) \ - dpaa_eth_emerg((net_dev)->dev.parent, "%s: " format, \ - (net_dev)->name , ##arg) -#define cpu_netdev_alert(net_dev, format, arg...) \ - dpaa_eth_alert((net_dev)->dev.parent, "%s: " format, \ - (net_dev)->name , ##arg) -#define cpu_netdev_crit(net_dev, format, arg...) \ - dpaa_eth_crit((net_dev)->dev.parent, "%s: " format, \ - (net_dev)->name , ##arg) -#define cpu_netdev_err(net_dev, format, arg...) \ - dpaa_eth_err((net_dev)->dev.parent, "%s: " format, \ - (net_dev)->name , ##arg) -#define cpu_netdev_warn(net_dev, format, arg...) \ - dpaa_eth_warning((net_dev)->dev.parent, "%s: " format, \ - (net_dev)->name , ##arg) -#define cpu_netdev_notice(net_dev, format, arg...) \ - dpaa_eth_notice((net_dev)->dev.parent, "%s: " format, \ - (net_dev)->name , ##arg) -#define cpu_netdev_info(net_dev, format, arg...) \ - dpaa_eth_info((net_dev)->dev.parent, "%s: " format, \ - (net_dev)->name , ##arg) -#define cpu_netdev_dbg(net_dev, format, arg...) \ - dpaa_eth_debug((net_dev)->dev.parent, "%s: " format, \ - (net_dev)->name , ##arg) - /* Simple enum of FQ types - used for array indexing */ enum {RX, TX}; diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpa/dpaa_eth.c index 80ca80c..108d2ec 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_eth.c +++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth.c @@ -30,6 +30,10 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#define pr_fmt(fmt) \ + KBUILD_MODNAME ": %s:%hu:%s() " fmt, \ + KBUILD_BASENAME".c", __LINE__, __func__ + #include <linux/init.h> #include <linux/module.h> #include <linux/sort.h> @@ -297,7 +301,7 @@ static void dpa_bp_add_8(const struct dpa_bp *dpa_bp) addr = dma_map_single(dpa_bp->dev, skb->head + pad, dpa_bp->size, DMA_BIDIRECTIONAL); if (unlikely(dma_mapping_error(dpa_bp->dev, addr))) { - dpaa_eth_err(dpa_bp->dev, "DMA mapping failed"); + dev_err(dpa_bp->dev, "DMA mapping failed"); break; } @@ -416,7 +420,7 @@ static int dpa_make_shared_port_pool(struct dpa_bp *bp) bp->vaddr = devm_ioremap_prot(bp->dev, bp->paddr, bp->size * bp->config_count, 0); if (bp->vaddr == NULL) { - cpu_pr_err("Could not map memory for pool %d\n", bp->bpid); + pr_err("Could not map memory for pool %d\n", bp->bpid); return -EIO; } @@ -460,7 +464,7 @@ dpa_bp_alloc(struct dpa_bp *dpa_bp) dpa_bp->pool = bman_new_pool(&bp_params); if (unlikely(dpa_bp->pool == NULL)) { - cpu_pr_err("bman_new_pool() failed\n"); + pr_err("bman_new_pool() failed\n"); return -ENODEV; } @@ -595,7 +599,7 @@ _dpa_fq_alloc(struct list_head *list, struct dpa_fq *dpa_fq) _errno = qman_create_fq(dpa_fq->fqid, dpa_fq->flags, &dpa_fq->fq_base); if (_errno) { - dpaa_eth_err(dev, "qman_create_fq() failed\n"); + dev_err(dev, "qman_create_fq() failed\n"); return _errno; } fq = &dpa_fq->fq_base; @@ -709,7 +713,7 @@ _dpa_fq_alloc(struct list_head *list, struct dpa_fq *dpa_fq) _errno = qman_init_fq(fq, QMAN_INITFQ_FLAG_SCHED, &initfq); if (_errno < 0) { - dpaa_eth_err(dev, "qman_init_fq(%u) = %d\n", + dev_err(dev, "qman_init_fq(%u) = %d\n", qman_fq_fqid(fq), _errno); qman_destroy_fq(fq, 0); return _errno; @@ -737,12 +741,12 @@ _dpa_fq_free(struct device *dev, struct qman_fq *fq) if (dpa_fq->init) { _errno = qman_retire_fq(fq, NULL); if (unlikely(_errno < 0) && netif_msg_drv(priv)) - dpaa_eth_err(dev, "qman_retire_fq(%u) = %d\n", + dev_err(dev, "qman_retire_fq(%u) = %d\n", qman_fq_fqid(fq), _errno); __errno = qman_oos_fq(fq); if (unlikely(__errno < 0) && netif_msg_drv(priv)) { - dpaa_eth_err(dev, "qman_oos_fq(%u) = %d\n", + dev_err(dev, "qman_oos_fq(%u) = %d\n", qman_fq_fqid(fq), __errno); if (_errno >= 0) _errno = __errno; @@ -828,7 +832,7 @@ dpa_fd_release_sg(const struct net_device *net_dev, sgt = kmalloc(DPA_SGT_MAX_ENTRIES * sizeof(*sgt), GFP_ATOMIC); if (sgt == NULL) { if (netif_msg_tx_err(priv) && net_ratelimit()) - cpu_netdev_err(net_dev, + netdev_err(net_dev, "Memory allocation failed\n"); return; } @@ -972,7 +976,7 @@ static int dpa_change_mtu(struct net_device *net_dev, int new_mtu) /* Make sure we don't exceed the Ethernet controller's MAXFRM */ if (new_mtu < min_mtu || new_mtu > max_mtu) { - cpu_netdev_err(net_dev, "Invalid L3 mtu %d " + netdev_err(net_dev, "Invalid L3 mtu %d " "(must be between %d and %d).\n", new_mtu, min_mtu, max_mtu); return -EINVAL; @@ -1011,7 +1015,7 @@ static int dpa_set_mac_address(struct net_device *net_dev, void *addr) _errno = eth_mac_addr(net_dev, addr); if (_errno < 0) { if (netif_msg_drv(priv)) - cpu_netdev_err(net_dev, + netdev_err(net_dev, "eth_mac_addr() = %d\n", _errno); return _errno; @@ -1024,7 +1028,7 @@ static int dpa_set_mac_address(struct net_device *net_dev, void *addr) _errno = priv->mac_dev->change_addr(priv->mac_dev, net_dev->dev_addr); if (_errno < 0) { if (netif_msg_drv(priv)) - cpu_netdev_err(net_dev, + netdev_err(net_dev, "mac_dev->change_addr() = %d\n", _errno); return _errno; @@ -1046,14 +1050,14 @@ static void dpa_set_rx_mode(struct net_device *net_dev) if (!!(net_dev->flags & IFF_PROMISC) != priv->mac_dev->promisc) { _errno = priv->mac_dev->change_promisc(priv->mac_dev); if (unlikely(_errno < 0) && netif_msg_drv(priv)) - cpu_netdev_err(net_dev, + netdev_err(net_dev, "mac_dev->change_promisc() = %d\n", _errno); } _errno = priv->mac_dev->set_multi(net_dev); if (unlikely(_errno < 0) && netif_msg_drv(priv)) - cpu_netdev_err(net_dev, "mac_dev->set_multi() = %d\n", _errno); + netdev_err(net_dev, "mac_dev->set_multi() = %d\n", _errno); } #ifdef CONFIG_FSL_DPA_1588 @@ -1148,7 +1152,7 @@ static void _dpa_rx_error(struct net_device *net_dev, "in fman statistics (sysfs)\n"); else if (netif_msg_hw(priv) && net_ratelimit()) - cpu_netdev_err(net_dev, "FD status = 0x%08x\n", + netdev_err(net_dev, "FD status = 0x%08x\n", fd->status & FM_FD_STAT_ERRORS); if (dpaa_eth_hooks.rx_error && @@ -1181,7 +1185,7 @@ static void _dpa_tx_error(struct net_device *net_dev, struct sk_buff *skb; if (netif_msg_hw(priv) && net_ratelimit()) - cpu_netdev_warn(net_dev, "FD status = 0x%08x\n", + netdev_warn(net_dev, "FD status = 0x%08x\n", fd->status & FM_FD_STAT_ERRORS); if (dpaa_eth_hooks.tx_error && @@ -1304,7 +1308,7 @@ void __hot _dpa_rx(struct net_device *net_dev, if (unlikely(fd_status & FM_FD_STAT_ERRORS) != 0) { if (netif_msg_hw(priv) && net_ratelimit()) - cpu_netdev_warn(net_dev, "FD status = 0x%08x\n", + netdev_warn(net_dev, "FD status = 0x%08x\n", fd->status & FM_FD_STAT_ERRORS); percpu_priv->stats.rx_errors++; @@ -1315,7 +1319,7 @@ void __hot _dpa_rx(struct net_device *net_dev, if (unlikely(fd->format != qm_fd_contig)) { percpu_priv->stats.rx_dropped++; if (netif_msg_rx_status(priv) && net_ratelimit()) - cpu_netdev_warn(net_dev, "Dropping a SG frame\n"); + netdev_warn(net_dev, "Dropping a SG frame\n"); goto _return_dpa_fd_release; } @@ -1442,7 +1446,7 @@ static void __hot _dpa_tx_conf(struct net_device *net_dev, if (unlikely(fd->status & FM_FD_STAT_ERRORS) != 0) { if (netif_msg_hw(priv) && net_ratelimit()) - cpu_netdev_warn(net_dev, "FD status = 0x%08x\n", + netdev_warn(net_dev, "FD status = 0x%08x\n", fd->status & FM_FD_STAT_ERRORS); percpu_priv->stats.tx_errors++; @@ -1534,7 +1538,7 @@ int dpa_enable_tx_csum(struct dpa_priv_s *priv, default: /* We shouldn't even be here */ if (netif_msg_tx_err(priv) && net_ratelimit()) - cpu_netdev_alert(priv->net_dev, "Can't compute HW csum " + netdev_alert(priv->net_dev, "Can't compute HW csum " "for L3 proto 0x%x\n", ntohs(skb->protocol)); retval = -EIO; goto return_error; @@ -1551,7 +1555,7 @@ int dpa_enable_tx_csum(struct dpa_priv_s *priv, default: /* This can as well be a BUG() */ if (netif_msg_tx_err(priv) && net_ratelimit()) - cpu_netdev_alert(priv->net_dev, "Can't compute HW csum " + netdev_alert(priv->net_dev, "Can't compute HW csum " "for L4 proto 0x%x\n", l4_proto); retval = -EIO; goto return_error; @@ -1647,7 +1651,7 @@ static int __hot dpa_shared_tx(struct sk_buff *skb, struct net_device *net_dev) if (unlikely(err < 0)) { if (netif_msg_tx_err(priv) && net_ratelimit()) - cpu_netdev_err(net_dev, "Tx HW csum error: %d\n", err); + netdev_err(net_dev, "Tx HW csum error: %d\n", err); percpu_priv->stats.tx_errors++; goto l3_l4_csum_failed; } @@ -1679,7 +1683,7 @@ static int skb_to_sg_fd(struct dpa_priv_s *priv, vaddr = kmalloc(SGT_BUFFER_SIZE, GFP_ATOMIC); if (unlikely(vaddr == NULL)) { if (netif_msg_tx_err(priv) && net_ratelimit()) - cpu_netdev_err(net_dev, "Memory allocation failed\n"); + netdev_err(net_dev, "Memory allocation failed\n"); return -ENOMEM; } /* Store skb backpointer at the beginning of the buffer */ @@ -1696,7 +1700,7 @@ static int skb_to_sg_fd(struct dpa_priv_s *priv, (char *)vaddr + DPA_TX_PRIV_DATA_SIZE); if (unlikely(err < 0)) { if (netif_msg_tx_err(priv) && net_ratelimit()) - cpu_netdev_err(net_dev, "HW csum error: %d\n", err); + netdev_err(net_dev, "HW csum error: %d\n", err); kfree(vaddr); return err; } @@ -1706,7 +1710,7 @@ static int skb_to_sg_fd(struct dpa_priv_s *priv, DMA_TO_DEVICE); if (unlikely(dma_mapping_error(dpa_bp->dev, paddr))) { if (netif_msg_tx_err(priv) && net_ratelimit()) - cpu_netdev_err(net_dev, "DMA mapping failed\n"); + netdev_err(net_dev, "DMA mapping failed\n"); kfree(vaddr); return -EINVAL; } @@ -1733,7 +1737,7 @@ static int skb_to_sg_fd(struct dpa_priv_s *priv, dpa_bp->size, DMA_TO_DEVICE); if (unlikely(dma_mapping_error(dpa_bp->dev, paddr))) { if (netif_msg_tx_err(priv) && net_ratelimit()) - cpu_netdev_err(net_dev, "DMA mapping failed\n"); + netdev_err(net_dev, "DMA mapping failed\n"); return -EINVAL; } sg_entry->addr_hi = upper_32_bits(paddr); @@ -1836,7 +1840,7 @@ static int skb_to_contig_fd(struct dpa_priv_s *priv, ((char *)skbh) + DPA_TX_PRIV_DATA_SIZE); if (unlikely(err < 0)) { if (netif_msg_tx_err(priv) && net_ratelimit()) - cpu_netdev_err(net_dev, "HW csum error: %d\n", err); + netdev_err(net_dev, "HW csum error: %d\n", err); return err; } @@ -1847,7 +1851,7 @@ static int skb_to_contig_fd(struct dpa_priv_s *priv, addr = dma_map_single(dpa_bp->dev, skbh, dpa_bp->size, dma_dir); if (unlikely(dma_mapping_error(dpa_bp->dev, addr))) { if (netif_msg_tx_err(priv) && net_ratelimit()) - cpu_netdev_err(net_dev, "dma_map_single() failed\n"); + netdev_err(net_dev, "dma_map_single() failed\n"); return -EINVAL; } @@ -2032,7 +2036,7 @@ shared_rx_dqrr(struct qman_portal *portal, struct qman_fq *fq, if (unlikely(fd->status & FM_FD_STAT_ERRORS) != 0) { if (netif_msg_hw(priv) && net_ratelimit()) - cpu_netdev_warn(net_dev, "FD status = 0x%08x\n", + netdev_warn(net_dev, "FD status = 0x%08x\n", fd->status & FM_FD_STAT_ERRORS); percpu_priv->stats.rx_errors++; @@ -2045,7 +2049,7 @@ shared_rx_dqrr(struct qman_portal *portal, struct qman_fq *fq, GFP_ATOMIC); if (unlikely(skb == NULL)) { if (netif_msg_rx_err(priv) && net_ratelimit()) - cpu_netdev_err(net_dev, "Could not alloc skb\n"); + netdev_err(net_dev, "Could not alloc skb\n"); percpu_priv->stats.rx_dropped++; @@ -2076,7 +2080,7 @@ shared_rx_dqrr(struct qman_portal *portal, struct qman_fq *fq, GFP_ATOMIC); if (unlikely(sgt == NULL)) { if (netif_msg_tx_err(priv) && net_ratelimit()) - cpu_netdev_err(net_dev, + netdev_err(net_dev, "Memory allocation failed\n"); return -ENOMEM; } @@ -2722,7 +2726,7 @@ static int __cold dpa_start(struct net_device *net_dev) err = mac_dev->init_phy(net_dev); if (err < 0) { if (netif_msg_ifup(priv)) - cpu_netdev_err(net_dev, "init_phy() = %d\n", err); + netdev_err(net_dev, "init_phy() = %d\n", err); goto init_phy_failed; } @@ -2732,7 +2736,7 @@ static int __cold dpa_start(struct net_device *net_dev) err = priv->mac_dev->start(mac_dev); if (err < 0) { if (netif_msg_ifup(priv)) - cpu_netdev_err(net_dev, "mac_dev->start() = %d\n", err); + netdev_err(net_dev, "mac_dev->start() = %d\n", err); goto mac_start_failed; } @@ -2768,7 +2772,7 @@ static int __cold dpa_stop(struct net_device *net_dev) _errno = mac_dev->stop(mac_dev); if (unlikely(_errno < 0)) if (netif_msg_ifdown(priv)) - cpu_netdev_err(net_dev, "mac_dev->stop() = %d\n", + netdev_err(net_dev, "mac_dev->stop() = %d\n", _errno); for_each_port_device(i, mac_dev->port_dev) @@ -2792,7 +2796,7 @@ static void __cold dpa_timeout(struct net_device *net_dev) percpu_priv = per_cpu_ptr(priv->percpu_priv, smp_processor_id()); if (netif_msg_timer(priv)) - cpu_netdev_crit(net_dev, "Transmit timeout latency: %u ms\n", + netdev_crit(net_dev, "Transmit timeout latency: %u ms\n", jiffies_to_msecs(jiffies - net_dev->trans_start)); percpu_priv->stats.tx_errors++; @@ -2845,13 +2849,13 @@ dpa_bp_probe(struct platform_device *_of_dev, size_t *count) dpa_bp = devm_kzalloc(dev, *count * sizeof(*dpa_bp), GFP_KERNEL); if (unlikely(dpa_bp == NULL)) { - dpaa_eth_err(dev, "devm_kzalloc() failed\n"); + dev_err(dev, "devm_kzalloc() failed\n"); return ERR_PTR(-ENOMEM); } dev_node = of_find_node_by_path("/"); if (unlikely(dev_node == NULL)) { - dpaa_eth_err(dev, "of_find_node_by_path(/) failed\n"); + dev_err(dev, "of_find_node_by_path(/) failed\n"); return ERR_PTR(-EINVAL); } @@ -2862,12 +2866,12 @@ dpa_bp_probe(struct platform_device *_of_dev, size_t *count) of_node_put(dev_node); dev_node = of_find_node_by_phandle(phandle_prop[i]); if (unlikely(dev_node == NULL)) { - dpaa_eth_err(dev, "of_find_node_by_phandle() failed\n"); + dev_err(dev, "of_find_node_by_phandle() failed\n"); return ERR_PTR(-EFAULT); } if (unlikely(!of_device_is_compatible(dev_node, "fsl,bpool"))) { - dpaa_eth_err(dev, + dev_err(dev, "!of_device_is_compatible(%s, fsl,bpool)\n", dev_node->full_name); dpa_bp = ERR_PTR(-EINVAL); @@ -2876,7 +2880,7 @@ dpa_bp_probe(struct platform_device *_of_dev, size_t *count) bpid = of_get_property(dev_node, "fsl,bpid", &lenp); if ((bpid == NULL) || (lenp != sizeof(*bpid))) { - dpaa_eth_err(dev, "fsl,bpid property not found.\n"); + dev_err(dev, "fsl,bpid property not found.\n"); dpa_bp = ERR_PTR(-EINVAL); goto _return_of_node_put; } @@ -2907,7 +2911,7 @@ dpa_bp_probe(struct platform_device *_of_dev, size_t *count) } if (has_kernel_pool && has_shared_pool) { - dpaa_eth_err(dev, "Invalid buffer pool configuration " + dev_err(dev, "Invalid buffer pool configuration " "for node %s\n", dev_node->full_name); dpa_bp = ERR_PTR(-EINVAL); goto _return_of_node_put; @@ -2916,7 +2920,7 @@ dpa_bp_probe(struct platform_device *_of_dev, size_t *count) dpa_bp->size = DEFAULT_BUF_SIZE; #ifdef CONFIG_DPAA_ETH_SG_SUPPORT if (dpa_bp->size > PAGE_SIZE) { - dpaa_eth_warning(dev, "Default buffer size too large. " + dev_warn(dev, "Default buffer size too large. " "Round down to PAGE_SIZE\n"); dpa_bp->size = PAGE_SIZE; } @@ -2945,7 +2949,7 @@ static int dpa_bp_create(struct net_device *net_dev, struct dpa_bp *dpa_bp, priv->shared = 0; if (netif_msg_probe(priv)) - cpu_dev_info(net_dev->dev.parent, + dev_info(net_dev->dev.parent, "Using private BM buffer pools\n"); } else { priv->shared = 1; @@ -3000,13 +3004,13 @@ dpa_mac_probe(struct platform_device *_of_dev) mac_node = of_find_node_by_phandle(*phandle_prop); if (unlikely(mac_node == NULL)) { - dpaa_eth_err(dpa_dev, "of_find_node_by_phandle() failed\n"); + dev_err(dpa_dev, "of_find_node_by_phandle() failed\n"); return ERR_PTR(-EFAULT); } of_dev = of_find_device_by_node(mac_node); if (unlikely(of_dev == NULL)) { - dpaa_eth_err(dpa_dev, "of_find_device_by_node(%s) failed\n", + dev_err(dpa_dev, "of_find_device_by_node(%s) failed\n", mac_node->full_name); of_node_put(mac_node); return ERR_PTR(-EINVAL); @@ -3017,7 +3021,7 @@ dpa_mac_probe(struct platform_device *_of_dev) mac_dev = dev_get_drvdata(dev); if (unlikely(mac_dev == NULL)) { - dpaa_eth_err(dpa_dev, "dev_get_drvdata(%s) failed\n", + dev_err(dpa_dev, "dev_get_drvdata(%s) failed\n", dev_name(dev)); return ERR_PTR(-EINVAL); } @@ -3031,7 +3035,7 @@ dpa_mac_probe(struct platform_device *_of_dev) if (timer_node && (net_dev = dev_get_drvdata(dpa_dev))) { priv = netdev_priv(net_dev); if (!dpa_ptp_init(priv)) - dpaa_eth_info(dev, "%s: ptp-timer enabled\n", + dev_info(dev, "%s: ptp-timer enabled\n", mac_node->full_name); } } @@ -3210,7 +3214,7 @@ static int __cold dpa_debugfs_open(struct inode *inode, struct file *file) net_dev = (struct net_device *)inode->i_private; if (netif_msg_drv((struct dpa_priv_s *)netdev_priv(net_dev))) - cpu_netdev_err(net_dev, "single_open() = %d\n", + netdev_err(net_dev, "single_open() = %d\n", _errno); } return _errno; @@ -3346,7 +3350,7 @@ dpa_fq_probe(struct platform_device *_of_dev, struct list_head *list, dpa_fq = devm_kzalloc(dev, sizeof(*dpa_fq) * fqids[0].count, GFP_KERNEL); if (dpa_fq == NULL) { - dpaa_eth_err(dev, "devm_kzalloc() failed\n"); + dev_err(dev, "devm_kzalloc() failed\n"); return -ENOMEM; } *txconfq = dpa_fq; @@ -3368,7 +3372,7 @@ dpa_fq_probe(struct platform_device *_of_dev, struct list_head *list, dpa_fq = devm_kzalloc(dev, sizeof(*dpa_fq) * fqids[0].count, GFP_KERNEL); if (dpa_fq == NULL) { - dpaa_eth_err(dev, "devm_kzalloc() failed\n"); + dev_err(dev, "devm_kzalloc() failed\n"); return -ENOMEM; } @@ -3396,7 +3400,7 @@ dpa_fq_probe(struct platform_device *_of_dev, struct list_head *list, dpa_fq = devm_kzalloc(dev, sizeof(*dpa_fq) * fqids[i].count, GFP_KERNEL); if (dpa_fq == NULL) { - dpaa_eth_err(dev, "devm_kzalloc() failed\n"); + dev_err(dev, "devm_kzalloc() failed\n"); return -ENOMEM; } @@ -3405,7 +3409,7 @@ dpa_fq_probe(struct platform_device *_of_dev, struct list_head *list, *errq = dpa_fq; if (fqids[i].count != 1) { - dpaa_eth_err(dev, "Too many error queues!\n"); + dev_err(dev, "Too many error queues!\n"); err = -EINVAL; goto invalid_error_queues; } @@ -3419,7 +3423,7 @@ dpa_fq_probe(struct platform_device *_of_dev, struct list_head *list, *defq = dpa_fq; if (fqids[i].count != 1) { - dpaa_eth_err(dev, "Too many default queues!\n"); + dev_err(dev, "Too many default queues!\n"); err = -EINVAL; goto invalid_default_queues; } @@ -3551,7 +3555,7 @@ static void dpa_setup_ingress_queues(struct dpa_priv_s *priv, for_each_cpu(cpu, affine_cpus) portals[num_portals++] = qman_affine_channel(cpu); if (num_portals == 0) { - dpaa_eth_err(fq->net_dev->dev.parent, + dev_err(fq->net_dev->dev.parent, "No Qman software (affine) channels found"); return; } @@ -3626,7 +3630,7 @@ static void dpa_rx_fq_init(struct dpa_priv_s *priv, struct list_head *head, return; if (defq->fqid == 0 && netif_msg_probe(priv)) - cpu_pr_info("Using dynamic RX QM frame queues\n"); + pr_info("Using dynamic RX QM frame queues\n"); if (priv->shared) { dpa_setup_ingress(priv, defq, &rx_shared_fq); @@ -3650,7 +3654,7 @@ static void dpa_tx_fq_init(struct dpa_priv_s *priv, struct list_head *head, return; if (defq->fqid == 0 && netif_msg_probe(priv)) - cpu_pr_info("Using dynamic TX QM frame queues\n"); + pr_info("Using dynamic TX QM frame queues\n"); /* The shared driver doesn't use tx confirmation */ if (priv->shared) { @@ -3685,7 +3689,7 @@ static int dpa_netdev_init(struct device_node *dpa_node, mac_addr = of_get_mac_address(dpa_node); if (mac_addr == NULL) { if (netif_msg_probe(priv)) - dpaa_eth_err(dev, "No MAC address found!\n"); + dev_err(dev, "No MAC address found!\n"); return -EINVAL; } } else { @@ -3727,7 +3731,7 @@ static int dpa_netdev_init(struct device_node *dpa_node, err = register_netdev(net_dev); if (err < 0) { - dpaa_eth_err(dev, "register_netdev() = %d\n", err); + dev_err(dev, "register_netdev() = %d\n", err); return err; } @@ -3736,7 +3740,7 @@ static int dpa_netdev_init(struct device_node *dpa_node, dpa_debugfs_root, net_dev, &dpa_debugfs_fops); if (unlikely(priv->debugfs_file == NULL)) { - cpu_netdev_err(net_dev, "debugfs_create_file(%s/%s/%s) = %d\n", + netdev_err(net_dev, "debugfs_create_file(%s/%s/%s) = %d\n", powerpc_debugfs_root->d_iname, dpa_debugfs_root->d_iname, net_dev->name, err); @@ -3793,7 +3797,7 @@ static int dpa_private_netdev_init(struct device_node *dpa_node, int dpa_alloc_pcd_fqids(struct device *dev, uint32_t num, uint8_t alignment, uint32_t *base_fqid) { - dpaa_eth_crit(dev, "callback not implemented!\n"); + dev_crit(dev, "callback not implemented!\n"); BUG(); return 0; @@ -3802,7 +3806,7 @@ int dpa_alloc_pcd_fqids(struct device *dev, uint32_t num, int dpa_free_pcd_fqids(struct device *dev, uint32_t base_fqid) { - dpaa_eth_crit(dev, "callback not implemented!\n"); + dev_crit(dev, "callback not implemented!\n"); BUG(); return 0; @@ -3829,7 +3833,7 @@ static int dpaa_eth_cgr_init(struct dpa_priv_s *priv) err = qman_alloc_cgrid(&priv->cgr_data.cgr.cgrid); if (err < 0) { - cpu_pr_err("Error %d allocating CGR ID\n", err); + pr_err("Error %d allocating CGR ID\n", err); goto out_error; } priv->cgr_data.cgr.cb = dpaa_eth_cgscn; @@ -3855,12 +3859,12 @@ static int dpaa_eth_cgr_init(struct dpa_priv_s *priv) err = qman_create_cgr(&priv->cgr_data.cgr, QMAN_CGR_FLAG_USE_INIT, &initcgr); if (err < 0) { - cpu_pr_err("Error %d creating CGR with ID %d\n", err, + pr_err("Error %d creating CGR with ID %d\n", err, priv->cgr_data.cgr.cgrid); qman_release_cgrid(priv->cgr_data.cgr.cgrid); goto out_error; } - cpu_pr_debug("Created CGR %d for netdev with hwaddr %pM on " + pr_debug("Created CGR %d for netdev with hwaddr %pM on " "QMan channel %d\n", priv->cgr_data.cgr.cgrid, priv->mac_dev->addr, priv->cgr_data.cgr.chan); @@ -3922,7 +3926,7 @@ dpaa_eth_probe(struct platform_device *_of_dev) if (!proxy_enet) { net_dev = alloc_etherdev_mq(sizeof(*priv), DPAA_ETH_TX_QUEUES); if (!net_dev) { - dpaa_eth_err(dev, "alloc_etherdev_mq() failed\n"); + dev_err(dev, "alloc_etherdev_mq() failed\n"); return -ENOMEM; } @@ -4036,7 +4040,7 @@ dpaa_eth_probe(struct platform_device *_of_dev) if (priv->mac_dev) { err = dpaa_eth_cgr_init(priv); if (err < 0) { - dpaa_eth_err(dev, "Error initializing CGR\n"); + dev_err(dev, "Error initializing CGR\n"); goto cgr_init_failed; } } @@ -4096,7 +4100,7 @@ dpaa_eth_probe(struct platform_device *_of_dev) priv->percpu_priv = __alloc_percpu(sizeof(*priv->percpu_priv), __alignof__(*priv->percpu_priv)); if (priv->percpu_priv == NULL) { - dpaa_eth_err(dev, "__alloc_percpu() failed\n"); + dev_err(dev, "__alloc_percpu() failed\n"); err = -ENOMEM; goto alloc_percpu_failed; } @@ -4210,7 +4214,7 @@ static int __init __cold dpa_load(void) { int _errno; - cpu_pr_info(KBUILD_MODNAME ": " DPA_DESCRIPTION " (" VERSION ")\n"); + pr_info(KBUILD_MODNAME ": " DPA_DESCRIPTION " (" VERSION ")\n"); /* initialise dpaa_eth mirror values */ dpa_rx_extra_headroom = fm_get_rx_extra_headroom(); @@ -4221,9 +4225,9 @@ static int __init __cold dpa_load(void) powerpc_debugfs_root); if (unlikely(dpa_debugfs_root == NULL)) { _errno = -ENOMEM; - cpu_pr_err(KBUILD_MODNAME ": %s:%hu:%s(): " + pr_err(KBUILD_MODNAME ": %s:%hu:%s(): " "debugfs_create_dir(%s/"KBUILD_MODNAME") = %d\n", - __file__, __LINE__, __func__, + KBUILD_BASENAME".c", __LINE__, __func__, powerpc_debugfs_root->d_iname, _errno); goto _return; } @@ -4231,9 +4235,9 @@ static int __init __cold dpa_load(void) _errno = platform_driver_register(&dpa_driver); if (unlikely(_errno < 0)) { - cpu_pr_err(KBUILD_MODNAME + pr_err(KBUILD_MODNAME ": %s:%hu:%s(): platform_driver_register() = %d\n", - __file__, __LINE__, __func__, _errno); + KBUILD_BASENAME".c", __LINE__, __func__, _errno); goto _return_debugfs_remove; } @@ -4244,7 +4248,8 @@ _return_debugfs_remove: debugfs_remove(dpa_debugfs_root); #endif _return: - cpu_pr_debug(KBUILD_MODNAME ": %s:%s() ->\n", __file__, __func__); + pr_debug(KBUILD_MODNAME ": %s:%s() ->\n", + KBUILD_BASENAME".c", __func__); return _errno; } @@ -4252,7 +4257,8 @@ module_init(dpa_load); static void __exit __cold dpa_unload(void) { - cpu_pr_debug(KBUILD_MODNAME ": -> %s:%s()\n", __file__, __func__); + pr_debug(KBUILD_MODNAME ": -> %s:%s()\n", + KBUILD_BASENAME".c", __func__); platform_driver_unregister(&dpa_driver); @@ -4260,6 +4266,7 @@ static void __exit __cold dpa_unload(void) debugfs_remove(dpa_debugfs_root); #endif - cpu_pr_debug(KBUILD_MODNAME ": %s:%s() ->\n", __file__, __func__); + pr_debug(KBUILD_MODNAME ": %s:%s() ->\n", + KBUILD_BASENAME".c", __func__); } module_exit(dpa_unload); diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth_sg.c b/drivers/net/ethernet/freescale/dpa/dpaa_eth_sg.c index 1acf303..d183503 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_eth_sg.c +++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth_sg.c @@ -30,6 +30,10 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#define pr_fmt(fmt) \ + KBUILD_MODNAME ": %s:%hu:%s() " fmt, \ + KBUILD_BASENAME".c", __LINE__, __func__ + #include <linux/init.h> #include <linux/skbuff.h> #include <linux/highmem.h> @@ -76,7 +80,7 @@ static void dpa_bp_add_page(struct dpa_bp *dpa_bp, unsigned long vaddr) addr = dma_map_single(dpa_bp->dev, (void *)vaddr, dpa_bp->size, DMA_BIDIRECTIONAL); if (unlikely(dma_mapping_error(dpa_bp->dev, addr))) { - dpaa_eth_err(dpa_bp->dev, "DMA mapping failed"); + dev_err(dpa_bp->dev, "DMA mapping failed"); return; } @@ -459,7 +463,7 @@ void __hot _dpa_rx(struct net_device *net_dev, if (unlikely(fd_status & FM_FD_STAT_ERRORS) != 0) { if (netif_msg_hw(priv) && net_ratelimit()) - cpu_netdev_warn(net_dev, "FD status = 0x%08x\n", + netdev_warn(net_dev, "FD status = 0x%08x\n", fd_status & FM_FD_STAT_ERRORS); percpu_stats->rx_errors++; @@ -475,7 +479,7 @@ void __hot _dpa_rx(struct net_device *net_dev, DPA_COPIED_HEADERS_SIZE); if (unlikely(skb == NULL)) { if (netif_msg_rx_err(priv) && net_ratelimit()) - cpu_netdev_err(net_dev, + netdev_err(net_dev, "Could not alloc skb\n"); percpu_stats->rx_dropped++; goto _release_frame; @@ -581,7 +585,7 @@ static int __hot skb_to_contig_fd(struct dpa_priv_s *priv, ((char *)skbh) + DPA_TX_PRIV_DATA_SIZE); if (unlikely(err < 0)) { if (netif_msg_tx_err(priv) && net_ratelimit()) - cpu_netdev_err(net_dev, "HW csum error: %d\n", err); + netdev_err(net_dev, "HW csum error: %d\n", err); return err; } @@ -593,7 +597,7 @@ static int __hot skb_to_contig_fd(struct dpa_priv_s *priv, addr = dma_map_single(dpa_bp->dev, skbh, dpa_bp->size, DMA_TO_DEVICE); if (unlikely(dma_mapping_error(dpa_bp->dev, addr))) { if (netif_msg_tx_err(priv) && net_ratelimit()) - cpu_netdev_err(net_dev, "dma_map_single() failed\n"); + netdev_err(net_dev, "dma_map_single() failed\n"); return -EINVAL; } fd->addr_hi = upper_32_bits(addr); @@ -623,7 +627,7 @@ static int __hot skb_to_sg_fd(struct dpa_priv_s *priv, /* get a new page to store the SGTable */ sgt_page = __get_free_page(GFP_ATOMIC); if (unlikely(!sgt_page)) { - dpaa_eth_err(dpa_bp->dev, "__get_free_page() failed\n"); + dev_err(dpa_bp->dev, "__get_free_page() failed\n"); return -ENOMEM; } @@ -637,7 +641,7 @@ static int __hot skb_to_sg_fd(struct dpa_priv_s *priv, (void *)sgt_page + DPA_TX_PRIV_DATA_SIZE); if (unlikely(err < 0)) { if (netif_msg_tx_err(priv) && net_ratelimit()) - cpu_netdev_err(net_dev, "HW csum error: %d\n", err); + netdev_err(net_dev, "HW csum error: %d\n", err); goto csum_failed; } @@ -649,7 +653,7 @@ static int __hot skb_to_sg_fd(struct dpa_priv_s *priv, sgt[0].final = 0; addr = dma_map_single(dpa_bp->dev, skb->data, sgt[0].length, dma_dir); if (unlikely(dma_mapping_error(dpa_bp->dev, addr))) { - dpaa_eth_err(dpa_bp->dev, "DMA mapping failed"); + dev_err(dpa_bp->dev, "DMA mapping failed"); err = -EINVAL; goto sg0_map_failed; @@ -673,7 +677,7 @@ static int __hot skb_to_sg_fd(struct dpa_priv_s *priv, frag->page_offset, dpa_bp->size, dma_dir); if (unlikely(dma_mapping_error(dpa_bp->dev, addr))) { - dpaa_eth_err(dpa_bp->dev, "DMA mapping failed"); + dev_err(dpa_bp->dev, "DMA mapping failed"); err = -EINVAL; goto sg_map_failed; } @@ -694,7 +698,7 @@ static int __hot skb_to_sg_fd(struct dpa_priv_s *priv, addr = dma_map_single(dpa_bp->dev, buffer_start, dpa_bp->size, dma_dir); if (unlikely(dma_mapping_error(dpa_bp->dev, addr))) { - dpaa_eth_err(dpa_bp->dev, "DMA mapping failed"); + dev_err(dpa_bp->dev, "DMA mapping failed"); err = -EINVAL; goto sgt_map_failed; } diff --git a/drivers/net/ethernet/freescale/dpa/mac-api.c b/drivers/net/ethernet/freescale/dpa/mac-api.c index beb33b1..1195c05 100644 --- a/drivers/net/ethernet/freescale/dpa/mac-api.c +++ b/drivers/net/ethernet/freescale/dpa/mac-api.c @@ -29,6 +29,10 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#define pr_fmt(fmt) \ + KBUILD_MODNAME ": %s:%hu:%s() " fmt, \ + KBUILD_BASENAME".c", __LINE__, __func__ + #include <linux/init.h> #include <linux/module.h> #include <linux/of_platform.h> @@ -110,7 +114,7 @@ static void mac_exception(t_Handle _mac_dev, e_FmMacExceptions exception) printk(KERN_ERR "10G MAC got RX FIFO Error = %x\n", exception); } - cpu_dev_dbg(mac_dev->dev, "%s:%s() -> %d\n", __file__, __func__, + dev_dbg(mac_dev->dev, "%s:%s() -> %d\n", KBUILD_BASENAME".c", __func__, exception); } @@ -138,7 +142,7 @@ static int __devinit __cold init(struct mac_device *mac_dev) priv->mac = FM_MAC_Config(¶m); if (unlikely(priv->mac == NULL)) { - dpaa_eth_err(mac_dev->dev, "FM_MAC_Config() failed\n"); + dev_err(mac_dev->dev, "FM_MAC_Config() failed\n"); _errno = -EINVAL; goto _return; } @@ -151,7 +155,7 @@ static int __devinit __cold init(struct mac_device *mac_dev) fm_get_max_frm()); _errno = -GET_ERROR_TYPE(err); if (unlikely(_errno < 0)) { - dpaa_eth_err(mac_dev->dev, + dev_err(mac_dev->dev, "FM_MAC_ConfigMaxFrameLength() = 0x%08x\n", err); goto _return_fm_mac_free; } @@ -161,7 +165,7 @@ static int __devinit __cold init(struct mac_device *mac_dev) err = FM_MAC_ConfigPadAndCrc(priv->mac, true); _errno = -GET_ERROR_TYPE(err); if (unlikely(_errno < 0)) { - dpaa_eth_err(mac_dev->dev, + dev_err(mac_dev->dev, "FM_MAC_ConfigPadAndCrc() = 0x%08x\n", err); goto _return_fm_mac_free; } @@ -169,7 +173,7 @@ static int __devinit __cold init(struct mac_device *mac_dev) err = FM_MAC_ConfigHalfDuplex(priv->mac, mac_dev->half_duplex); _errno = -GET_ERROR_TYPE(err); if (unlikely(_errno < 0)) { - dpaa_eth_err(mac_dev->dev, + dev_err(mac_dev->dev, "FM_MAC_ConfigHalfDuplex() = 0x%08x\n", err); goto _return_fm_mac_free; } @@ -178,7 +182,7 @@ static int __devinit __cold init(struct mac_device *mac_dev) err = FM_MAC_ConfigResetOnInit(priv->mac, true); _errno = -GET_ERROR_TYPE(err); if (unlikely(_errno < 0)) { - dpaa_eth_err(mac_dev->dev, + dev_err(mac_dev->dev, "FM_MAC_ConfigResetOnInit() = 0x%08x\n", err); goto _return_fm_mac_free; } @@ -187,7 +191,7 @@ static int __devinit __cold init(struct mac_device *mac_dev) err = FM_MAC_Init(priv->mac); _errno = -GET_ERROR_TYPE(err); if (unlikely(_errno < 0)) { - dpaa_eth_err(mac_dev->dev, "FM_MAC_Init() = 0x%08x\n", err); + dev_err(mac_dev->dev, "FM_MAC_Init() = 0x%08x\n", err); goto _return_fm_mac_free; } @@ -198,7 +202,7 @@ static int __devinit __cold init(struct mac_device *mac_dev) e_FM_MAC_EX_1G_RX_MIB_CNT_OVFL, FALSE); _errno = -GET_ERROR_TYPE(err); if (unlikely(_errno < 0)) { - dpaa_eth_err(mac_dev->dev, + dev_err(mac_dev->dev, "FM_MAC_SetException() = 0x%08x\n", err); goto _return_fm_mac_free; } @@ -211,7 +215,7 @@ static int __devinit __cold init(struct mac_device *mac_dev) e_FM_MAC_EX_10G_1TX_ECC_ER, FALSE); _errno = -GET_ERROR_TYPE(err); if (unlikely(_errno < 0)) { - dpaa_eth_err(mac_dev->dev, + dev_err(mac_dev->dev, "FM_MAC_SetException() = 0x%08x\n", err); goto _return_fm_mac_free; } @@ -220,11 +224,11 @@ static int __devinit __cold init(struct mac_device *mac_dev) err = FM_MAC_GetVesrion(priv->mac, &version); _errno = -GET_ERROR_TYPE(err); if (unlikely(_errno < 0)) { - dpaa_eth_err(mac_dev->dev, "FM_MAC_GetVesrion() = 0x%08x\n", + dev_err(mac_dev->dev, "FM_MAC_GetVesrion() = 0x%08x\n", err); goto _return_fm_mac_free; } - cpu_dev_info(mac_dev->dev, "FMan %s version: 0x%08x\n", + dev_info(mac_dev->dev, "FMan %s version: 0x%08x\n", ((macdev2enetinterface(mac_dev) != e_ENET_MODE_XGMII_10000) ? "dTSEC" : "XGEC"), version); @@ -234,7 +238,7 @@ static int __devinit __cold init(struct mac_device *mac_dev) _return_fm_mac_free: err = FM_MAC_Free(priv->mac); if (unlikely(-GET_ERROR_TYPE(err) < 0)) - dpaa_eth_err(mac_dev->dev, "FM_MAC_Free() = 0x%08x\n", err); + dev_err(mac_dev->dev, "FM_MAC_Free() = 0x%08x\n", err); _return: return _errno; } @@ -311,7 +315,7 @@ static int __cold start(struct mac_device *mac_dev) e_COMM_MODE_RX_AND_TX); _errno = -GET_ERROR_TYPE(err); if (unlikely(_errno < 0)) - dpaa_eth_err(mac_dev->dev, "FM_MAC_Enable() = 0x%08x\n", err); + dev_err(mac_dev->dev, "FM_MAC_Enable() = 0x%08x\n", err); if (phy_dev) { if (macdev2enetinterface(mac_dev) != e_ENET_MODE_XGMII_10000) @@ -336,7 +340,7 @@ static int __cold stop(struct mac_device *mac_dev) e_COMM_MODE_RX_AND_TX); _errno = -GET_ERROR_TYPE(err); if (unlikely(_errno < 0)) - dpaa_eth_err(mac_dev->dev, "FM_MAC_Disable() = 0x%08x\n", err); + dev_err(mac_dev->dev, "FM_MAC_Disable() = 0x%08x\n", err); return _errno; } @@ -351,7 +355,7 @@ static int __cold change_promisc(struct mac_device *mac_dev) mac_dev->promisc = !mac_dev->promisc); _errno = -GET_ERROR_TYPE(err); if (unlikely(_errno < 0)) - dpaa_eth_err(mac_dev->dev, + dev_err(mac_dev->dev, "FM_MAC_SetPromiscuous() = 0x%08x\n", err); return _errno; @@ -377,7 +381,7 @@ static int __cold set_multi(struct net_device *net_dev) (t_EnetAddr *)old_addr->addr); _errno = -GET_ERROR_TYPE(err); if (_errno < 0) { - dpaa_eth_err(mac_dev->dev, + dev_err(mac_dev->dev, "FM_MAC_RemoveHashMacAddr() = 0x%08x\n", err); return _errno; } @@ -391,13 +395,13 @@ static int __cold set_multi(struct net_device *net_dev) (t_EnetAddr *)ha->addr); _errno = -GET_ERROR_TYPE(err); if (_errno < 0) { - dpaa_eth_err(mac_dev->dev, + dev_err(mac_dev->dev, "FM_MAC_AddHashMacAddr() = 0x%08x\n", err); return _errno; } tmp = kmalloc(sizeof(struct mac_address), GFP_ATOMIC); if (!tmp) { - dpaa_eth_err(mac_dev->dev, "Out of memory\n"); + dev_err(mac_dev->dev, "Out of memory\n"); return -ENOMEM; } memcpy(tmp->addr, ha->addr, ETH_ALEN); @@ -416,7 +420,7 @@ static int __cold change_addr(struct mac_device *mac_dev, uint8_t *addr) (t_EnetAddr *)addr); _errno = -GET_ERROR_TYPE(err); if (_errno < 0) - dpaa_eth_err(mac_dev->dev, + dev_err(mac_dev->dev, "FM_MAC_ModifyMacAddr() = 0x%08x\n", err); return _errno; @@ -456,7 +460,7 @@ static void adjust_link(struct net_device *net_dev) phy_dev->speed, phy_dev->duplex); _errno = -GET_ERROR_TYPE(err); if (unlikely(_errno < 0)) - dpaa_eth_err(mac_dev->dev, "FM_MAC_AdjustLink() = 0x%08x\n", + dev_err(mac_dev->dev, "FM_MAC_AdjustLink() = 0x%08x\n", err); return; @@ -481,7 +485,7 @@ static int dtsec_init_phy(struct net_device *net_dev) phy_dev = of_phy_connect(net_dev, mac_dev->phy_node, &adjust_link, 0, mac_dev->phy_if); if (unlikely(phy_dev == NULL) || IS_ERR(phy_dev)) { - cpu_netdev_err(net_dev, "Could not connect to PHY %s\n", + netdev_err(net_dev, "Could not connect to PHY %s\n", mac_dev->phy_node ? mac_dev->phy_node->full_name : mac_dev->fixed_bus_id); @@ -510,7 +514,7 @@ static int xgmac_init_phy(struct net_device *net_dev) phy_dev = of_phy_attach(net_dev, mac_dev->phy_node, 0, mac_dev->phy_if); if (unlikely(phy_dev == NULL) || IS_ERR(phy_dev)) { - cpu_netdev_err(net_dev, "Could not attach to PHY %s\n", + netdev_err(net_dev, "Could not attach to PHY %s\n", mac_dev->phy_node ? mac_dev->phy_node->full_name : mac_dev->fixed_bus_id); @@ -578,12 +582,12 @@ static int __cold uninit(struct mac_device *mac_dev) err = FM_MAC_Disable(priv->mac, e_COMM_MODE_RX_AND_TX); _errno = -GET_ERROR_TYPE(err); if (unlikely(_errno < 0)) - dpaa_eth_err(mac_dev->dev, "FM_MAC_Disable() = 0x%08x\n", err); + dev_err(mac_dev->dev, "FM_MAC_Disable() = 0x%08x\n", err); err = FM_MAC_Free(priv->mac); __errno = -GET_ERROR_TYPE(err); if (unlikely(__errno < 0)) { - dpaa_eth_err(mac_dev->dev, "FM_MAC_Free() = 0x%08x\n", err); + dev_err(mac_dev->dev, "FM_MAC_Free() = 0x%08x\n", err); if (_errno < 0) _errno = __errno; } @@ -602,7 +606,7 @@ static int __cold ptp_enable(struct mac_device *mac_dev) err = FM_MAC_Enable1588TimeStamp(priv->mac); _errno = -GET_ERROR_TYPE(err); if (unlikely(_errno < 0)) - dpaa_eth_err(mac_dev->dev, "FM_MAC_Enable1588TimeStamp()" + dev_err(mac_dev->dev, "FM_MAC_Enable1588TimeStamp()" "= 0x%08x\n", err); return _errno; } @@ -618,7 +622,7 @@ static int __cold ptp_disable(struct mac_device *mac_dev) err = FM_MAC_Disable1588TimeStamp(priv->mac); _errno = -GET_ERROR_TYPE(err); if (unlikely(_errno < 0)) - dpaa_eth_err(mac_dev->dev, "FM_MAC_Disable1588TimeStamp()" + dev_err(mac_dev->dev, "FM_MAC_Disable1588TimeStamp()" "= 0x%08x\n", err); return _errno; } @@ -640,7 +644,7 @@ static int __cold fm_rtc_enable(struct net_device *net_dev) err = FM_RTC_Enable(fm_get_rtc_handle(mac_dev->fm_dev), 0); _errno = -GET_ERROR_TYPE(err); if (unlikely(_errno < 0)) - dpaa_eth_err(mac_dev->dev, "FM_RTC_Enable = 0x%08x\n", err); + dev_err(mac_dev->dev, "FM_RTC_Enable = 0x%08x\n", err); return _errno; } @@ -655,7 +659,7 @@ static int __cold fm_rtc_disable(struct net_device *net_dev) err = FM_RTC_Disable(fm_get_rtc_handle(mac_dev->fm_dev)); _errno = -GET_ERROR_TYPE(err); if (unlikely(_errno < 0)) - dpaa_eth_err(mac_dev->dev, "FM_RTC_Disable = 0x%08x\n", err); + dev_err(mac_dev->dev, "FM_RTC_Disable = 0x%08x\n", err); return _errno; } @@ -670,7 +674,7 @@ static int __cold fm_rtc_get_cnt(struct net_device *net_dev, uint64_t *ts) err = FM_RTC_GetCurrentTime(fm_get_rtc_handle(mac_dev->fm_dev), ts); _errno = -GET_ERROR_TYPE(err); if (unlikely(_errno < 0)) - dpaa_eth_err(mac_dev->dev, "FM_RTC_GetCurrentTime = 0x%08x\n", + dev_err(mac_dev->dev, "FM_RTC_GetCurrentTime = 0x%08x\n", err); return _errno; @@ -686,7 +690,7 @@ static int __cold fm_rtc_set_cnt(struct net_device *net_dev, uint64_t ts) err = FM_RTC_SetCurrentTime(fm_get_rtc_handle(mac_dev->fm_dev), ts); _errno = -GET_ERROR_TYPE(err); if (unlikely(_errno < 0)) - dpaa_eth_err(mac_dev->dev, "FM_RTC_SetCurrentTime = 0x%08x\n", + dev_err(mac_dev->dev, "FM_RTC_SetCurrentTime = 0x%08x\n", err); return _errno; @@ -703,7 +707,7 @@ static int __cold fm_rtc_get_drift(struct net_device *net_dev, uint32_t *drift) drift); _errno = -GET_ERROR_TYPE(err); if (unlikely(_errno < 0)) - dpaa_eth_err(mac_dev->dev, "FM_RTC_GetFreqCompensation =" + dev_err(mac_dev->dev, "FM_RTC_GetFreqCompensation =" "0x%08x\n", err); return _errno; @@ -720,7 +724,7 @@ static int __cold fm_rtc_set_drift(struct net_device *net_dev, uint32_t drift) drift); _errno = -GET_ERROR_TYPE(err); if (unlikely(_errno < 0)) - dpaa_eth_err(mac_dev->dev, "FM_RTC_SetFreqCompensation =" + dev_err(mac_dev->dev, "FM_RTC_SetFreqCompensation =" "0x%08x\n", err); return _errno; @@ -742,7 +746,7 @@ static int __cold fm_rtc_set_alarm(struct net_device *net_dev, uint32_t id, &alarm); _errno = -GET_ERROR_TYPE(err); if (unlikely(_errno < 0)) - dpaa_eth_err(mac_dev->dev, "FM_RTC_SetAlarm =" + dev_err(mac_dev->dev, "FM_RTC_SetAlarm =" "0x%08x\n", err); return _errno; @@ -763,7 +767,7 @@ static int __cold fm_rtc_set_fiper(struct net_device *net_dev, uint32_t id, err = FM_RTC_SetPeriodicPulse(fm_get_rtc_handle(mac_dev->fm_dev), &pp); _errno = -GET_ERROR_TYPE(err); if (unlikely(_errno < 0)) - dpaa_eth_err(mac_dev->dev, "FM_RTC_SetPeriodicPulse =" + dev_err(mac_dev->dev, "FM_RTC_SetPeriodicPulse =" "0x%08x\n", err); return _errno; diff --git a/drivers/net/ethernet/freescale/dpa/mac.c b/drivers/net/ethernet/freescale/dpa/mac.c index 7594b56..8915cf4 100644 --- a/drivers/net/ethernet/freescale/dpa/mac.c +++ b/drivers/net/ethernet/freescale/dpa/mac.c @@ -29,6 +29,10 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#define pr_fmt(fmt) \ + KBUILD_MODNAME ": %s:%hu:%s() " fmt, \ + KBUILD_BASENAME".c", __LINE__, __func__ + #include <linux/init.h> #include <linux/module.h> #include <linux/of_platform.h> @@ -156,7 +160,7 @@ static int __devinit __cold mac_probe(struct platform_device *_of_dev) mac_dev = alloc_macdev(dev, mac_sizeof_priv[i], mac_setup[i]); if (IS_ERR(mac_dev)) { _errno = PTR_ERR(mac_dev); - dpaa_eth_err(dev, "alloc_macdev() = %d\n", _errno); + dev_err(dev, "alloc_macdev() = %d\n", _errno); goto _return; } @@ -165,7 +169,7 @@ static int __devinit __cold mac_probe(struct platform_device *_of_dev) /* Get the FM node */ dev_node = of_get_parent(mac_node); if (unlikely(dev_node == NULL)) { - dpaa_eth_err(dev, "of_get_parent(%s) failed\n", + dev_err(dev, "of_get_parent(%s) failed\n", mac_node->full_name); _errno = -EINVAL; goto _return_dev_set_drvdata; @@ -173,7 +177,7 @@ static int __devinit __cold mac_probe(struct platform_device *_of_dev) of_dev = of_find_device_by_node(dev_node); if (unlikely(of_dev == NULL)) { - dpaa_eth_err(dev, "of_find_device_by_node(%s) failed\n", + dev_err(dev, "of_find_device_by_node(%s) failed\n", dev_node->full_name); _errno = -EINVAL; goto _return_of_node_put; @@ -181,7 +185,7 @@ static int __devinit __cold mac_probe(struct platform_device *_of_dev) mac_dev->fm_dev = fm_bind(&of_dev->dev); if (unlikely(mac_dev->fm_dev == NULL)) { - dpaa_eth_err(dev, "fm_bind(%s) failed\n", dev_node->full_name); + dev_err(dev, "fm_bind(%s) failed\n", dev_node->full_name); _errno = -ENODEV; goto _return_of_node_put; } @@ -192,7 +196,7 @@ static int __devinit __cold mac_probe(struct platform_device *_of_dev) /* Get the address of the memory mapped registers */ _errno = of_address_to_resource(mac_node, 0, &res); if (unlikely(_errno < 0)) { - dpaa_eth_err(dev, "of_address_to_resource(%s) = %d\n", + dev_err(dev, "of_address_to_resource(%s) = %d\n", mac_node->full_name, _errno); goto _return_dev_set_drvdata; } @@ -202,7 +206,7 @@ static int __devinit __cold mac_probe(struct platform_device *_of_dev) fm_get_mem_region(mac_dev->fm_dev), res.start, res.end + 1 - res.start, "mac"); if (unlikely(mac_dev->res == NULL)) { - dpaa_eth_err(dev, "__devm_request_mem_region(mac) failed\n"); + dev_err(dev, "__devm_request_mem_region(mac) failed\n"); _errno = -EBUSY; goto _return_dev_set_drvdata; } @@ -210,7 +214,7 @@ static int __devinit __cold mac_probe(struct platform_device *_of_dev) mac_dev->vaddr = devm_ioremap(dev, mac_dev->res->start, mac_dev->res->end + 1 - mac_dev->res->start); if (unlikely(mac_dev->vaddr == NULL)) { - dpaa_eth_err(dev, "devm_ioremap() failed\n"); + dev_err(dev, "devm_ioremap() failed\n"); _errno = -EIO; goto _return_dev_set_drvdata; } @@ -245,7 +249,7 @@ static int __devinit __cold mac_probe(struct platform_device *_of_dev) /* Get the cell-index */ uint32_prop = of_get_property(mac_node, "cell-index", &lenp); if (unlikely(uint32_prop == NULL)) { - dpaa_eth_err(dev, "of_get_property(%s, cell-index) failed\n", + dev_err(dev, "of_get_property(%s, cell-index) failed\n", mac_node->full_name); _errno = -EINVAL; goto _return_dev_set_drvdata; @@ -256,7 +260,7 @@ static int __devinit __cold mac_probe(struct platform_device *_of_dev) /* Get the MAC address */ mac_addr = of_get_mac_address(mac_node); if (unlikely(mac_addr == NULL)) { - dpaa_eth_err(dev, "of_get_mac_address(%s) failed\n", + dev_err(dev, "of_get_mac_address(%s) failed\n", mac_node->full_name); _errno = -EINVAL; goto _return_dev_set_drvdata; @@ -266,7 +270,7 @@ static int __devinit __cold mac_probe(struct platform_device *_of_dev) /* Get the port handles */ phandle_prop = of_get_property(mac_node, "fsl,port-handles", &lenp); if (unlikely(phandle_prop == NULL)) { - dpaa_eth_err(dev, "of_get_property(%s, port-handles) failed\n", + dev_err(dev, "of_get_property(%s, port-handles) failed\n", mac_node->full_name); _errno = -EINVAL; goto _return_dev_set_drvdata; @@ -277,14 +281,14 @@ static int __devinit __cold mac_probe(struct platform_device *_of_dev) /* Find the port node */ dev_node = of_find_node_by_phandle(phandle_prop[i]); if (unlikely(dev_node == NULL)) { - dpaa_eth_err(dev, "of_find_node_by_phandle() failed\n"); + dev_err(dev, "of_find_node_by_phandle() failed\n"); _errno = -EINVAL; goto _return_of_node_put; } of_dev = of_find_device_by_node(dev_node); if (unlikely(of_dev == NULL)) { - dpaa_eth_err(dev, "of_find_device_by_node(%s) failed\n", + dev_err(dev, "of_find_device_by_node(%s) failed\n", dev_node->full_name); _errno = -EINVAL; goto _return_of_node_put; @@ -292,7 +296,7 @@ static int __devinit __cold mac_probe(struct platform_device *_of_dev) mac_dev->port_dev[i] = fm_port_bind(&of_dev->dev); if (unlikely(mac_dev->port_dev[i] == NULL)) { - dpaa_eth_err(dev, "dev_get_drvdata(%s) failed\n", + dev_err(dev, "dev_get_drvdata(%s) failed\n", dev_node->full_name); _errno = -EINVAL; goto _return_of_node_put; @@ -304,7 +308,7 @@ static int __devinit __cold mac_probe(struct platform_device *_of_dev) char_prop = (const char *)of_get_property(mac_node, "phy-connection-type", NULL); if (unlikely(char_prop == NULL)) { - dpaa_eth_warning(dev, + dev_warn(dev, "of_get_property(%s, phy-connection-type) " "failed. Defaulting to MII\n", mac_node->full_name); @@ -337,7 +341,7 @@ static int __devinit __cold mac_probe(struct platform_device *_of_dev) const u32 *phy_id = of_get_property(mac_node, "fixed-link", &sz); if (!phy_id || sz < sizeof(*phy_id)) { - cpu_dev_err(dev, "No PHY (or fixed link) found\n"); + dev_err(dev, "No PHY (or fixed link) found\n"); _errno = -EINVAL; goto _return_dev_set_drvdata; } @@ -347,11 +351,11 @@ static int __devinit __cold mac_probe(struct platform_device *_of_dev) _errno = mac_dev->init(mac_dev); if (unlikely(_errno < 0)) { - dpaa_eth_err(dev, "mac_dev->init() = %d\n", _errno); + dev_err(dev, "mac_dev->init() = %d\n", _errno); goto _return_dev_set_drvdata; } - cpu_dev_info(dev, + dev_info(dev, "FMan MAC address: %02hx:%02hx:%02hx:%02hx:%02hx:%02hx\n", mac_dev->addr[0], mac_dev->addr[1], mac_dev->addr[2], mac_dev->addr[3], mac_dev->addr[4], mac_dev->addr[5]); @@ -399,23 +403,25 @@ static int __init __cold mac_load(void) { int _errno; - cpu_pr_debug(KBUILD_MODNAME ": -> %s:%s()\n", __file__, __func__); + pr_debug(KBUILD_MODNAME ": -> %s:%s()\n", + KBUILD_BASENAME".c", __func__); - cpu_pr_info(KBUILD_MODNAME ": %s (" VERSION ")\n", + pr_info(KBUILD_MODNAME ": %s (" VERSION ")\n", mac_driver_description); _errno = platform_driver_register(&mac_driver); if (unlikely(_errno < 0)) { - cpu_pr_err(KBUILD_MODNAME ": %s:%hu:%s(): " \ + pr_err(KBUILD_MODNAME ": %s:%hu:%s(): " \ "platform_driver_register() = %d\n", - __file__, __LINE__, __func__, _errno); + KBUILD_BASENAME".c", __LINE__, __func__, _errno); goto _return; } goto _return; _return: - cpu_pr_debug(KBUILD_MODNAME ": %s:%s() ->\n", __file__, __func__); + pr_debug(KBUILD_MODNAME ": %s:%s() ->\n", + KBUILD_BASENAME".c", __func__); return _errno; } @@ -423,10 +429,12 @@ module_init(mac_load); static void __exit __cold mac_unload(void) { - cpu_pr_debug(KBUILD_MODNAME ": -> %s:%s()\n", __file__, __func__); + pr_debug(KBUILD_MODNAME ": -> %s:%s()\n", + KBUILD_BASENAME".c", __func__); platform_driver_unregister(&mac_driver); - cpu_pr_debug(KBUILD_MODNAME ": %s:%s() ->\n", __file__, __func__); + pr_debug(KBUILD_MODNAME ": %s:%s() ->\n", + KBUILD_BASENAME".c", __func__); } module_exit(mac_unload); diff --git a/drivers/net/ethernet/freescale/dpa/offline_port.c b/drivers/net/ethernet/freescale/dpa/offline_port.c index c11dc3e..691cd48 100644 --- a/drivers/net/ethernet/freescale/dpa/offline_port.c +++ b/drivers/net/ethernet/freescale/dpa/offline_port.c @@ -35,6 +35,10 @@ * Validates device-tree configuration and sets up the offline ports. */ +#define pr_fmt(fmt) \ + KBUILD_MODNAME ": %s:%hu:%s() " fmt, \ + KBUILD_BASENAME".c", __LINE__, __func__ + #include <linux/init.h> #include <linux/module.h> #include <linux/of_platform.h> @@ -79,7 +83,7 @@ static int __devinit __cold oh_alloc_pcd_fqids(struct device *dev, uint8_t alignment, uint32_t *base_fqid) { - cpu_dev_crit(dev, "callback not implemented!\n"); + dev_crit(dev, "callback not implemented!\n"); BUG(); return 0; @@ -87,7 +91,7 @@ static int __devinit __cold oh_alloc_pcd_fqids(struct device *dev, static int __devinit __cold oh_free_pcd_fqids(struct device *dev, uint32_t base_fqid) { - dpaa_eth_crit(dev, "callback not implemented!\n"); + dev_crit(dev, "callback not implemented!\n"); BUG(); return 0; @@ -122,7 +126,7 @@ oh_port_probe(struct platform_device *_of_dev) if (!match) return -EINVAL; - cpu_dev_dbg(dpa_oh_dev, "Probing OH port...\n"); + dev_dbg(dpa_oh_dev, "Probing OH port...\n"); /* * Find the referenced OH node @@ -131,14 +135,14 @@ oh_port_probe(struct platform_device *_of_dev) oh_port_handle = of_get_property(dpa_oh_node, "fsl,fman-oh-port", &lenp); if (oh_port_handle == NULL) { - cpu_dev_err(dpa_oh_dev, "No OH port handle found in node %s\n", + dev_err(dpa_oh_dev, "No OH port handle found in node %s\n", dpa_oh_node->full_name); return -EINVAL; } BUG_ON(lenp % sizeof(*oh_port_handle)); if (lenp != sizeof(*oh_port_handle)) { - cpu_dev_err(dpa_oh_dev, "Found %lu OH port bindings in node %s," + dev_err(dpa_oh_dev, "Found %lu OH port bindings in node %s," " only 1 phandle is allowed.\n", (unsigned long int)(lenp / sizeof(*oh_port_handle)), dpa_oh_node->full_name); @@ -148,11 +152,11 @@ oh_port_probe(struct platform_device *_of_dev) /* Read configuration for the OH port */ oh_node = of_find_node_by_phandle(*oh_port_handle); if (oh_node == NULL) { - cpu_dev_err(dpa_oh_dev, "Can't find OH node referenced from " + dev_err(dpa_oh_dev, "Can't find OH node referenced from " "node %s\n", dpa_oh_node->full_name); return -EINVAL; } - cpu_dev_info(dpa_oh_dev, "Found OH node handle compatible with %s.\n", + dev_info(dpa_oh_dev, "Found OH node handle compatible with %s.\n", match->compatible); oh_of_dev = of_find_device_by_node(oh_node); @@ -177,7 +181,7 @@ oh_port_probe(struct platform_device *_of_dev) /* If we aren't the "owner" of the OH node, we're done here. */ if (!init_oh_port) { - cpu_dev_dbg(dpa_oh_dev, "Not owning the shared OH port %s, " + dev_dbg(dpa_oh_dev, "Not owning the shared OH port %s, " "will not initialize it.\n", oh_node->full_name); return 0; } @@ -185,7 +189,7 @@ oh_port_probe(struct platform_device *_of_dev) /* Allocate OH dev private data */ oh_config = devm_kzalloc(dpa_oh_dev, sizeof(*oh_config), GFP_KERNEL); if (oh_config == NULL) { - cpu_dev_err(dpa_oh_dev, "Can't allocate private data for " + dev_err(dpa_oh_dev, "Can't allocate private data for " "OH node %s referenced from node %s!\n", oh_node->full_name, dpa_oh_node->full_name); return -ENOMEM; @@ -197,7 +201,7 @@ oh_port_probe(struct platform_device *_of_dev) oh_all_queues = (uint32_t *)of_get_property(dpa_oh_node, "fsl,qman-frame-queues-oh", &lenp); if (oh_all_queues == NULL) { - cpu_dev_err(dpa_oh_dev, "No frame queues have been " + dev_err(dpa_oh_dev, "No frame queues have been " "defined for OH node %s referenced from node %s\n", oh_node->full_name, dpa_oh_node->full_name); _errno = -EINVAL; @@ -208,7 +212,7 @@ oh_port_probe(struct platform_device *_of_dev) BUG_ON(lenp % (2 * sizeof(*oh_all_queues))); queues_count = lenp / (2 * sizeof(*oh_all_queues)); if (queues_count != 2) { - dpaa_eth_err(dpa_oh_dev, "Error and Default queues must be " + dev_err(dpa_oh_dev, "Error and Default queues must be " "defined for OH node %s referenced from node %s\n", oh_node->full_name, dpa_oh_node->full_name); _errno = -EINVAL; @@ -216,14 +220,14 @@ oh_port_probe(struct platform_device *_of_dev) } /* Read the FQIDs defined for this OH port */ - cpu_dev_dbg(dpa_oh_dev, "Reading %d queues...\n", queues_count); + dev_dbg(dpa_oh_dev, "Reading %d queues...\n", queues_count); fq_idx = 0; /* Error FQID - must be present */ crt_fqid_base = oh_all_queues[fq_idx++]; crt_fq_count = oh_all_queues[fq_idx++]; if (crt_fq_count != 1) { - cpu_dev_err(dpa_oh_dev, "Only 1 Error FQ allowed in OH node %s " + dev_err(dpa_oh_dev, "Only 1 Error FQ allowed in OH node %s " "referenced from node %s (read: %d FQIDs).\n", oh_node->full_name, dpa_oh_node->full_name, crt_fq_count); @@ -231,14 +235,14 @@ oh_port_probe(struct platform_device *_of_dev) goto return_kfree; } oh_config->error_fqid = crt_fqid_base; - cpu_dev_dbg(dpa_oh_dev, "Read Error FQID 0x%x for OH port %s.\n", + dev_dbg(dpa_oh_dev, "Read Error FQID 0x%x for OH port %s.\n", oh_config->error_fqid, oh_node->full_name); /* Default FQID - must be present */ crt_fqid_base = oh_all_queues[fq_idx++]; crt_fq_count = oh_all_queues[fq_idx++]; if (crt_fq_count != 1) { - cpu_dev_err(dpa_oh_dev, "Only 1 Default FQ allowed " + dev_err(dpa_oh_dev, "Only 1 Default FQ allowed " "in OH node %s referenced from %s (read: %d FQIDs).\n", oh_node->full_name, dpa_oh_node->full_name, crt_fq_count); @@ -246,14 +250,14 @@ oh_port_probe(struct platform_device *_of_dev) goto return_kfree; } oh_config->default_fqid = crt_fqid_base; - cpu_dev_dbg(dpa_oh_dev, "Read Default FQID 0x%x for OH port %s.\n", + dev_dbg(dpa_oh_dev, "Read Default FQID 0x%x for OH port %s.\n", oh_config->default_fqid, oh_node->full_name); /* Get a handle to the fm_port so we can set * its configuration params */ oh_config->oh_port = fm_port_bind(oh_dev); if (oh_config->oh_port == NULL) { - cpu_dev_err(dpa_oh_dev, "NULL drvdata from fm port dev %s!\n", + dev_err(dpa_oh_dev, "NULL drvdata from fm port dev %s!\n", oh_node->full_name); _errno = -EINVAL; goto return_kfree; @@ -273,7 +277,7 @@ oh_port_probe(struct platform_device *_of_dev) /* Enable the OH port */ fm_port_enable(oh_config->oh_port); - cpu_dev_info(dpa_oh_dev, "OH port %s enabled.\n", oh_node->full_name); + dev_info(dpa_oh_dev, "OH port %s enabled.\n", oh_node->full_name); return 0; @@ -287,20 +291,20 @@ static int __devexit __cold oh_port_remove(struct platform_device *_of_dev) int _errno = 0; struct dpa_oh_config_s *oh_config; - cpu_pr_info("Removing OH port...\n"); + pr_info("Removing OH port...\n"); oh_config = dev_get_drvdata(&_of_dev->dev); if (oh_config == NULL) { - cpu_pr_err(KBUILD_MODNAME + pr_err(KBUILD_MODNAME ": %s:%hu:%s(): No OH config in device private data!\n", - __file__, __LINE__, __func__); + KBUILD_BASENAME".c", __LINE__, __func__); _errno = -ENODEV; goto return_error; } if (oh_config->oh_port == NULL) { - cpu_pr_err(KBUILD_MODNAME + pr_err(KBUILD_MODNAME ": %s:%hu:%s(): No fm port in device private data!\n", - __file__, __LINE__, __func__); + KBUILD_BASENAME".c", __LINE__, __func__); _errno = -EINVAL; goto return_error; } @@ -317,26 +321,29 @@ static int __init __cold oh_port_load(void) { int _errno; - cpu_pr_info(KBUILD_MODNAME ": " OH_MOD_DESCRIPTION " (" VERSION ")\n"); + pr_info(KBUILD_MODNAME ": " OH_MOD_DESCRIPTION " (" VERSION ")\n"); _errno = platform_driver_register(&oh_port_driver); if (_errno < 0) { - cpu_pr_err(KBUILD_MODNAME + pr_err(KBUILD_MODNAME ": %s:%hu:%s(): platform_driver_register() = %d\n", - __file__, __LINE__, __func__, _errno); + KBUILD_BASENAME".c", __LINE__, __func__, _errno); } - cpu_pr_debug(KBUILD_MODNAME ": %s:%s() ->\n", __file__, __func__); + pr_debug(KBUILD_MODNAME ": %s:%s() ->\n", + KBUILD_BASENAME".c", __func__); return _errno; } module_init(oh_port_load); static void __exit __cold oh_port_unload(void) { - cpu_pr_debug(KBUILD_MODNAME ": -> %s:%s()\n", __file__, __func__); + pr_debug(KBUILD_MODNAME ": -> %s:%s()\n", + KBUILD_BASENAME".c", __func__); platform_driver_unregister(&oh_port_driver); - cpu_pr_debug(KBUILD_MODNAME ": %s:%s() ->\n", __file__, __func__); + pr_debug(KBUILD_MODNAME ": %s:%s() ->\n", + KBUILD_BASENAME".c", __func__); } module_exit(oh_port_unload); |