Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+30 -24
+1 -1
drivers/pinctrl/core.c
··· 61 61 list_for_each_entry(_maps_node_, &pinctrl_maps, node) \ 62 62 for (_i_ = 0, _map_ = &_maps_node_->maps[_i_]; \ 63 63 _i_ < _maps_node_->num_maps; \ 64 - i++, _map_ = &_maps_node_->maps[_i_]) 64 + _i_++, _map_ = &_maps_node_->maps[_i_]) 65 65 66 66 /** 67 67 * pinctrl_provide_dummies() - indicate if pinctrl provides dummy state support
+16 -18
drivers/pinctrl/pinctrl-imx.c
··· 27 27 #include "core.h" 28 28 #include "pinctrl-imx.h" 29 29 30 - #define IMX_PMX_DUMP(info, p, m, c, n) \ 31 - { \ 32 - int i, j; \ 33 - printk("Format: Pin Mux Config\n"); \ 34 - for (i = 0; i < n; i++) { \ 35 - j = p[i]; \ 36 - printk("%s %d 0x%lx\n", \ 37 - info->pins[j].name, \ 38 - m[i], c[i]); \ 39 - } \ 30 + #define IMX_PMX_DUMP(info, p, m, c, n) \ 31 + { \ 32 + int i, j; \ 33 + printk(KERN_DEBUG "Format: Pin Mux Config\n"); \ 34 + for (i = 0; i < n; i++) { \ 35 + j = p[i]; \ 36 + printk(KERN_DEBUG "%s %d 0x%lx\n", \ 37 + info->pins[j].name, \ 38 + m[i], c[i]); \ 39 + } \ 40 40 } 41 41 42 42 /* The bits in CONFIG cell defined in binding doc*/ ··· 173 173 174 174 /* create mux map */ 175 175 parent = of_get_parent(np); 176 - if (!parent) 176 + if (!parent) { 177 + kfree(new_map); 177 178 return -EINVAL; 179 + } 178 180 new_map[0].type = PIN_MAP_TYPE_MUX_GROUP; 179 181 new_map[0].data.mux.function = parent->name; 180 182 new_map[0].data.mux.group = np->name; ··· 195 193 } 196 194 197 195 dev_dbg(pctldev->dev, "maps: function %s group %s num %d\n", 198 - new_map->data.mux.function, new_map->data.mux.group, map_num); 196 + (*map)->data.mux.function, (*map)->data.mux.group, map_num); 199 197 200 198 return 0; 201 199 } ··· 203 201 static void imx_dt_free_map(struct pinctrl_dev *pctldev, 204 202 struct pinctrl_map *map, unsigned num_maps) 205 203 { 206 - int i; 207 - 208 - for (i = 0; i < num_maps; i++) 209 - kfree(map); 204 + kfree(map); 210 205 } 211 206 212 207 static struct pinctrl_ops imx_pctrl_ops = { ··· 474 475 grp->configs[j] = config & ~IMX_PAD_SION; 475 476 } 476 477 477 - #ifdef DEBUG 478 478 IMX_PMX_DUMP(info, grp->pins, grp->mux_mode, grp->configs, grp->npins); 479 - #endif 479 + 480 480 return 0; 481 481 } 482 482
+10 -3
drivers/pinctrl/pinctrl-mxs.c
··· 107 107 108 108 /* Compose group name */ 109 109 group = kzalloc(length, GFP_KERNEL); 110 - if (!group) 111 - return -ENOMEM; 110 + if (!group) { 111 + ret = -ENOMEM; 112 + goto free; 113 + } 112 114 snprintf(group, length, "%s.%d", np->name, reg); 113 115 new_map[i].data.mux.group = group; 114 116 i++; ··· 120 118 pconfig = kmemdup(&config, sizeof(config), GFP_KERNEL); 121 119 if (!pconfig) { 122 120 ret = -ENOMEM; 123 - goto free; 121 + goto free_group; 124 122 } 125 123 126 124 new_map[i].type = PIN_MAP_TYPE_CONFIGS_GROUP; ··· 135 133 136 134 return 0; 137 135 136 + free_group: 137 + if (!purecfg) 138 + free(group); 138 139 free: 139 140 kfree(new_map); 140 141 return ret; ··· 516 511 return 0; 517 512 518 513 err: 514 + platform_set_drvdata(pdev, NULL); 519 515 iounmap(d->base); 520 516 return ret; 521 517 } ··· 526 520 { 527 521 struct mxs_pinctrl_data *d = platform_get_drvdata(pdev); 528 522 523 + platform_set_drvdata(pdev, NULL); 529 524 pinctrl_unregister(d->pctl); 530 525 iounmap(d->base); 531 526
+2 -1
drivers/pinctrl/pinctrl-nomadik.c
··· 673 673 * wakeup is anyhow controlled by the RIMSC and FIMSC registers. 674 674 */ 675 675 if (nmk_chip->sleepmode && on) { 676 - __nmk_gpio_set_slpm(nmk_chip, gpio % nmk_chip->chip.base, 676 + __nmk_gpio_set_slpm(nmk_chip, gpio % NMK_GPIO_PER_CHIP, 677 677 NMK_GPIO_SLPM_WAKEUP_ENABLE); 678 678 } 679 679 ··· 1246 1246 ret = PTR_ERR(clk); 1247 1247 goto out_unmap; 1248 1248 } 1249 + clk_prepare(clk); 1249 1250 1250 1251 nmk_chip = kzalloc(sizeof(*nmk_chip), GFP_KERNEL); 1251 1252 if (!nmk_chip) {
+1 -1
drivers/pinctrl/pinctrl-sirf.c
··· 1184 1184 return ret; 1185 1185 } 1186 1186 1187 - static const struct of_device_id pinmux_ids[] = { 1187 + static const struct of_device_id pinmux_ids[] __devinitconst = { 1188 1188 { .compatible = "sirf,prima2-gpio-pinmux" }, 1189 1189 {} 1190 1190 };