Commit 09531359 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'pinctrl-fixes-for-v3.5' of...

Merge tag 'pinctrl-fixes-for-v3.5' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl

Pull pinctrl fixes from Linus Walleij:
 - section markup fixes
 - clk_prepare() fix to conform to the clk API
 - memory leaks
 - incorrect debug messages
 - bad errorpaths
 - typos

* tag 'pinctrl-fixes-for-v3.5' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
  pinctrl: pinctrl-mxs: set platform driver data to NULL at errpath and at unregister
  pinctrl: pinctrl-mxs: Take care of frees if the kzalloc fails
  pinctrl: pinctrl-imx: fix incorrect debug message of maps
  pinctrl: pinctrl-imx: free if of_get_parent fails to get the parent node
  pinctrl: pinctrl-imx: free allocated pinctrl_map structure only once and use kernel facilities for IMX_PMX_DUMP
  pinctrl: nomadik: fix up typo
  pinctrl: nomadik: add clk_prepare() call
  pinctrl: fix a minor harmless typo
  pinctrl: sirf: mark of_device_id match table as __devinitconst
parents b532ff20 149ff9e1
...@@ -61,7 +61,7 @@ static LIST_HEAD(pinctrl_maps); ...@@ -61,7 +61,7 @@ static LIST_HEAD(pinctrl_maps);
list_for_each_entry(_maps_node_, &pinctrl_maps, node) \ list_for_each_entry(_maps_node_, &pinctrl_maps, node) \
for (_i_ = 0, _map_ = &_maps_node_->maps[_i_]; \ for (_i_ = 0, _map_ = &_maps_node_->maps[_i_]; \
_i_ < _maps_node_->num_maps; \ _i_ < _maps_node_->num_maps; \
i++, _map_ = &_maps_node_->maps[_i_]) _i_++, _map_ = &_maps_node_->maps[_i_])
/** /**
* pinctrl_provide_dummies() - indicate if pinctrl provides dummy state support * pinctrl_provide_dummies() - indicate if pinctrl provides dummy state support
......
...@@ -30,10 +30,10 @@ ...@@ -30,10 +30,10 @@
#define IMX_PMX_DUMP(info, p, m, c, n) \ #define IMX_PMX_DUMP(info, p, m, c, n) \
{ \ { \
int i, j; \ int i, j; \
printk("Format: Pin Mux Config\n"); \ printk(KERN_DEBUG "Format: Pin Mux Config\n"); \
for (i = 0; i < n; i++) { \ for (i = 0; i < n; i++) { \
j = p[i]; \ j = p[i]; \
printk("%s %d 0x%lx\n", \ printk(KERN_DEBUG "%s %d 0x%lx\n", \
info->pins[j].name, \ info->pins[j].name, \
m[i], c[i]); \ m[i], c[i]); \
} \ } \
...@@ -173,8 +173,10 @@ static int imx_dt_node_to_map(struct pinctrl_dev *pctldev, ...@@ -173,8 +173,10 @@ static int imx_dt_node_to_map(struct pinctrl_dev *pctldev,
/* create mux map */ /* create mux map */
parent = of_get_parent(np); parent = of_get_parent(np);
if (!parent) if (!parent) {
kfree(new_map);
return -EINVAL; return -EINVAL;
}
new_map[0].type = PIN_MAP_TYPE_MUX_GROUP; new_map[0].type = PIN_MAP_TYPE_MUX_GROUP;
new_map[0].data.mux.function = parent->name; new_map[0].data.mux.function = parent->name;
new_map[0].data.mux.group = np->name; new_map[0].data.mux.group = np->name;
...@@ -193,7 +195,7 @@ static int imx_dt_node_to_map(struct pinctrl_dev *pctldev, ...@@ -193,7 +195,7 @@ static int imx_dt_node_to_map(struct pinctrl_dev *pctldev,
} }
dev_dbg(pctldev->dev, "maps: function %s group %s num %d\n", dev_dbg(pctldev->dev, "maps: function %s group %s num %d\n",
new_map->data.mux.function, new_map->data.mux.group, map_num); (*map)->data.mux.function, (*map)->data.mux.group, map_num);
return 0; return 0;
} }
...@@ -201,9 +203,6 @@ static int imx_dt_node_to_map(struct pinctrl_dev *pctldev, ...@@ -201,9 +203,6 @@ static int imx_dt_node_to_map(struct pinctrl_dev *pctldev,
static void imx_dt_free_map(struct pinctrl_dev *pctldev, static void imx_dt_free_map(struct pinctrl_dev *pctldev,
struct pinctrl_map *map, unsigned num_maps) struct pinctrl_map *map, unsigned num_maps)
{ {
int i;
for (i = 0; i < num_maps; i++)
kfree(map); kfree(map);
} }
...@@ -475,9 +474,8 @@ static int __devinit imx_pinctrl_parse_groups(struct device_node *np, ...@@ -475,9 +474,8 @@ static int __devinit imx_pinctrl_parse_groups(struct device_node *np,
grp->configs[j] = config & ~IMX_PAD_SION; grp->configs[j] = config & ~IMX_PAD_SION;
} }
#ifdef DEBUG
IMX_PMX_DUMP(info, grp->pins, grp->mux_mode, grp->configs, grp->npins); IMX_PMX_DUMP(info, grp->pins, grp->mux_mode, grp->configs, grp->npins);
#endif
return 0; return 0;
} }
......
...@@ -107,8 +107,10 @@ static int mxs_dt_node_to_map(struct pinctrl_dev *pctldev, ...@@ -107,8 +107,10 @@ static int mxs_dt_node_to_map(struct pinctrl_dev *pctldev,
/* Compose group name */ /* Compose group name */
group = kzalloc(length, GFP_KERNEL); group = kzalloc(length, GFP_KERNEL);
if (!group) if (!group) {
return -ENOMEM; ret = -ENOMEM;
goto free;
}
snprintf(group, length, "%s.%d", np->name, reg); snprintf(group, length, "%s.%d", np->name, reg);
new_map[i].data.mux.group = group; new_map[i].data.mux.group = group;
i++; i++;
...@@ -118,7 +120,7 @@ static int mxs_dt_node_to_map(struct pinctrl_dev *pctldev, ...@@ -118,7 +120,7 @@ static int mxs_dt_node_to_map(struct pinctrl_dev *pctldev,
pconfig = kmemdup(&config, sizeof(config), GFP_KERNEL); pconfig = kmemdup(&config, sizeof(config), GFP_KERNEL);
if (!pconfig) { if (!pconfig) {
ret = -ENOMEM; ret = -ENOMEM;
goto free; goto free_group;
} }
new_map[i].type = PIN_MAP_TYPE_CONFIGS_GROUP; new_map[i].type = PIN_MAP_TYPE_CONFIGS_GROUP;
...@@ -133,6 +135,9 @@ static int mxs_dt_node_to_map(struct pinctrl_dev *pctldev, ...@@ -133,6 +135,9 @@ static int mxs_dt_node_to_map(struct pinctrl_dev *pctldev,
return 0; return 0;
free_group:
if (!purecfg)
free(group);
free: free:
kfree(new_map); kfree(new_map);
return ret; return ret;
...@@ -511,6 +516,7 @@ int __devinit mxs_pinctrl_probe(struct platform_device *pdev, ...@@ -511,6 +516,7 @@ int __devinit mxs_pinctrl_probe(struct platform_device *pdev,
return 0; return 0;
err: err:
platform_set_drvdata(pdev, NULL);
iounmap(d->base); iounmap(d->base);
return ret; return ret;
} }
...@@ -520,6 +526,7 @@ int __devexit mxs_pinctrl_remove(struct platform_device *pdev) ...@@ -520,6 +526,7 @@ int __devexit mxs_pinctrl_remove(struct platform_device *pdev)
{ {
struct mxs_pinctrl_data *d = platform_get_drvdata(pdev); struct mxs_pinctrl_data *d = platform_get_drvdata(pdev);
platform_set_drvdata(pdev, NULL);
pinctrl_unregister(d->pctl); pinctrl_unregister(d->pctl);
iounmap(d->base); iounmap(d->base);
......
...@@ -673,7 +673,7 @@ static void __nmk_gpio_set_wake(struct nmk_gpio_chip *nmk_chip, ...@@ -673,7 +673,7 @@ static void __nmk_gpio_set_wake(struct nmk_gpio_chip *nmk_chip,
* wakeup is anyhow controlled by the RIMSC and FIMSC registers. * wakeup is anyhow controlled by the RIMSC and FIMSC registers.
*/ */
if (nmk_chip->sleepmode && on) { if (nmk_chip->sleepmode && on) {
__nmk_gpio_set_slpm(nmk_chip, gpio % nmk_chip->chip.base, __nmk_gpio_set_slpm(nmk_chip, gpio % NMK_GPIO_PER_CHIP,
NMK_GPIO_SLPM_WAKEUP_ENABLE); NMK_GPIO_SLPM_WAKEUP_ENABLE);
} }
...@@ -1246,6 +1246,7 @@ static int __devinit nmk_gpio_probe(struct platform_device *dev) ...@@ -1246,6 +1246,7 @@ static int __devinit nmk_gpio_probe(struct platform_device *dev)
ret = PTR_ERR(clk); ret = PTR_ERR(clk);
goto out_unmap; goto out_unmap;
} }
clk_prepare(clk);
nmk_chip = kzalloc(sizeof(*nmk_chip), GFP_KERNEL); nmk_chip = kzalloc(sizeof(*nmk_chip), GFP_KERNEL);
if (!nmk_chip) { if (!nmk_chip) {
......
...@@ -1184,7 +1184,7 @@ static int __devinit sirfsoc_pinmux_probe(struct platform_device *pdev) ...@@ -1184,7 +1184,7 @@ static int __devinit sirfsoc_pinmux_probe(struct platform_device *pdev)
return ret; return ret;
} }
static const struct of_device_id pinmux_ids[] = { static const struct of_device_id pinmux_ids[] __devinitconst = {
{ .compatible = "sirf,prima2-gpio-pinmux" }, { .compatible = "sirf,prima2-gpio-pinmux" },
{} {}
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment