w90p910_ether: remove incorrect __init annotation
Subsystems (2)
PATCH 1/1 w90p910_ether: remove incorrect __init annotation
The get_mac_address() function is normally inline, but when it is not, we get a warning that this configuration is broken:
WARNING: vmlinux.o(.text+0x4aff00): Section mismatch in reference from the function w90p910_ether_setup() to the function .init.text:get_mac_address() The function w90p910_ether_setup() references
the function __init get_mac_address().
This is often because w90p910_ether_setup lacks a __init
Remove the __init to make it always do the right thing.
--- drivers/net/ethernet/nuvoton/w90p910_ether.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/nuvoton/w90p910_ether.c +1 -1
@@ -912,7 +912,7 @@ static const struct net_device_ops w90p910_ether_netdev_ops = { .ndo_validate_addr = eth_validate_addr, }; -static void __init get_mac_address (struct net_device *dev) +static void get_mac_address (struct net_device *dev) {struct w90p910_ether *ether =netdev_priv (dev);struct platform_device *pdev;
Signature · 1 line
2.20.0
David Miller
maintainerFrom: Arnd Bergmann <[email protected]>
Date: Mon, 10 Dec 2018 21:45:07 +0100
Quoted 11 lines
The
get_mac_address()function is normally inline, but when it is not, we get a warning that this configuration is broken:WARNING:
vmlinux.o(.text+0x4aff00): Section mismatch in reference from the functionw90p910_ether_setup()to the function .init.text:get_mac_address() The functionw90p910_ether_setup()references
the function__initget_mac_address().
This is often becausew90p910_ether_setuplacks a__initRemove the
__initto make it always do the right thing.Signed-off-by Arnd Bergmann <[email protected]>
Actually I think we can validly mark w90p910_ether_setup() and w90p910_probe() with appropriate init tagging. None of these functions are invoked outside of the probing paths.
Quoted 12 lines · David Miller
From: Arnd Bergmann <[email protected]>
Date: Mon, 10 Dec 2018 21:45:07 +0100Quoted 8 lines
The
get_mac_address()function is normally inline, but when it is not, we get a warning that this configuration is broken:WARNING:
vmlinux.o(.text+0x4aff00): Section mismatch in reference from the functionw90p910_ether_setup()to the function .init.text:get_mac_address() The functionw90p910_ether_setup()references
the function__initget_mac_address().
This is often becausew90p910_ether_setuplacks a__init
Quoted 7 lines
Quoted 3 lines
Remove the
__initto make it always do the right thing.Signed-off-by Arnd Bergmann <[email protected]>Actually I think we can validly mark
w90p910_ether_setup()andw90p910_probe()with appropriate init tagging. None of these functions are invoked outside of the probing paths.
But then we have to change the driver to use module_platform_driver_probe(), to ensure we cannot unbind/rebind the device. I usually don't like doing that, unless the device can never be stopped after it has been initialized.
Arnd
Arnd
From: Arnd Bergmann <[email protected]>
Date: Fri, 14 Dec 2018 23:22:10 +0100
Quoted 21 lines · David Miller
Quoted 12 lines
From: Arnd Bergmann <[email protected]>
Date: Mon, 10 Dec 2018 21:45:07 +0100Quoted 8 lines
The
get_mac_address()function is normally inline, but when it is not, we get a warning that this configuration is broken:WARNING:
vmlinux.o(.text+0x4aff00): Section mismatch in reference from the functionw90p910_ether_setup()to the function .init.text:get_mac_address() The functionw90p910_ether_setup()references
the function__initget_mac_address().
This is often becausew90p910_ether_setuplacks a__initQuoted 7 lines
Quoted 3 lines
Remove the
__initto make it always do the right thing.Signed-off-by Arnd Bergmann <[email protected]>Actually I think we can validly mark
w90p910_ether_setup()andw90p910_probe()with appropriate init tagging. None of these functions are invoked outside of the probing paths.
Quoted 5 lines
But then we have to change the driver to use
module_platform_driver_probe(), to ensure we cannot unbind/rebind the device. I usually don't like doing that, unless the device can never be stopped after it has been initialized.
Fair enough, let's go with your simpler fix for now.
Applied.