All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] of/mdio: fix build errors when CONFIG_OF isn't set
@ 2012-10-10 16:31 Sasha Levin
  2012-11-14 16:11   ` Grant Likely
  0 siblings, 1 reply; 5+ messages in thread
From: Sasha Levin @ 2012-10-10 16:31 UTC (permalink / raw)
  To: grant.likely, rob.herring, srinivas.kandagatla
  Cc: devicetree-discuss, linux-kernel, Sasha Levin

Commit f9dc9ac5 ("of/mdio: Add dummy functions in of_mdio.h.") has added
empty stubs into of_mdio.h which were not static, this causes build errors
when these symbols were defined across several objects.

Fix it by marking those stubs as 'static inline'.

Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 include/linux/of_mdio.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/linux/of_mdio.h b/include/linux/of_mdio.h
index 6ef49b8..7f17b9c 100644
--- a/include/linux/of_mdio.h
+++ b/include/linux/of_mdio.h
@@ -26,17 +26,17 @@ extern struct phy_device *of_phy_connect_fixed_link(struct net_device *dev,
 extern struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np);
 
 #else /* CONFIG_OF */
-int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
+static inline int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
 {
 	return -ENOSYS;
 }
 
-struct phy_device *of_phy_find_device(struct device_node *phy_np)
+static inline struct phy_device *of_phy_find_device(struct device_node *phy_np)
 {
 	return NULL;
 }
 
-struct phy_device *of_phy_connect(struct net_device *dev,
+static inline struct phy_device *of_phy_connect(struct net_device *dev,
 					 struct device_node *phy_np,
 					 void (*hndlr)(struct net_device *),
 					 u32 flags, phy_interface_t iface)
@@ -44,14 +44,14 @@ struct phy_device *of_phy_connect(struct net_device *dev,
 	return NULL;
 }
 
-struct phy_device *of_phy_connect_fixed_link(struct net_device *dev,
+static inline struct phy_device *of_phy_connect_fixed_link(struct net_device *dev,
 					 void (*hndlr)(struct net_device *),
 					 phy_interface_t iface)
 {
 	return NULL;
 }
 
-struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np)
+static inline struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np)
 {
 	return NULL;
 }
-- 
1.7.12


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] of/mdio: fix build errors when CONFIG_OF isn't set
  2012-10-10 16:31 [PATCH] of/mdio: fix build errors when CONFIG_OF isn't set Sasha Levin
@ 2012-11-14 16:11   ` Grant Likely
  0 siblings, 0 replies; 5+ messages in thread
From: Grant Likely @ 2012-11-14 16:11 UTC (permalink / raw)
  To: Sasha Levin, rob.herring, srinivas.kandagatla
  Cc: devicetree-discuss, linux-kernel, Sasha Levin

On Wed, 10 Oct 2012 12:31:23 -0400, Sasha Levin <sasha.levin@oracle.com> wrote:
> Commit f9dc9ac5 ("of/mdio: Add dummy functions in of_mdio.h.") has added
> empty stubs into of_mdio.h which were not static, this causes build errors
> when these symbols were defined across several objects.
> 
> Fix it by marking those stubs as 'static inline'.
> 
> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>

Acked-by: Grant Likely <grant.likely@secretlab.ca>

Rob, can you please pick up into your merge branch for device tree?

Thanks,
g.

> ---
>  include/linux/of_mdio.h | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/include/linux/of_mdio.h b/include/linux/of_mdio.h
> index 6ef49b8..7f17b9c 100644
> --- a/include/linux/of_mdio.h
> +++ b/include/linux/of_mdio.h
> @@ -26,17 +26,17 @@ extern struct phy_device *of_phy_connect_fixed_link(struct net_device *dev,
>  extern struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np);
>  
>  #else /* CONFIG_OF */
> -int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
> +static inline int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
>  {
>  	return -ENOSYS;
>  }
>  
> -struct phy_device *of_phy_find_device(struct device_node *phy_np)
> +static inline struct phy_device *of_phy_find_device(struct device_node *phy_np)
>  {
>  	return NULL;
>  }
>  
> -struct phy_device *of_phy_connect(struct net_device *dev,
> +static inline struct phy_device *of_phy_connect(struct net_device *dev,
>  					 struct device_node *phy_np,
>  					 void (*hndlr)(struct net_device *),
>  					 u32 flags, phy_interface_t iface)
> @@ -44,14 +44,14 @@ struct phy_device *of_phy_connect(struct net_device *dev,
>  	return NULL;
>  }
>  
> -struct phy_device *of_phy_connect_fixed_link(struct net_device *dev,
> +static inline struct phy_device *of_phy_connect_fixed_link(struct net_device *dev,
>  					 void (*hndlr)(struct net_device *),
>  					 phy_interface_t iface)
>  {
>  	return NULL;
>  }
>  
> -struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np)
> +static inline struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np)
>  {
>  	return NULL;
>  }
> -- 
> 1.7.12
> 

-- 
Grant Likely, B.Sc, P.Eng.
Secret Lab Technologies, Ltd.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] of/mdio: fix build errors when CONFIG_OF isn't set
@ 2012-11-14 16:11   ` Grant Likely
  0 siblings, 0 replies; 5+ messages in thread
From: Grant Likely @ 2012-11-14 16:11 UTC (permalink / raw)
  To: rob.herring, srinivas.kandagatla
  Cc: devicetree-discuss, linux-kernel, Sasha Levin

On Wed, 10 Oct 2012 12:31:23 -0400, Sasha Levin <sasha.levin@oracle.com> wrote:
> Commit f9dc9ac5 ("of/mdio: Add dummy functions in of_mdio.h.") has added
> empty stubs into of_mdio.h which were not static, this causes build errors
> when these symbols were defined across several objects.
> 
> Fix it by marking those stubs as 'static inline'.
> 
> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>

Acked-by: Grant Likely <grant.likely@secretlab.ca>

Rob, can you please pick up into your merge branch for device tree?

Thanks,
g.

> ---
>  include/linux/of_mdio.h | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/include/linux/of_mdio.h b/include/linux/of_mdio.h
> index 6ef49b8..7f17b9c 100644
> --- a/include/linux/of_mdio.h
> +++ b/include/linux/of_mdio.h
> @@ -26,17 +26,17 @@ extern struct phy_device *of_phy_connect_fixed_link(struct net_device *dev,
>  extern struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np);
>  
>  #else /* CONFIG_OF */
> -int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
> +static inline int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
>  {
>  	return -ENOSYS;
>  }
>  
> -struct phy_device *of_phy_find_device(struct device_node *phy_np)
> +static inline struct phy_device *of_phy_find_device(struct device_node *phy_np)
>  {
>  	return NULL;
>  }
>  
> -struct phy_device *of_phy_connect(struct net_device *dev,
> +static inline struct phy_device *of_phy_connect(struct net_device *dev,
>  					 struct device_node *phy_np,
>  					 void (*hndlr)(struct net_device *),
>  					 u32 flags, phy_interface_t iface)
> @@ -44,14 +44,14 @@ struct phy_device *of_phy_connect(struct net_device *dev,
>  	return NULL;
>  }
>  
> -struct phy_device *of_phy_connect_fixed_link(struct net_device *dev,
> +static inline struct phy_device *of_phy_connect_fixed_link(struct net_device *dev,
>  					 void (*hndlr)(struct net_device *),
>  					 phy_interface_t iface)
>  {
>  	return NULL;
>  }
>  
> -struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np)
> +static inline struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np)
>  {
>  	return NULL;
>  }
> -- 
> 1.7.12
> 

-- 
Grant Likely, B.Sc, P.Eng.
Secret Lab Technologies, Ltd.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] of/mdio: fix build errors when CONFIG_OF isn't set
  2012-11-14 16:11   ` Grant Likely
  (?)
@ 2012-11-14 17:10   ` Rob Herring
  2012-11-14 17:22     ` Grant Likely
  -1 siblings, 1 reply; 5+ messages in thread
From: Rob Herring @ 2012-11-14 17:10 UTC (permalink / raw)
  To: Grant Likely
  Cc: Sasha Levin, rob.herring, srinivas.kandagatla,
	devicetree-discuss, linux-kernel

On 11/14/2012 10:11 AM, Grant Likely wrote:
> On Wed, 10 Oct 2012 12:31:23 -0400, Sasha Levin <sasha.levin@oracle.com> wrote:
>> Commit f9dc9ac5 ("of/mdio: Add dummy functions in of_mdio.h.") has added
>> empty stubs into of_mdio.h which were not static, this causes build errors
>> when these symbols were defined across several objects.
>>
>> Fix it by marking those stubs as 'static inline'.
>>
>> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
> 
> Acked-by: Grant Likely <grant.likely@secretlab.ca>
> 
> Rob, can you please pick up into your merge branch for device tree?
> 

This is already fixed:

commit 2a5cf8016c745191605f312a7cd7bd22e9be94a5
Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
Date:   Tue Oct 9 18:33:38 2012 +0000

    of/mdio: Staticise !CONFIG_OF stubs

    The !CONFIG_OF stubs aren't static so if multiple files include the
    header with this configuration then the linker will see multiple
    definitions of the stubs.

    Reported-by: Fengguang Wu <fengguang.wu@intel.com>
    Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
    Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
    Acked-by: Srinivas Kandagatla <srinivas.kandagatla@st.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

commit f9dc9ac51610a35629c8211b6b8c9b0c65cf0e1d
Author: Srinivas Kandagatla <srinivas.kandagatla@st.com>
Date:   Fri Aug 24 01:58:59 2012 +0000

    of/mdio: Add dummy functions in of_mdio.h.

    This patch adds dummy functions in of_mdio.h, so that driver need not
    ifdef there code with CONFIG_OF.

    Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@st.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

Rob

> Thanks,
> g.
> 
>> ---
>>  include/linux/of_mdio.h | 10 +++++-----
>>  1 file changed, 5 insertions(+), 5 deletions(-)
>>
>> diff --git a/include/linux/of_mdio.h b/include/linux/of_mdio.h
>> index 6ef49b8..7f17b9c 100644
>> --- a/include/linux/of_mdio.h
>> +++ b/include/linux/of_mdio.h
>> @@ -26,17 +26,17 @@ extern struct phy_device *of_phy_connect_fixed_link(struct net_device *dev,
>>  extern struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np);
>>  
>>  #else /* CONFIG_OF */
>> -int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
>> +static inline int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
>>  {
>>  	return -ENOSYS;
>>  }
>>  
>> -struct phy_device *of_phy_find_device(struct device_node *phy_np)
>> +static inline struct phy_device *of_phy_find_device(struct device_node *phy_np)
>>  {
>>  	return NULL;
>>  }
>>  
>> -struct phy_device *of_phy_connect(struct net_device *dev,
>> +static inline struct phy_device *of_phy_connect(struct net_device *dev,
>>  					 struct device_node *phy_np,
>>  					 void (*hndlr)(struct net_device *),
>>  					 u32 flags, phy_interface_t iface)
>> @@ -44,14 +44,14 @@ struct phy_device *of_phy_connect(struct net_device *dev,
>>  	return NULL;
>>  }
>>  
>> -struct phy_device *of_phy_connect_fixed_link(struct net_device *dev,
>> +static inline struct phy_device *of_phy_connect_fixed_link(struct net_device *dev,
>>  					 void (*hndlr)(struct net_device *),
>>  					 phy_interface_t iface)
>>  {
>>  	return NULL;
>>  }
>>  
>> -struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np)
>> +static inline struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np)
>>  {
>>  	return NULL;
>>  }
>> -- 
>> 1.7.12
>>
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] of/mdio: fix build errors when CONFIG_OF isn't set
  2012-11-14 17:10   ` Rob Herring
@ 2012-11-14 17:22     ` Grant Likely
  0 siblings, 0 replies; 5+ messages in thread
From: Grant Likely @ 2012-11-14 17:22 UTC (permalink / raw)
  To: Rob Herring
  Cc: Sasha Levin, rob.herring, srinivas.kandagatla,
	devicetree-discuss, linux-kernel

On Wed, Nov 14, 2012 at 5:10 PM, Rob Herring <robherring2@gmail.com> wrote:
> On 11/14/2012 10:11 AM, Grant Likely wrote:
>> On Wed, 10 Oct 2012 12:31:23 -0400, Sasha Levin <sasha.levin@oracle.com> wrote:
>>> Commit f9dc9ac5 ("of/mdio: Add dummy functions in of_mdio.h.") has added
>>> empty stubs into of_mdio.h which were not static, this causes build errors
>>> when these symbols were defined across several objects.
>>>
>>> Fix it by marking those stubs as 'static inline'.
>>>
>>> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
>>
>> Acked-by: Grant Likely <grant.likely@secretlab.ca>
>>
>> Rob, can you please pick up into your merge branch for device tree?
>>
>
> This is already fixed:

Even better! :-)

g.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-11-14 17:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-10 16:31 [PATCH] of/mdio: fix build errors when CONFIG_OF isn't set Sasha Levin
2012-11-14 16:11 ` Grant Likely
2012-11-14 16:11   ` Grant Likely
2012-11-14 17:10   ` Rob Herring
2012-11-14 17:22     ` Grant Likely

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.