| @@ -1376,8 +1376,15 @@ void devm_pinctrl_put(struct pinctrl *p) · 1375 unmodified lines |
| 1376 | 1376 | } |
| 1377 | 1377 | EXPORT_SYMBOL_GPL(devm_pinctrl_put); |
| 1378 | 1378 | |
| 1379 | | −int pinctrl_register_map(const struct pinctrl_map *maps, unsigned num_maps, |
| 1380 | | − bool dup) |
| 1379 | +/** |
| 1380 | + * pinctrl_register_mappings() - register a set of pin controller mappings |
| 1381 | + * @maps: the pincontrol mappings table to register. Note the pinctrl-core |
| 1382 | + * keeps a reference to the passed in maps, so they should _not_ be |
| 1383 | + * marked with __initdata. |
| 1384 | + * @num_maps: the number of maps in the mapping table |
| 1385 | + */ |
| 1386 | +int pinctrl_register_mappings(const struct pinctrl_map *maps, |
| 1387 | + unsigned num_maps) |
| 1381 | 1388 | { |
| 1382 | 1389 | int i, ret; |
| 1383 | 1390 | struct pinctrl_maps *maps_node; |
| @@ -1430,17 +1437,8 @@ int pinctrl_register_map(const struct pinctrl_map *maps, unsigned num_maps, · 46 unmodified lines |
| 1430 | 1437 | if (!maps_node) |
| 1431 | 1438 | return -ENOMEM; |
| 1432 | 1439 | |
| 1440 | + maps_node->maps = maps; |
| 1433 | 1441 | maps_node->num_maps = num_maps; |
| 1434 | | − if (dup) { |
| 1435 | | − maps_node->maps = kmemdup(maps, sizeof(*maps) * num_maps, |
| 1436 | | − GFP_KERNEL); |
| 1437 | | − if (!maps_node->maps) { |
| 1438 | | − kfree(maps_node); |
| 1439 | | − return -ENOMEM; |
| 1440 | | − } |
| 1441 | | − } else { |
| 1442 | | − maps_node->maps = maps; |
| 1443 | | − } |
| 1444 | 1442 | |
| 1445 | 1443 | mutex_lock(&pinctrl_maps_mutex); |
| 1446 | 1444 | list_add_tail(&maps_node->node, &pinctrl_maps); |
| @@ -1448,22 +1446,14 @@ int pinctrl_register_map(const struct pinctrl_map *maps, unsigned num_maps, · 1 unmodified line |
| 1448 | 1446 | |
| 1449 | 1447 | return 0; |
| 1450 | 1448 | } |
| 1449 | +EXPORT_SYMBOL_GPL(pinctrl_register_mappings); |
| 1451 | 1450 | |
| 1452 | 1451 | /** |
| 1453 | | − * pinctrl_register_mappings() - register a set of pin controller mappings |
| 1454 | | − * @maps: the pincontrol mappings table to register. This should probably be |
| 1455 | | − * marked with __initdata so it can be discarded after boot. This |
| 1456 | | − * function will perform a shallow copy for the mapping entries. |
| 1457 | | − * @num_maps: the number of maps in the mapping table |
| 1452 | + * pinctrl_unregister_mappings() - unregister a set of pin controller mappings |
| 1453 | + * @maps: the pincontrol mappings table passed to pinctrl_register_mappings() |
| 1454 | + * when registering the mappings. |
| 1458 | 1455 | */ |
| 1459 | | −int pinctrl_register_mappings(const struct pinctrl_map *maps, |
| 1460 | | − unsigned num_maps) |
| 1461 | | −{ |
| 1462 | | − return pinctrl_register_map(maps, num_maps, true); |
| 1463 | | −} |
| 1464 | | −EXPORT_SYMBOL_GPL(pinctrl_register_mappings); |
| 1465 | | − |
| 1466 | | −void pinctrl_unregister_map(const struct pinctrl_map *map) |
| 1456 | +void pinctrl_unregister_mappings(const struct pinctrl_map *map) |
| 1467 | 1457 | { |
| 1468 | 1458 | struct pinctrl_maps *maps_node; |
| 1469 | 1459 | |
| @@ -1478,6 +1468,7 @@ void pinctrl_unregister_map(const struct pinctrl_map *map) · 8 unmodified lines |
| 1478 | 1468 | } |
| 1479 | 1469 | mutex_unlock(&pinctrl_maps_mutex); |
| 1480 | 1470 | } |
| 1471 | +EXPORT_SYMBOL_GPL(pinctrl_unregister_mappings); |
| 1481 | 1472 | |
| 1482 | 1473 | /** |
| 1483 | 1474 | * pinctrl_force_sleep() - turn a given controller device into sleep state |