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] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACRpkdZdELan7OyMjt4KOi=q-v1xkSaNZNyZ7AnOBY1R=SoW3w@mail.gmail.com>
Date:	Wed, 9 Oct 2013 14:30:46 +0200
From:	Linus Walleij <linus.walleij@...aro.org>
To:	Christian Ruppert <christian.ruppert@...lis.com>
Cc:	Stephen Warren <swarren@...dotorg.org>,
	Patrice CHOTARD <patrice.chotard@...com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Grant Likely <grant.likely@...retlab.ca>,
	Rob Herring <rob.herring@...xeda.com>,
	Rob Landley <rob@...dley.net>,
	Sascha Leuenberger <sascha.leuenberger@...lis.com>,
	Pierrick Hascoet <pierrick.hascoet@...lis.com>,
	"linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
	Alexandre Courbot <acourbot@...dia.com>,
	"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>
Subject: Re: [PATCH 02/03] pinmux: Add TB10x pinmux driver

On Tue, Oct 8, 2013 at 2:25 PM, Christian Ruppert
<christian.ruppert@...lis.com> wrote:

> The pinmux driver of the Abilis Systems TB10x platform based on ARC700 CPUs.
> Used to control the pinmux and is a prerequisite for the GPIO driver.
>
> Signed-off-by: Christian Ruppert <christian.ruppert@...lis.com>
> Signed-off-by: Pierrick Hascoet <pierrick.hascoet@...lis.com>

Overall this is looking pretty nice!

> +static int tb10x_dt_node_to_map(struct pinctrl_dev *pctl,
> +                               struct device_node *np_config,
> +                               struct pinctrl_map **map, unsigned *num_maps)
> +{
> +       struct pinctrl_map *m;
> +       const char *string;
> +
> +       if (of_property_read_string(np_config, "abilis,function", &string)) {
> +               pr_err("%s: No abilis,function property in device tree.\n",
> +                       np_config->full_name);
> +               return -EINVAL;
> +       }
> +
> +       m = kzalloc(sizeof(struct pinctrl_map), GFP_KERNEL);
> +       if (!m)
> +               return -ENOMEM;

Could you make use of:

#include "pinctrl-utils.h"

pinctrl_utils_reserve_map()
pinctrl_utils_add_map_mux()
pinctrl_utils_dt_free_map()

?

> +static int tb10x_gpio_request_enable(struct pinctrl_dev *pctl,
> +                                       struct pinctrl_gpio_range *range,
> +                                       unsigned pin)
> +{
> +       struct tb10x_pinctrl *state = pinctrl_dev_get_drvdata(pctl);
> +       int muxport = -1;
> +       int muxmode = -1;
> +       int i;
> +
> +       mutex_lock(&state->mutex);
> +
> +       /* Figure out to which port the requested GPIO belongs and how to
> +        * configure that port.
> +        * This loop also checks for pin conflicts between GPIOs and other
> +        * functions.
> +        */

/*
 * I really like all comments with a blank
 * line at the top and bottom like this.
 */

Yours,
Linus Walleij
--
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