Re: [RFC PATCH 2/4] pinctrl: pinconf-generic: Add ACPI support

From: Andy Shevchenko
Date: Fri Apr 01 2016 - 10:04:58 EST


On Thu, 2016-03-31 at 14:44 +0300, Irina Tirdea wrote:
> Add ACPI support for the generic device tree properties.
> Convert the pinconf generic code to handle both ACPI and
> device tree by using the fwnode_property API. Also include
> renaming device tree references in names of functions and
> structures from 'dt' to 'fwnode'.

This is looks good to me, though few style / minor comments below.

> --- a/drivers/pinctrl/pinconf-generic.c
> +++ b/drivers/pinctrl/pinconf-generic.c
>

> @@ -175,22 +176,22 @@ static const struct pinconf_generic_params
> dt_params[] = {
> Â};
> Â
> Â/**
> - * parse_dt_cfg() - Parse DT pinconf parameters
> - * @np: DT node
> + * parse_fwnode_cfg() - Parse FW pinconf parameters
> + * @fw: FW node

Here and below it should be @fwnode.

> -int pinconf_generic_dt_subnode_to_map(struct pinctrl_dev *pctldev,
> - struct device_node *np, struct pinctrl_map **map,
> +static int pinconf_generic_fwnode_subnode_to_map(struct pinctrl_dev
> *pctldev,
> + struct fwnode_handle *fwnode, struct pinctrl_map
> **map,
> Â unsigned *reserved_maps, unsigned *num_maps,
> Â enum pinctrl_map_type type)
> Â{
> - int ret;
> + int ret, i;

Since you change this line anyway, perhaps move it to be last in the
definition block?

> Â const char *function;
> Â struct device *dev = pctldev->dev;
> Â unsigned long *configs = NULL;
> Â unsigned num_configs = 0;
> Â unsigned reserve, strings_count;
> - struct property *prop;
> - const char *group;
> + const char **groups;
> Â const char *subnode_target_type = "pins";

...to here.

> +#ifdef CONFIG_OF
> +inline int pinconf_generic_parse_dt_config(struct device_node *np,
> + ÂÂÂstruct pinctrl_dev
> *pctldev,
> + ÂÂÂunsigned long **configs,
> + ÂÂÂunsigned int *nconfigs)
> +{
> + return pinconf_generic_parse_fwnode_config(&np->fwnode,
> pctldev,
> + ÂÂÂconfigs,
> nconfigs);
> +}

I didn't see any user of this.

--
Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
Intel Finland Oy