diff mbox series

[U-Boot] mvebu: turris_omnia: Only set eth?addr env if CONFIG_CMD_NET

Message ID 20170903131342.1092-1-marek.behun@nic.cz
State Deferred
Delegated to: Tom Rini
Headers show
Series [U-Boot] mvebu: turris_omnia: Only set eth?addr env if CONFIG_CMD_NET | expand

Commit Message

Marek Behún Sept. 3, 2017, 1:13 p.m. UTC
Otherwise the linking will fail since eth_env_set_enetaddr cannot
be found.

Signed-off-by: Marek Behun <marek.behun@nic.cz>
---
 board/CZ.NIC/turris_omnia/turris_omnia.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Stefan Roese Sept. 4, 2017, 6:42 a.m. UTC | #1
Hi Marek,

On 03.09.2017 15:13, Marek Behún wrote:
> Otherwise the linking will fail since eth_env_set_enetaddr cannot
> be found.
> 
> Signed-off-by: Marek Behun <marek.behun@nic.cz>
> ---
>   board/CZ.NIC/turris_omnia/turris_omnia.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/board/CZ.NIC/turris_omnia/turris_omnia.c b/board/CZ.NIC/turris_omnia/turris_omnia.c
> index af66837909..7db3b8ff3b 100644
> --- a/board/CZ.NIC/turris_omnia/turris_omnia.c
> +++ b/board/CZ.NIC/turris_omnia/turris_omnia.c
> @@ -470,6 +470,7 @@ out:
>   	return 0;
>   }
>   
> +#if defined(CONFIG_ATSHA204A) && defined(CONFIG_CMD_NET)
>   static void increment_mac(u8 *mac)
>   {
>   	int i;
> @@ -480,10 +481,11 @@ static void increment_mac(u8 *mac)
>   			break;
>   	}
>   }
> +#endif
>   
>   int misc_init_r(void)
>   {
> -#ifdef CONFIG_ATSHA204A
> +#if defined(CONFIG_ATSHA204A) && defined(CONFIG_CMD_NET)
>   	int err;
>   	struct udevice *dev = get_atsha204a_dev();
>   	u8 mac0[4], mac1[4], mac[6];
> 

Perhaps its better to select or imply ATSHA204A and CMD_NET for
turris_omnia in Kconfig instead. You can then remove all the #ifdef's
from the code here.

Just curious:
Where did you see this compile / linking problem. Compiling current
mainline does not cause any issues.

Thanks,
Stefan
Stefan Roese Sept. 19, 2017, 4:50 a.m. UTC | #2
Hi Marek,

On 04.09.2017 08:42, Stefan Roese wrote:
> On 03.09.2017 15:13, Marek Behún wrote:
>> Otherwise the linking will fail since eth_env_set_enetaddr cannot
>> be found.
>>
>> Signed-off-by: Marek Behun <marek.behun@nic.cz>
>> ---
>>   board/CZ.NIC/turris_omnia/turris_omnia.c | 4 +++-
>>   1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/board/CZ.NIC/turris_omnia/turris_omnia.c 
>> b/board/CZ.NIC/turris_omnia/turris_omnia.c
>> index af66837909..7db3b8ff3b 100644
>> --- a/board/CZ.NIC/turris_omnia/turris_omnia.c
>> +++ b/board/CZ.NIC/turris_omnia/turris_omnia.c
>> @@ -470,6 +470,7 @@ out:
>>       return 0;
>>   }
>> +#if defined(CONFIG_ATSHA204A) && defined(CONFIG_CMD_NET)
>>   static void increment_mac(u8 *mac)
>>   {
>>       int i;
>> @@ -480,10 +481,11 @@ static void increment_mac(u8 *mac)
>>               break;
>>       }
>>   }
>> +#endif
>>   int misc_init_r(void)
>>   {
>> -#ifdef CONFIG_ATSHA204A
>> +#if defined(CONFIG_ATSHA204A) && defined(CONFIG_CMD_NET)
>>       int err;
>>       struct udevice *dev = get_atsha204a_dev();
>>       u8 mac0[4], mac1[4], mac[6];
>>
> 
> Perhaps its better to select or imply ATSHA204A and CMD_NET for
> turris_omnia in Kconfig instead. You can then remove all the #ifdef's
> from the code here.
> 
> Just curious:
> Where did you see this compile / linking problem. Compiling current
> mainline does not cause any issues.

I didn't receive any answers on these questions. Could you please
check again?

Thanks,
Stefan
diff mbox series

Patch

diff --git a/board/CZ.NIC/turris_omnia/turris_omnia.c b/board/CZ.NIC/turris_omnia/turris_omnia.c
index af66837909..7db3b8ff3b 100644
--- a/board/CZ.NIC/turris_omnia/turris_omnia.c
+++ b/board/CZ.NIC/turris_omnia/turris_omnia.c
@@ -470,6 +470,7 @@  out:
 	return 0;
 }
 
+#if defined(CONFIG_ATSHA204A) && defined(CONFIG_CMD_NET)
 static void increment_mac(u8 *mac)
 {
 	int i;
@@ -480,10 +481,11 @@  static void increment_mac(u8 *mac)
 			break;
 	}
 }
+#endif
 
 int misc_init_r(void)
 {
-#ifdef CONFIG_ATSHA204A
+#if defined(CONFIG_ATSHA204A) && defined(CONFIG_CMD_NET)
 	int err;
 	struct udevice *dev = get_atsha204a_dev();
 	u8 mac0[4], mac1[4], mac[6];