Commit e2a61fa31382b1ac2b22f76f9c439892e5dc4b86

Authored by Ionut Nicu
Committed by David S. Miller
1 parent a1faa69810

fsl_pq_mdio: Fix fsl_pq_mdio to work with modules

This patch fixes the case when ucc_geth or gianfar are compiled
as modules. Without this patch the call to phy_connect() fails.

Signed-off-by: Ionut Nicu <ionut.nicu@freescale.com>
Acked-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

Showing 1 changed file with 4 additions and 4 deletions Side-by-side Diff

drivers/net/fsl_pq_mdio.c
... ... @@ -188,7 +188,7 @@
188 188 }
189 189  
190 190  
191   -#ifdef CONFIG_GIANFAR
  191 +#if defined(CONFIG_GIANFAR) || defined(CONFIG_GIANFAR_MODULE)
192 192 static u32 __iomem *get_gfar_tbipa(struct fsl_pq_mdio __iomem *regs)
193 193 {
194 194 struct gfar __iomem *enet_regs;
... ... @@ -206,7 +206,7 @@
206 206 #endif
207 207  
208 208  
209   -#ifdef CONFIG_UCC_GETH
  209 +#if defined(CONFIG_UCC_GETH) || defined(CONFIG_UCC_GETH_MODULE)
210 210 static int get_ucc_id_for_range(u64 start, u64 end, u32 *ucc_id)
211 211 {
212 212 struct device_node *np = NULL;
... ... @@ -291,7 +291,7 @@
291 291 if (of_device_is_compatible(np, "fsl,gianfar-mdio") ||
292 292 of_device_is_compatible(np, "fsl,gianfar-tbi") ||
293 293 of_device_is_compatible(np, "gianfar")) {
294   -#ifdef CONFIG_GIANFAR
  294 +#if defined(CONFIG_GIANFAR) || defined(CONFIG_GIANFAR_MODULE)
295 295 tbipa = get_gfar_tbipa(regs);
296 296 #else
297 297 err = -ENODEV;
... ... @@ -299,7 +299,7 @@
299 299 #endif
300 300 } else if (of_device_is_compatible(np, "fsl,ucc-mdio") ||
301 301 of_device_is_compatible(np, "ucc_geth_phy")) {
302   -#ifdef CONFIG_UCC_GETH
  302 +#if defined(CONFIG_UCC_GETH) || defined(CONFIG_UCC_GETH_MODULE)
303 303 u32 id;
304 304 static u32 mii_mng_master;
305 305