hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/net/ethernet/ezchip/nps_enet.c
....@@ -1,17 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright(c) 2015 EZchip Technologies.
3
- *
4
- * This program is free software; you can redistribute it and/or modify it
5
- * under the terms and conditions of the GNU General Public License,
6
- * version 2, as published by the Free Software Foundation.
7
- *
8
- * This program is distributed in the hope it will be useful, but WITHOUT
9
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11
- * more details.
12
- *
13
- * The full GNU General Public License is included in this distribution in
14
- * the file called "COPYING".
154 */
165
176 #include <linux/module.h>
....@@ -587,7 +576,6 @@
587576 struct nps_enet_priv *priv;
588577 s32 err = 0;
589578 const char *mac_addr;
590
- struct resource *res_regs;
591579
592580 if (!dev->of_node)
593581 return -ENODEV;
....@@ -606,8 +594,7 @@
606594 /* FIXME :: no multicast support yet */
607595 ndev->flags &= ~IFF_MULTICAST;
608596
609
- res_regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
610
- priv->regs_base = devm_ioremap_resource(dev, res_regs);
597
+ priv->regs_base = devm_platform_ioremap_resource(pdev, 0);
611598 if (IS_ERR(priv->regs_base)) {
612599 err = PTR_ERR(priv->regs_base);
613600 goto out_netdev;
....@@ -616,7 +603,7 @@
616603
617604 /* set kernel MAC address to dev */
618605 mac_addr = of_get_mac_address(dev->of_node);
619
- if (mac_addr)
606
+ if (!IS_ERR(mac_addr))
620607 ether_addr_copy(ndev->dev_addr, mac_addr);
621608 else
622609 eth_hw_addr_random(ndev);