.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * 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". |
---|
15 | 4 | */ |
---|
16 | 5 | |
---|
17 | 6 | #include <linux/module.h> |
---|
.. | .. |
---|
587 | 576 | struct nps_enet_priv *priv; |
---|
588 | 577 | s32 err = 0; |
---|
589 | 578 | const char *mac_addr; |
---|
590 | | - struct resource *res_regs; |
---|
591 | 579 | |
---|
592 | 580 | if (!dev->of_node) |
---|
593 | 581 | return -ENODEV; |
---|
.. | .. |
---|
606 | 594 | /* FIXME :: no multicast support yet */ |
---|
607 | 595 | ndev->flags &= ~IFF_MULTICAST; |
---|
608 | 596 | |
---|
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); |
---|
611 | 598 | if (IS_ERR(priv->regs_base)) { |
---|
612 | 599 | err = PTR_ERR(priv->regs_base); |
---|
613 | 600 | goto out_netdev; |
---|
.. | .. |
---|
616 | 603 | |
---|
617 | 604 | /* set kernel MAC address to dev */ |
---|
618 | 605 | mac_addr = of_get_mac_address(dev->of_node); |
---|
619 | | - if (mac_addr) |
---|
| 606 | + if (!IS_ERR(mac_addr)) |
---|
620 | 607 | ether_addr_copy(ndev->dev_addr, mac_addr); |
---|
621 | 608 | else |
---|
622 | 609 | eth_hw_addr_random(ndev); |
---|