Subject: Re: [PATCH 2/2] ethernet: arc: Add support for Rockchip SoC glue layer device tree bindings

From: Beniamino Galvani <[email-masked]>
Date: Fri, 8 Aug 2014 22:28:30 +0200

On Fri, Aug 08, 2014 at 12:27:55PM +0000, Romain Perier wrote:
> This patch defines a platform glue layer for Rockchip SoCs which support
> arc-emac driver. It ensures that regulator for the rmii is on before trying
> to connect to the ethernet controller. It applies right speed and mode changes
> to the grf when ethernet settings changes.
> 
> Signed-off-by: Romain Perier <[email-masked]>

(...)

> +struct rockchip_priv_data {
> +	struct regmap *grf;
> +	unsigned int grf_offset;
> +	int interface;
> +	struct regulator *regulator;
> +};
> +
> +static const unsigned int rockchip_emac_soc_grf_offset[] = {
> +	0x154, /* rk3066 */
> +	0x0a4, /* rk3188 */
> +};
> +
> +static const struct of_device_id rockchip_emac_dt_ids[] = {
> +	{ .compatible = "rockchip,rk3066-emac", .data = (void *)rockchip_emac_soc_grf_offset },
> +	{ .compatible = "rockchip,rk3188-emac", .data = (void *)rockchip_emac_soc_grf_offset + 1 },

Hi Romain,

I think you need parenthesis around "rockchip_emac_soc_grf_offset + 1"
because the cast has higher precedence. Anyway, wouldn't it be simpler
to avoid the indirection and pass the offset directly in the data field?

Beniamino