diff mbox series

Incorrect filename in drivers/net/phy/Makefile

Message ID 20210106101712.6360-1-z.han@gmx.net
State New
Headers show
Series Incorrect filename in drivers/net/phy/Makefile | expand

Commit Message

Zhi Han Jan. 6, 2021, 10:17 a.m. UTC
It should be a typing error ('-' instead of '_'), as no mdio-bus.c but
just mdio_bus.c exists.

Just find it when inspecting these code. Tried to compile to test, but
failed to construct an applicable .config file for that. Maybe someone
can do that more skillfully, glad to know how.

Signed-off-by: Zhi Han <z.han@gmx.net>
---
 drivers/net/phy/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--
2.25.1

Comments

Florian Fainelli Jan. 7, 2021, 12:13 a.m. UTC | #1
On 1/6/21 2:17 AM, Zhi Han wrote:
> It should be a typing error ('-' instead of '_'), as no mdio-bus.c but
> just mdio_bus.c exists.
> 
> Just find it when inspecting these code. Tried to compile to test, but
> failed to construct an applicable .config file for that. Maybe someone
> can do that more skillfully, glad to know how.

The change was done on purpose, and your patch does not build with the
attached .config which only enables CONFIG_MDIO_DEVICE but not
CONFIG_PHYLIB, it causes the following linking failure:

  MODPOST Module.symvers
ERROR: modpost: "mdio_device_free" [drivers/net/phy/mdio_bus.ko] undefined!
ERROR: modpost: "mdio_device_reset" [drivers/net/phy/mdio_bus.ko] undefined!
ERROR: modpost: "mdio_device_create" [drivers/net/phy/mdio_bus.ko]
undefined!
ERROR: modpost: "mdio_device_register" [drivers/net/phy/mdio_bus.ko]
undefined!
ERROR: modpost: "mdio_device_bus_match" [drivers/net/phy/mdio_bus.ko]
undefined!
make[1]: *** [scripts/Makefile.modpost:111: Module.symvers] Error 1
make[1]: *** Deleting file 'Module.symvers'
make: *** [Makefile:1396: modules] Error 2
zsh: exit 2     make modules -j33

if you look at the build products you will that mdio_bus.c actually gets
built into mdio-bus.o:

 ls drivers/net/phy/mdio-bus.*
drivers/net/phy/mdio-bus.ko   drivers/net/phy/mdio-bus.mod.c
drivers/net/phy/mdio-bus.o
drivers/net/phy/mdio-bus.mod  drivers/net/phy/mdio-bus.mod.o
Zhi Han Jan. 9, 2021, 9:17 a.m. UTC | #2
Thanks a lot for the .config file.
I also tested it, with mdio-bus.o in the Makefile, glad to got that there is
no problem of that, although I don't know the reason/trick yet.

On Wed, Jan 06, 2021 at 04:13:56PM -0800, Florian Fainelli wrote:
> The change was done on purpose, and your patch does not build with the

> attached .config which only enables CONFIG_MDIO_DEVICE but not

> CONFIG_PHYLIB, it causes the following linking failure:

>

>   MODPOST Module.symvers

> ERROR: modpost: "mdio_device_free" [drivers/net/phy/mdio_bus.ko] undefined!

> ERROR: modpost: "mdio_device_reset" [drivers/net/phy/mdio_bus.ko] undefined!

> ERROR: modpost: "mdio_device_create" [drivers/net/phy/mdio_bus.ko]

> undefined!

> ERROR: modpost: "mdio_device_register" [drivers/net/phy/mdio_bus.ko]

> undefined!

> ERROR: modpost: "mdio_device_bus_match" [drivers/net/phy/mdio_bus.ko]

> undefined!

> make[1]: *** [scripts/Makefile.modpost:111: Module.symvers] Error 1

> make[1]: *** Deleting file 'Module.symvers'

> make: *** [Makefile:1396: modules] Error 2

> zsh: exit 2     make modules -j33

>

> if you look at the build products you will that mdio_bus.c actually gets

> built into mdio-bus.o:

>

>  ls drivers/net/phy/mdio-bus.*

> drivers/net/phy/mdio-bus.ko   drivers/net/phy/mdio-bus.mod.c

> drivers/net/phy/mdio-bus.o

> drivers/net/phy/mdio-bus.mod  drivers/net/phy/mdio-bus.mod.o

>

> --

> Florian
Andrew Lunn Jan. 9, 2021, 7:48 p.m. UTC | #3
On Sat, Jan 09, 2021 at 10:17:38AM +0100, Zhi Han wrote:
> Thanks a lot for the .config file.

> I also tested it, with mdio-bus.o in the Makefile, glad to got that there is

> no problem of that, although I don't know the reason/trick yet.


I'm not 100% sure, but i think:

obj-$(CONFIG_MDIO_DEVICE)       += mdio-bus.o

actually refers back to

mdio-bus-y                      += mdio_bus.o mdio_device.o

	Andrew
Randy Dunlap Jan. 9, 2021, 8:14 p.m. UTC | #4
On 1/9/21 11:48 AM, Andrew Lunn wrote:
> On Sat, Jan 09, 2021 at 10:17:38AM +0100, Zhi Han wrote:

>> Thanks a lot for the .config file.

>> I also tested it, with mdio-bus.o in the Makefile, glad to got that there is

>> no problem of that, although I don't know the reason/trick yet.

> 

> I'm not 100% sure, but i think:

> 

> obj-$(CONFIG_MDIO_DEVICE)       += mdio-bus.o

> 

> actually refers back to

> 

> mdio-bus-y                      += mdio_bus.o mdio_device.o


Ack that.

-- 
~Randy
diff mbox series

Patch

diff --git a/drivers/net/phy/Makefile b/drivers/net/phy/Makefile
index a13e402074cf..0840e9055b5a 100644
--- a/drivers/net/phy/Makefile
+++ b/drivers/net/phy/Makefile
@@ -15,7 +15,7 @@  endif
 ifdef CONFIG_PHYLIB
 libphy-y			+= $(mdio-bus-y)
 else
-obj-$(CONFIG_MDIO_DEVICE)	+= mdio-bus.o
+obj-$(CONFIG_MDIO_DEVICE)	+= mdio_bus.o
 endif
 obj-$(CONFIG_MDIO_DEVRES)	+= mdio_devres.o
 libphy-$(CONFIG_SWPHY)		+= swphy.o