Re: [PATCH 1/4] alchemy: register au1000_eth as a platform driver part one

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello.

Florian Fainelli wrote:

static int __init au1xxx_platform_init(void)
{
      unsigned int uartclk = get_au1x00_uart_baud_base() * 16;
-       int i;
+       int i, ni;

      /* Fill up uartclk. */
      for (i = 0; au1x00_uart_data[i].flags; i++)
              au1x00_uart_data[i].uartclk = uartclk;

+       /* Register second MAC if enabled in pinfunc */
+#ifndef CONFIG_SOC_AU1100
+        ni = (int)((au_readl(SYS_PINFUNC) & (u32)(SYS_PF_NI2)) >> 4);
+        if (!(ni + 1))
+               platform_device_register(&au1xxx_eth1_device);
+#endif
+

This won't work on Au1200/Au1300 since their SYS_PINFUNC register
has a different bit layout.

And you already know that I'm not very fond of alchemy/common/platform.c
;-) I still think you should add appropriate MAC platform information to
the boards which actually use it.

Yes I know ;) I was just wanting to get this out quickly before you kill platform.c

   I'd NAK such patch (and have already done so, AFAIR).

I will make the au1000-eth devices be registered on a per-board basis.

Please don't. You can register them in platform.c, and yet leave actually board specific platform data in the board files. There's no reason to duplicate the platfrom device itself.

WBR, Sergei


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux