Message ID | 20191105195341.666c4a3a@canb.auug.org.au |
---|---|
State | Not Applicable |
Delegated to: | David Miller |
Headers | show |
Series | linux-next: build failure after merge of the net-next tree | expand |
On Tue, Nov 05, 2019 at 07:53:41PM +1100, Stephen Rothwell wrote: > Hi all, > > After merging the net-next tree, today's linux-next build (powepc > ppc44x_defconfig) failed like this: > > > Caused by commit > > 0c65b2b90d13 ("net: of_get_phy_mode: Change API to solve int/unit warnings") > > I applied the following patch, but there is probably a nicer and more > complete way to fix this. Hi Stephen I just received the 0-day about this. I did not know David had merged it! What you have works. So: Reviewed-by: Andrew Lunn <andrew@lunn.ch> The nicer way is a bit bigger. Is this too big to go in via you? Should i submit it via netdev, and you can drop your fix once this arrives? Andrew rom e4a023829b53e2a918df8d8486c65c3650af0690 Mon Sep 17 00:00:00 2001 From: Andrew Lunn <andrew@lunn.ch> Date: Tue, 5 Nov 2019 07:43:53 -0600 Subject: [PATCH] net: ethernet: emac: Fix phy mode type Pass a phy_interface_t to of_get_phy_mode(), by changing the type of phy_mode in the device structure. This then requires that zmii_attach() is also changes, since it takes a pointer to phy_mode. Signed-off-by: Andrew Lunn <andrew@lunn.ch> --- drivers/net/ethernet/ibm/emac/core.h | 2 +- drivers/net/ethernet/ibm/emac/zmii.c | 3 ++- drivers/net/ethernet/ibm/emac/zmii.h | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/ibm/emac/core.h b/drivers/net/ethernet/ibm/emac/core.h index e9cda024cbf6..89a1b0fea158 100644 --- a/drivers/net/ethernet/ibm/emac/core.h +++ b/drivers/net/ethernet/ibm/emac/core.h @@ -171,7 +171,7 @@ struct emac_instance { struct mal_commac commac; /* PHY infos */ - int phy_mode; + phy_interface_t phy_mode; u32 phy_map; u32 phy_address; u32 phy_feat_exc; diff --git a/drivers/net/ethernet/ibm/emac/zmii.c b/drivers/net/ethernet/ibm/emac/zmii.c index b9e821de2ac6..57a25c7a9e70 100644 --- a/drivers/net/ethernet/ibm/emac/zmii.c +++ b/drivers/net/ethernet/ibm/emac/zmii.c @@ -78,7 +78,8 @@ static inline u32 zmii_mode_mask(int mode, int input) } } -int zmii_attach(struct platform_device *ofdev, int input, int *mode) +int zmii_attach(struct platform_device *ofdev, int input, + phy_interface_t *mode) { struct zmii_instance *dev = platform_get_drvdata(ofdev); struct zmii_regs __iomem *p = dev->base; diff --git a/drivers/net/ethernet/ibm/emac/zmii.h b/drivers/net/ethernet/ibm/emac/zmii.h index 41d46e9b87ba..65daedc78594 100644 --- a/drivers/net/ethernet/ibm/emac/zmii.h +++ b/drivers/net/ethernet/ibm/emac/zmii.h @@ -50,7 +50,8 @@ struct zmii_instance { int zmii_init(void); void zmii_exit(void); -int zmii_attach(struct platform_device *ofdev, int input, int *mode); +int zmii_attach(struct platform_device *ofdev, int input, + phy_interface_t *mode); void zmii_detach(struct platform_device *ofdev, int input); void zmii_get_mdio(struct platform_device *ofdev, int input); void zmii_put_mdio(struct platform_device *ofdev, int input);
Hi Andrew, On Tue, 5 Nov 2019 14:50:54 +0100 Andrew Lunn <andrew@lunn.ch> wrote: > > On Tue, Nov 05, 2019 at 07:53:41PM +1100, Stephen Rothwell wrote: > > > > After merging the net-next tree, today's linux-next build (powepc > > ppc44x_defconfig) failed like this: > > > > Sorry about leaving the error out :-( > > Caused by commit > > > > 0c65b2b90d13 ("net: of_get_phy_mode: Change API to solve int/unit warnings") > > > > I applied the following patch, but there is probably a nicer and more > > complete way to fix this. > > I just received the 0-day about this. I did not know David had merged > it! > > What you have works. So: > > Reviewed-by: Andrew Lunn <andrew@lunn.ch> > > The nicer way is a bit bigger. Is this too big to go in via you? > Should i submit it via netdev, and you can drop your fix once this > arrives? via Dave, thanks.
diff --git a/drivers/net/ethernet/ibm/emac/core.c b/drivers/net/ethernet/ibm/emac/core.c index 2e40425d8a34..8cb682754bd4 100644 --- a/drivers/net/ethernet/ibm/emac/core.c +++ b/drivers/net/ethernet/ibm/emac/core.c @@ -2850,6 +2850,7 @@ static int emac_init_config(struct emac_instance *dev) struct device_node *np = dev->ofdev->dev.of_node; const void *p; int err; + phy_interface_t phy_mode; /* Read config from device-tree */ if (emac_read_uint_prop(np, "mal-device", &dev->mal_ph, 1)) @@ -2898,9 +2899,11 @@ static int emac_init_config(struct emac_instance *dev) dev->mal_burst_size = 256; /* PHY mode needs some decoding */ - err = of_get_phy_mode(np, &dev->phy_mode); + err = of_get_phy_mode(np, &phy_mode); if (err) dev->phy_mode = PHY_INTERFACE_MODE_NA; + else + dev->phy_mode = phy_mode; /* Check EMAC version */ if (of_device_is_compatible(np, "ibm,emac4sync")) {