pinctrl: changes hog mechanism to be self-referential

Instead of a specific boolean field to indicate if a map entry shall
be hogged, treat self-reference as an indication of desired hogging.
This drops one field off the map struct and has a nice Douglas R.
Hofstadter-feel to it.

Acked-by: Dong Aisheng <[email protected]>
Acked-by: Stephen Warren <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
This commit is contained in:
Linus Walleij 2012-02-10 01:34:12 +01:00
commit 77a5988355
3 changed files with 12 additions and 20 deletions

View file

@ -793,11 +793,9 @@ int pinctrl_hog_maps(struct pinctrl_dev *pctldev)
for (i = 0; i < pinctrl_maps_num; i++) {
struct pinctrl_map const *map = &pinctrl_maps[i];
if (!map->hog_on_boot)
continue;
if (map->ctrl_dev_name &&
!strcmp(map->ctrl_dev_name, devname)) {
!strcmp(map->ctrl_dev_name, devname) &&
!strcmp(map->dev_name, devname)) {
/* OK time to hog! */
ret = pinctrl_hog_map(pctldev, map);
if (ret)