hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/arch/powerpc/sysdev/tsi108_dev.c
....@@ -1,12 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * tsi108/109 device setup code
34 *
45 * Maintained by Roy Zang < tie-fei.zang@freescale.com >
5
- *
6
- * This program is free software; you can redistribute it and/or modify it
7
- * under the terms of the GNU General Public License as published by the
8
- * Free Software Foundation; either version 2 of the License, or (at your
9
- * option) any later version.
106 */
117
128 #include <linux/stddef.h>
....@@ -18,6 +14,7 @@
1814 #include <linux/irq.h>
1915 #include <linux/export.h>
2016 #include <linux/device.h>
17
+#include <linux/etherdevice.h>
2118 #include <linux/platform_device.h>
2219 #include <linux/of_net.h>
2320 #include <asm/tsi108.h>
....@@ -51,7 +48,7 @@
5148 const void *prop = of_get_property(tsi, "reg", &size);
5249 tsi108_csr_base = of_translate_address(tsi, prop);
5350 of_node_put(tsi);
54
- };
51
+ }
5552 return tsi108_csr_base;
5653 }
5754
....@@ -105,8 +102,8 @@
105102 }
106103
107104 mac_addr = of_get_mac_address(np);
108
- if (mac_addr)
109
- memcpy(tsi_eth_data.mac_addr, mac_addr, 6);
105
+ if (!IS_ERR(mac_addr))
106
+ ether_addr_copy(tsi_eth_data.mac_addr, mac_addr);
110107
111108 ph = of_get_property(np, "mdio-handle", NULL);
112109 mdio = of_find_node_by_phandle(*ph);