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 'for-torvalds-20120418' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl

Pull pinctrl fixes from Linus Walleij:
- Fixed compilation errors and warnings
- Stricter checks on the ops vtable

* tag 'for-torvalds-20120418' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
pinctrl: implement pinctrl_check_ops
pinctrl: include <linux/bug.h> to prevent compile errors
pinctrl: fix compile error if not select PINMUX support

+24 -5
+21 -4
drivers/pinctrl/core.c
··· 908 908 const struct pinctrl_ops *ops = pctldev->desc->pctlops; 909 909 unsigned selector = 0; 910 910 911 - /* No grouping */ 912 - if (!ops) 913 - return 0; 914 - 915 911 mutex_lock(&pinctrl_mutex); 916 912 917 913 seq_puts(s, "registered pin groups:\n"); ··· 1221 1225 1222 1226 #endif 1223 1227 1228 + static int pinctrl_check_ops(struct pinctrl_dev *pctldev) 1229 + { 1230 + const struct pinctrl_ops *ops = pctldev->desc->pctlops; 1231 + 1232 + if (!ops || 1233 + !ops->list_groups || 1234 + !ops->get_group_name || 1235 + !ops->get_group_pins) 1236 + return -EINVAL; 1237 + 1238 + return 0; 1239 + } 1240 + 1224 1241 /** 1225 1242 * pinctrl_register() - register a pin controller device 1226 1243 * @pctldesc: descriptor for this pin controller ··· 1264 1255 INIT_RADIX_TREE(&pctldev->pin_desc_tree, GFP_KERNEL); 1265 1256 INIT_LIST_HEAD(&pctldev->gpio_ranges); 1266 1257 pctldev->dev = dev; 1258 + 1259 + /* check core ops for sanity */ 1260 + ret = pinctrl_check_ops(pctldev); 1261 + if (ret) { 1262 + pr_err("%s pinctrl ops lacks necessary functions\n", 1263 + pctldesc->name); 1264 + goto out_err; 1265 + } 1267 1266 1268 1267 /* If we're implementing pinmuxing, check the ops for sanity */ 1269 1268 if (pctldesc->pmxops) {
+3 -1
include/linux/pinctrl/machine.h
··· 12 12 #ifndef __LINUX_PINCTRL_MACHINE_H 13 13 #define __LINUX_PINCTRL_MACHINE_H 14 14 15 + #include <linux/bug.h> 16 + 15 17 #include "pinctrl-state.h" 16 18 17 19 enum pinctrl_map_type { ··· 150 148 #define PIN_MAP_CONFIGS_GROUP_HOG_DEFAULT(dev, grp, cfgs) \ 151 149 PIN_MAP_CONFIGS_GROUP(dev, PINCTRL_STATE_DEFAULT, dev, grp, cfgs) 152 150 153 - #ifdef CONFIG_PINMUX 151 + #ifdef CONFIG_PINCTRL 154 152 155 153 extern int pinctrl_register_mappings(struct pinctrl_map const *map, 156 154 unsigned num_maps);