[OpenWrt-Devel] [PATCH v3 2/7] ath79: dev-eth: initialize clock for id 0 on AR934X

John Crispin blogic at openwrt.org
Thu Jul 9 02:31:44 EDT 2015


Hi,

looking closer at the code i noticed that you need to do this as
ath79_mdio1_data is not initialized to 0 properly. the reason being that
it is not static and that in turn is because the header file declares it
as extern yet there are no users.

i would suggest you drop this patch and instead make ath79_mdio1_data
static and remove the prototype from the header file. that should have
the same effect and will make sure ath79_mdio1_data is properly initialized.

please also fix ath79_mdio0_data while at it.

	John

On 07/07/2015 14:58, Günther Kelleter wrote:
> Signed-off-by: Günther Kelleter <guenther.kelleter at devolo.de>
> ---
>  target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c b/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c
> index ff94e2e..c7524be 100644
> --- a/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c
> +++ b/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c
> @@ -251,9 +251,11 @@ void __init ath79_register_mdio(unsigned int id, u32 phy_mask)
>  	case ATH79_SOC_AR9344:
>  		if (id == 1) {
>  			mdio_data->builtin_switch = 1;
> -			mdio_data->ref_clock = ar934x_get_mdio_ref_clock();
> -			mdio_data->mdio_clock = 6250000;
> +		} else {
> +			mdio_data->builtin_switch = 0;
>  		}
> +		mdio_data->ref_clock = ar934x_get_mdio_ref_clock();
> +		mdio_data->mdio_clock = 6250000;
>  		mdio_data->is_ar934x = 1;
>  		break;
>  
> 
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list