pinctrl fixes for v3.5 rc series:

- section markup fixes
 - clk_prepare() fix to conform to the clk API
 - memory leaks
 - incorrect debug messages
 - bad errorpaths
 - typos
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.10 (GNU/Linux)
 
 iQIcBAABAgAGBQJP2ZIRAAoJEEEQszewGV1zJEsP/jwNNj1+OvGYiOg+Tn29wc0q
 J02EJGb0mNCPX8JzWpKSXoEdCzqbmqdjR7zfmetQV1GpiUgidrnIjyLnUCXZnNaF
 2z210SoOWKnats9kvwdbptZ/xY/o1Ncdlfw2QgLiX6gx+bRmyNWR/4IOilsNMywA
 u7gPcfGGNgidUCAjNz5tFS5o8kFI+Z9FF/7f8gs4TAT70k40n79RGpgW7gA2PhR8
 c8WcJk2TOBThMdSl07JKChTtBtU1ZrPrv8quuk6+voPJa71nJfHNYkAd78cegOBS
 5pfh0rCGElHDMfZ5DdFBsFL1ETxni0mSziBIdgnBX85Ll/wJH6tEPjcVA1sv8Jka
 kLm61XKsDwV+A0KibgmGPSu6nYqGZMaAsvJPSWJjXcPcS3VhXK4lly3OCD1KB6U+
 5u6hD+yavYX8mpEOik3y9pnKYS80d8zvR22/jGpqTByG3DbLwAlLzen7iWHqAbLG
 JJLpD6pxkVA15x+TkS3I1kBMzjM5G11AjticgIxAfx4pSqL/n0CJ1m9tXQ1X7iis
 Kl526ZWxh+GDy9/cM/AqjEJYoefmcCTv1wSieWVsgEKc7+tut47rdaNa4eC+jqho
 NprmfhS16na5GCagh0yI+YXl+nK0Kd9oWoGiJqQcS67UZEn06SzRNdABBPa5OO1F
 ZVfnheS1t4UVw/E5Gmz2
 =F/II
 -----END PGP SIGNATURE-----

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
This commit is contained in:
Linus Torvalds 2012-06-14 15:43:32 +03:00
commit 0953135956
5 changed files with 30 additions and 24 deletions

View File

@ -61,7 +61,7 @@ static LIST_HEAD(pinctrl_maps);
list_for_each_entry(_maps_node_, &pinctrl_maps, node) \
for (_i_ = 0, _map_ = &_maps_node_->maps[_i_]; \
_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

View File

@ -27,16 +27,16 @@
#include "core.h"
#include "pinctrl-imx.h"
#define IMX_PMX_DUMP(info, p, m, c, n) \
{ \
int i, j; \
printk("Format: Pin Mux Config\n"); \
for (i = 0; i < n; i++) { \
j = p[i]; \
printk("%s %d 0x%lx\n", \
info->pins[j].name, \
m[i], c[i]); \
} \
#define IMX_PMX_DUMP(info, p, m, c, n) \
{ \
int i, j; \
printk(KERN_DEBUG "Format: Pin Mux Config\n"); \
for (i = 0; i < n; i++) { \
j = p[i]; \
printk(KERN_DEBUG "%s %d 0x%lx\n", \
info->pins[j].name, \
m[i], c[i]); \
} \
}
/* The bits in CONFIG cell defined in binding doc*/
@ -173,8 +173,10 @@ static int imx_dt_node_to_map(struct pinctrl_dev *pctldev,
/* create mux map */
parent = of_get_parent(np);
if (!parent)
if (!parent) {
kfree(new_map);
return -EINVAL;
}
new_map[0].type = PIN_MAP_TYPE_MUX_GROUP;
new_map[0].data.mux.function = parent->name;
new_map[0].data.mux.group = np->name;
@ -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",
new_map->data.mux.function, new_map->data.mux.group, map_num);
(*map)->data.mux.function, (*map)->data.mux.group, map_num);
return 0;
}
@ -201,10 +203,7 @@ static int imx_dt_node_to_map(struct pinctrl_dev *pctldev,
static void imx_dt_free_map(struct pinctrl_dev *pctldev,
struct pinctrl_map *map, unsigned num_maps)
{
int i;
for (i = 0; i < num_maps; i++)
kfree(map);
kfree(map);
}
static struct pinctrl_ops imx_pctrl_ops = {
@ -475,9 +474,8 @@ static int __devinit imx_pinctrl_parse_groups(struct device_node *np,
grp->configs[j] = config & ~IMX_PAD_SION;
}
#ifdef DEBUG
IMX_PMX_DUMP(info, grp->pins, grp->mux_mode, grp->configs, grp->npins);
#endif
return 0;
}

View File

@ -107,8 +107,10 @@ static int mxs_dt_node_to_map(struct pinctrl_dev *pctldev,
/* Compose group name */
group = kzalloc(length, GFP_KERNEL);
if (!group)
return -ENOMEM;
if (!group) {
ret = -ENOMEM;
goto free;
}
snprintf(group, length, "%s.%d", np->name, reg);
new_map[i].data.mux.group = group;
i++;
@ -118,7 +120,7 @@ static int mxs_dt_node_to_map(struct pinctrl_dev *pctldev,
pconfig = kmemdup(&config, sizeof(config), GFP_KERNEL);
if (!pconfig) {
ret = -ENOMEM;
goto free;
goto free_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,
return 0;
free_group:
if (!purecfg)
free(group);
free:
kfree(new_map);
return ret;
@ -511,6 +516,7 @@ int __devinit mxs_pinctrl_probe(struct platform_device *pdev,
return 0;
err:
platform_set_drvdata(pdev, NULL);
iounmap(d->base);
return ret;
}
@ -520,6 +526,7 @@ int __devexit mxs_pinctrl_remove(struct platform_device *pdev)
{
struct mxs_pinctrl_data *d = platform_get_drvdata(pdev);
platform_set_drvdata(pdev, NULL);
pinctrl_unregister(d->pctl);
iounmap(d->base);

View File

@ -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.
*/
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);
}
@ -1246,6 +1246,7 @@ static int __devinit nmk_gpio_probe(struct platform_device *dev)
ret = PTR_ERR(clk);
goto out_unmap;
}
clk_prepare(clk);
nmk_chip = kzalloc(sizeof(*nmk_chip), GFP_KERNEL);
if (!nmk_chip) {

View File

@ -1184,7 +1184,7 @@ static int __devinit sirfsoc_pinmux_probe(struct platform_device *pdev)
return ret;
}
static const struct of_device_id pinmux_ids[] = {
static const struct of_device_id pinmux_ids[] __devinitconst = {
{ .compatible = "sirf,prima2-gpio-pinmux" },
{}
};