lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <6ADB598D-07E0-4E51-A9FE-25B47FD87F7E@rock-chips.com>
Date:	Sat, 2 Jan 2016 10:38:28 +0800
From:	Xing Zheng <zhengxing@...k-chips.com>
To:	Arnd Bergmann <arnd@...db.de>
Cc:	linux-arm-kernel@...ts.infradead.org,
	Florian Fainelli <f.fainelli@...il.com>,
	linux-rockchip@...ts.infradead.org, heiko@...ech.de,
	netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
	Paul Gortmaker <paul.gortmaker@...driver.com>,
	Geert Uytterhoeven <geert@...ux-m68k.org>, keescook@...gle.com,
	leozwang@...gle.com, davem@...emloft.net, xing.zheng@...k-chips.com
Subject: Re: [RESEND PATCH v1 3/4] net: ethernet: arc: Add support emac for RK3036



OK, I think I will use named structures.

Thanks.

> 在 2016年1月1日,20:55,Arnd Bergmann <arnd@...db.de> 写道:
> 
>> On Tuesday 29 December 2015 14:59:59 Florian Fainelli wrote:
>>> On December 27, 2015 11:22:20 PM PST, Xing Zheng <zhengxing@...k-chips.com> wrote:
>>> The RK3036's GRFs offset are different with RK3066/RK3188, and need to
>>> set
>>> mac TX/RX clock before probe emac.
>>> 
>>> Signed-off-by: Xing Zheng <zhengxing@...k-chips.com>
>>> ---
>> <snip>
>>> };
>>> 
>>> static const struct of_device_id emac_rockchip_dt_ids[] = {
>>> -      { .compatible = "rockchip,rk3066-emac", .data =
>>> &emac_rockchip_dt_data[0] },
>>> -      { .compatible = "rockchip,rk3188-emac", .data =
>>> &emac_rockchip_dt_data[1] },
>>> +      { .compatible = "rockchip,rk3036-emac", .data =
>>> &emac_rockchip_dt_data[0] },
>>> +      { .compatible = "rockchip,rk3066-emac", .data =
>>> &emac_rockchip_dt_data[1] },
>>> +      { .compatible = "rockchip,rk3188-emac", .data =
>>> &emac_rockchip_dt_data[2] },
>>>      { /* Sentinel */ }
>> 
>> Food for thought, you might want to use an enum here to index emac_rockchip_dt_data which would be less error prone if you add/remove entries in this structure.
> 
> I would use named structures instead:
> 
> static const struct emac_rockchip_soc_data emac_rk3066_emac_data = {
>    .grf_offset = 0x154,
> };
> 
> static const struct of_device_id emac_rockchip_dt_ids[] = {
>    { .compatible = "rockchip,rk3066-emac", .data = &emac_rk3066_emac_data,
>    ...
> };
> 
>    Armd
> 
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ