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

reset: replace boolean parameters with flags parameter

Introduce enum reset_control_flags and replace the list of boolean
parameters to the internal reset_control_get functions with a single
flags parameter, before adding more boolean options.

The separate boolean parameters have been shown to be error prone in
the past. See for example commit a57f68ddc886 ("reset: Fix devm bulk
optional exclusive control getter").

Acked-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Link: https://lore.kernel.org/r/20240925-reset-get-deasserted-v2-1-b3601bbd0458@pengutronix.de
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>

+139 -93
+40 -31
drivers/reset/core.c
··· 773 773 774 774 static struct reset_control * 775 775 __reset_control_get_internal(struct reset_controller_dev *rcdev, 776 - unsigned int index, bool shared, bool acquired) 776 + unsigned int index, enum reset_control_flags flags) 777 777 { 778 + bool shared = flags & RESET_CONTROL_FLAGS_BIT_SHARED; 779 + bool acquired = flags & RESET_CONTROL_FLAGS_BIT_ACQUIRED; 778 780 struct reset_control *rstc; 779 781 780 782 lockdep_assert_held(&reset_list_mutex); 783 + 784 + /* Expect callers to filter out OPTIONAL and DEASSERTED bits */ 785 + if (WARN_ON(flags & ~(RESET_CONTROL_FLAGS_BIT_SHARED | 786 + RESET_CONTROL_FLAGS_BIT_ACQUIRED))) 787 + return ERR_PTR(-EINVAL); 781 788 782 789 list_for_each_entry(rstc, &rcdev->reset_control_head, list) { 783 790 if (rstc->id == index) { ··· 1001 994 1002 995 struct reset_control * 1003 996 __of_reset_control_get(struct device_node *node, const char *id, int index, 1004 - bool shared, bool optional, bool acquired) 997 + enum reset_control_flags flags) 1005 998 { 999 + bool optional = flags & RESET_CONTROL_FLAGS_BIT_OPTIONAL; 1006 1000 bool gpio_fallback = false; 1007 1001 struct reset_control *rstc; 1008 1002 struct reset_controller_dev *rcdev; ··· 1067 1059 goto out_unlock; 1068 1060 } 1069 1061 1062 + flags &= ~RESET_CONTROL_FLAGS_BIT_OPTIONAL; 1063 + 1070 1064 /* reset_list_mutex also protects the rcdev's reset_control list */ 1071 - rstc = __reset_control_get_internal(rcdev, rstc_id, shared, acquired); 1065 + rstc = __reset_control_get_internal(rcdev, rstc_id, flags); 1072 1066 1073 1067 out_unlock: 1074 1068 mutex_unlock(&reset_list_mutex); ··· 1101 1091 1102 1092 static struct reset_control * 1103 1093 __reset_control_get_from_lookup(struct device *dev, const char *con_id, 1104 - bool shared, bool optional, bool acquired) 1094 + enum reset_control_flags flags) 1105 1095 { 1096 + bool optional = flags & RESET_CONTROL_FLAGS_BIT_OPTIONAL; 1106 1097 const struct reset_control_lookup *lookup; 1107 1098 struct reset_controller_dev *rcdev; 1108 1099 const char *dev_id = dev_name(dev); ··· 1127 1116 return ERR_PTR(-EPROBE_DEFER); 1128 1117 } 1129 1118 1119 + flags &= ~RESET_CONTROL_FLAGS_BIT_OPTIONAL; 1120 + 1130 1121 rstc = __reset_control_get_internal(rcdev, 1131 1122 lookup->index, 1132 - shared, acquired); 1123 + flags); 1133 1124 mutex_unlock(&reset_list_mutex); 1134 1125 break; 1135 1126 } ··· 1146 1133 } 1147 1134 1148 1135 struct reset_control *__reset_control_get(struct device *dev, const char *id, 1149 - int index, bool shared, bool optional, 1150 - bool acquired) 1136 + int index, enum reset_control_flags flags) 1151 1137 { 1138 + bool shared = flags & RESET_CONTROL_FLAGS_BIT_SHARED; 1139 + bool acquired = flags & RESET_CONTROL_FLAGS_BIT_ACQUIRED; 1140 + 1152 1141 if (WARN_ON(shared && acquired)) 1153 1142 return ERR_PTR(-EINVAL); 1154 1143 1155 1144 if (dev->of_node) 1156 - return __of_reset_control_get(dev->of_node, id, index, shared, 1157 - optional, acquired); 1145 + return __of_reset_control_get(dev->of_node, id, index, flags); 1158 1146 1159 - return __reset_control_get_from_lookup(dev, id, shared, optional, 1160 - acquired); 1147 + return __reset_control_get_from_lookup(dev, id, flags); 1161 1148 } 1162 1149 EXPORT_SYMBOL_GPL(__reset_control_get); 1163 1150 1164 1151 int __reset_control_bulk_get(struct device *dev, int num_rstcs, 1165 1152 struct reset_control_bulk_data *rstcs, 1166 - bool shared, bool optional, bool acquired) 1153 + enum reset_control_flags flags) 1167 1154 { 1168 1155 int ret, i; 1169 1156 1170 1157 for (i = 0; i < num_rstcs; i++) { 1171 - rstcs[i].rstc = __reset_control_get(dev, rstcs[i].id, 0, 1172 - shared, optional, acquired); 1158 + rstcs[i].rstc = __reset_control_get(dev, rstcs[i].id, 0, flags); 1173 1159 if (IS_ERR(rstcs[i].rstc)) { 1174 1160 ret = PTR_ERR(rstcs[i].rstc); 1175 1161 goto err; ··· 1238 1226 1239 1227 struct reset_control * 1240 1228 __devm_reset_control_get(struct device *dev, const char *id, int index, 1241 - bool shared, bool optional, bool acquired) 1229 + enum reset_control_flags flags) 1242 1230 { 1243 1231 struct reset_control **ptr, *rstc; 1244 1232 ··· 1247 1235 if (!ptr) 1248 1236 return ERR_PTR(-ENOMEM); 1249 1237 1250 - rstc = __reset_control_get(dev, id, index, shared, optional, acquired); 1238 + rstc = __reset_control_get(dev, id, index, flags); 1251 1239 if (IS_ERR_OR_NULL(rstc)) { 1252 1240 devres_free(ptr); 1253 1241 return rstc; ··· 1274 1262 1275 1263 int __devm_reset_control_bulk_get(struct device *dev, int num_rstcs, 1276 1264 struct reset_control_bulk_data *rstcs, 1277 - bool shared, bool optional, bool acquired) 1265 + enum reset_control_flags flags) 1278 1266 { 1279 1267 struct reset_control_bulk_devres *ptr; 1280 1268 int ret; ··· 1284 1272 if (!ptr) 1285 1273 return -ENOMEM; 1286 1274 1287 - ret = __reset_control_bulk_get(dev, num_rstcs, rstcs, shared, optional, acquired); 1275 + ret = __reset_control_bulk_get(dev, num_rstcs, rstcs, flags); 1288 1276 if (ret < 0) { 1289 1277 devres_free(ptr); 1290 1278 return ret; ··· 1310 1298 */ 1311 1299 int __device_reset(struct device *dev, bool optional) 1312 1300 { 1301 + enum reset_control_flags flags; 1313 1302 struct reset_control *rstc; 1314 1303 int ret; 1315 1304 ··· 1326 1313 } 1327 1314 #endif 1328 1315 1329 - rstc = __reset_control_get(dev, NULL, 0, 0, optional, true); 1316 + flags = optional ? RESET_CONTROL_OPTIONAL_EXCLUSIVE : RESET_CONTROL_EXCLUSIVE; 1317 + rstc = __reset_control_get(dev, NULL, 0, flags); 1330 1318 if (IS_ERR(rstc)) 1331 1319 return PTR_ERR(rstc); 1332 1320 ··· 1370 1356 * device node. 1371 1357 * 1372 1358 * @np: device node for the device that requests the reset controls array 1373 - * @shared: whether reset controls are shared or not 1374 - * @optional: whether it is optional to get the reset controls 1375 - * @acquired: only one reset control may be acquired for a given controller 1376 - * and ID 1359 + * @flags: whether reset controls are shared, optional, acquired 1377 1360 * 1378 1361 * Returns pointer to allocated reset_control on success or error on failure 1379 1362 */ 1380 1363 struct reset_control * 1381 - of_reset_control_array_get(struct device_node *np, bool shared, bool optional, 1382 - bool acquired) 1364 + of_reset_control_array_get(struct device_node *np, enum reset_control_flags flags) 1383 1365 { 1366 + bool optional = flags & RESET_CONTROL_FLAGS_BIT_OPTIONAL; 1384 1367 struct reset_control_array *resets; 1385 1368 struct reset_control *rstc; 1386 1369 int num, i; ··· 1392 1381 resets->num_rstcs = num; 1393 1382 1394 1383 for (i = 0; i < num; i++) { 1395 - rstc = __of_reset_control_get(np, NULL, i, shared, optional, 1396 - acquired); 1384 + rstc = __of_reset_control_get(np, NULL, i, flags); 1397 1385 if (IS_ERR(rstc)) 1398 1386 goto err_rst; 1399 1387 resets->rstc[i] = rstc; ··· 1417 1407 * devm_reset_control_array_get - Resource managed reset control array get 1418 1408 * 1419 1409 * @dev: device that requests the list of reset controls 1420 - * @shared: whether reset controls are shared or not 1421 - * @optional: whether it is optional to get the reset controls 1410 + * @flags: whether reset controls are shared, optional, acquired 1422 1411 * 1423 1412 * The reset control array APIs are intended for a list of resets 1424 1413 * that just have to be asserted or deasserted, without any ··· 1426 1417 * Returns pointer to allocated reset_control on success or error on failure 1427 1418 */ 1428 1419 struct reset_control * 1429 - devm_reset_control_array_get(struct device *dev, bool shared, bool optional) 1420 + devm_reset_control_array_get(struct device *dev, enum reset_control_flags flags) 1430 1421 { 1431 1422 struct reset_control **ptr, *rstc; 1432 1423 ··· 1435 1426 if (!ptr) 1436 1427 return ERR_PTR(-ENOMEM); 1437 1428 1438 - rstc = of_reset_control_array_get(dev->of_node, shared, optional, true); 1429 + rstc = of_reset_control_array_get(dev->of_node, flags); 1439 1430 if (IS_ERR_OR_NULL(rstc)) { 1440 1431 devres_free(ptr); 1441 1432 return rstc;
+99 -62
include/linux/reset.h
··· 25 25 struct reset_control *rstc; 26 26 }; 27 27 28 + #define RESET_CONTROL_FLAGS_BIT_SHARED BIT(0) /* not exclusive */ 29 + #define RESET_CONTROL_FLAGS_BIT_OPTIONAL BIT(1) 30 + #define RESET_CONTROL_FLAGS_BIT_ACQUIRED BIT(2) /* iff exclusive, not released */ 31 + 32 + /** 33 + * enum reset_control_flags - Flags that can be passed to the reset_control_get functions 34 + * to determine the type of reset control. 35 + * These values cannot be OR'd. 36 + * 37 + * @RESET_CONTROL_EXCLUSIVE: exclusive, acquired, 38 + * @RESET_CONTROL_EXCLUSIVE_RELEASED: exclusive, released, 39 + * @RESET_CONTROL_SHARED: shared 40 + * @RESET_CONTROL_OPTIONAL_EXCLUSIVE: optional, exclusive, acquired 41 + * @RESET_CONTROL_OPTIONAL_EXCLUSIVE_RELEASED: optional, exclusive, released 42 + * @RESET_CONTROL_OPTIONAL_SHARED: optional, shared 43 + */ 44 + enum reset_control_flags { 45 + RESET_CONTROL_EXCLUSIVE = RESET_CONTROL_FLAGS_BIT_ACQUIRED, 46 + RESET_CONTROL_EXCLUSIVE_RELEASED = 0, 47 + RESET_CONTROL_SHARED = RESET_CONTROL_FLAGS_BIT_SHARED, 48 + RESET_CONTROL_OPTIONAL_EXCLUSIVE = RESET_CONTROL_FLAGS_BIT_OPTIONAL | 49 + RESET_CONTROL_FLAGS_BIT_ACQUIRED, 50 + RESET_CONTROL_OPTIONAL_EXCLUSIVE_RELEASED = RESET_CONTROL_FLAGS_BIT_OPTIONAL, 51 + RESET_CONTROL_OPTIONAL_SHARED = RESET_CONTROL_FLAGS_BIT_OPTIONAL | 52 + RESET_CONTROL_FLAGS_BIT_SHARED, 53 + }; 54 + 28 55 #ifdef CONFIG_RESET_CONTROLLER 29 56 30 57 int reset_control_reset(struct reset_control *rstc); ··· 69 42 void reset_control_bulk_release(int num_rstcs, struct reset_control_bulk_data *rstcs); 70 43 71 44 struct reset_control *__of_reset_control_get(struct device_node *node, 72 - const char *id, int index, bool shared, 73 - bool optional, bool acquired); 45 + const char *id, int index, enum reset_control_flags flags); 74 46 struct reset_control *__reset_control_get(struct device *dev, const char *id, 75 - int index, bool shared, 76 - bool optional, bool acquired); 47 + int index, enum reset_control_flags flags); 77 48 void reset_control_put(struct reset_control *rstc); 78 49 int __reset_control_bulk_get(struct device *dev, int num_rstcs, 79 50 struct reset_control_bulk_data *rstcs, 80 - bool shared, bool optional, bool acquired); 51 + enum reset_control_flags flags); 81 52 void reset_control_bulk_put(int num_rstcs, struct reset_control_bulk_data *rstcs); 82 53 83 54 int __device_reset(struct device *dev, bool optional); 84 55 struct reset_control *__devm_reset_control_get(struct device *dev, 85 - const char *id, int index, bool shared, 86 - bool optional, bool acquired); 56 + const char *id, int index, enum reset_control_flags flags); 87 57 int __devm_reset_control_bulk_get(struct device *dev, int num_rstcs, 88 58 struct reset_control_bulk_data *rstcs, 89 - bool shared, bool optional, bool acquired); 59 + enum reset_control_flags flags); 90 60 91 61 struct reset_control *devm_reset_control_array_get(struct device *dev, 92 - bool shared, bool optional); 93 - struct reset_control *of_reset_control_array_get(struct device_node *np, 94 - bool shared, bool optional, 95 - bool acquired); 62 + enum reset_control_flags flags); 63 + struct reset_control *of_reset_control_array_get(struct device_node *np, enum reset_control_flags); 96 64 97 65 int reset_control_get_count(struct device *dev); 98 66 ··· 138 116 139 117 static inline struct reset_control *__of_reset_control_get( 140 118 struct device_node *node, 141 - const char *id, int index, bool shared, 142 - bool optional, bool acquired) 119 + const char *id, int index, enum reset_control_flags flags) 143 120 { 121 + bool optional = flags & RESET_CONTROL_FLAGS_BIT_OPTIONAL; 122 + 144 123 return optional ? NULL : ERR_PTR(-ENOTSUPP); 145 124 } 146 125 147 126 static inline struct reset_control *__reset_control_get( 148 127 struct device *dev, const char *id, 149 - int index, bool shared, bool optional, 150 - bool acquired) 128 + int index, enum reset_control_flags flags) 151 129 { 130 + bool optional = flags & RESET_CONTROL_FLAGS_BIT_OPTIONAL; 131 + 152 132 return optional ? NULL : ERR_PTR(-ENOTSUPP); 153 133 } 154 134 ··· 186 162 static inline int 187 163 __reset_control_bulk_get(struct device *dev, int num_rstcs, 188 164 struct reset_control_bulk_data *rstcs, 189 - bool shared, bool optional, bool acquired) 165 + enum reset_control_flags flags) 190 166 { 167 + bool optional = flags & RESET_CONTROL_FLAGS_BIT_OPTIONAL; 168 + 191 169 return optional ? 0 : -EOPNOTSUPP; 192 170 } 193 171 ··· 200 174 201 175 static inline struct reset_control *__devm_reset_control_get( 202 176 struct device *dev, const char *id, 203 - int index, bool shared, bool optional, 204 - bool acquired) 177 + int index, enum reset_control_flags flags) 205 178 { 179 + bool optional = flags & RESET_CONTROL_FLAGS_BIT_OPTIONAL; 180 + 206 181 return optional ? NULL : ERR_PTR(-ENOTSUPP); 207 182 } 208 183 209 184 static inline int 210 185 __devm_reset_control_bulk_get(struct device *dev, int num_rstcs, 211 186 struct reset_control_bulk_data *rstcs, 212 - bool shared, bool optional, bool acquired) 187 + enum reset_control_flags flags) 213 188 { 189 + bool optional = flags & RESET_CONTROL_FLAGS_BIT_OPTIONAL; 190 + 214 191 return optional ? 0 : -EOPNOTSUPP; 215 192 } 216 193 217 194 static inline struct reset_control * 218 - devm_reset_control_array_get(struct device *dev, bool shared, bool optional) 195 + devm_reset_control_array_get(struct device *dev, enum reset_control_flags flags) 219 196 { 197 + bool optional = flags & RESET_CONTROL_FLAGS_BIT_OPTIONAL; 198 + 220 199 return optional ? NULL : ERR_PTR(-ENOTSUPP); 221 200 } 222 201 223 202 static inline struct reset_control * 224 - of_reset_control_array_get(struct device_node *np, bool shared, bool optional, 225 - bool acquired) 203 + of_reset_control_array_get(struct device_node *np, enum reset_control_flags flags) 226 204 { 205 + bool optional = flags & RESET_CONTROL_FLAGS_BIT_OPTIONAL; 206 + 227 207 return optional ? NULL : ERR_PTR(-ENOTSUPP); 228 208 } 229 209 ··· 268 236 static inline struct reset_control * 269 237 __must_check reset_control_get_exclusive(struct device *dev, const char *id) 270 238 { 271 - return __reset_control_get(dev, id, 0, false, false, true); 239 + return __reset_control_get(dev, id, 0, RESET_CONTROL_EXCLUSIVE); 272 240 } 273 241 274 242 /** ··· 285 253 reset_control_bulk_get_exclusive(struct device *dev, int num_rstcs, 286 254 struct reset_control_bulk_data *rstcs) 287 255 { 288 - return __reset_control_bulk_get(dev, num_rstcs, rstcs, false, false, true); 256 + return __reset_control_bulk_get(dev, num_rstcs, rstcs, RESET_CONTROL_EXCLUSIVE); 289 257 } 290 258 291 259 /** ··· 306 274 __must_check reset_control_get_exclusive_released(struct device *dev, 307 275 const char *id) 308 276 { 309 - return __reset_control_get(dev, id, 0, false, false, false); 277 + return __reset_control_get(dev, id, 0, RESET_CONTROL_EXCLUSIVE_RELEASED); 310 278 } 311 279 312 280 /** ··· 327 295 reset_control_bulk_get_exclusive_released(struct device *dev, int num_rstcs, 328 296 struct reset_control_bulk_data *rstcs) 329 297 { 330 - return __reset_control_bulk_get(dev, num_rstcs, rstcs, false, false, false); 298 + return __reset_control_bulk_get(dev, num_rstcs, rstcs, RESET_CONTROL_EXCLUSIVE_RELEASED); 331 299 } 332 300 333 301 /** ··· 348 316 reset_control_bulk_get_optional_exclusive_released(struct device *dev, int num_rstcs, 349 317 struct reset_control_bulk_data *rstcs) 350 318 { 351 - return __reset_control_bulk_get(dev, num_rstcs, rstcs, false, true, false); 319 + return __reset_control_bulk_get(dev, num_rstcs, rstcs, 320 + RESET_CONTROL_OPTIONAL_EXCLUSIVE_RELEASED); 352 321 } 353 322 354 323 /** ··· 377 344 static inline struct reset_control *reset_control_get_shared( 378 345 struct device *dev, const char *id) 379 346 { 380 - return __reset_control_get(dev, id, 0, true, false, false); 347 + return __reset_control_get(dev, id, 0, RESET_CONTROL_SHARED); 381 348 } 382 349 383 350 /** ··· 394 361 reset_control_bulk_get_shared(struct device *dev, int num_rstcs, 395 362 struct reset_control_bulk_data *rstcs) 396 363 { 397 - return __reset_control_bulk_get(dev, num_rstcs, rstcs, true, false, false); 364 + return __reset_control_bulk_get(dev, num_rstcs, rstcs, RESET_CONTROL_SHARED); 398 365 } 399 366 400 367 /** ··· 411 378 static inline struct reset_control *reset_control_get_optional_exclusive( 412 379 struct device *dev, const char *id) 413 380 { 414 - return __reset_control_get(dev, id, 0, false, true, true); 381 + return __reset_control_get(dev, id, 0, RESET_CONTROL_OPTIONAL_EXCLUSIVE); 415 382 } 416 383 417 384 /** ··· 431 398 reset_control_bulk_get_optional_exclusive(struct device *dev, int num_rstcs, 432 399 struct reset_control_bulk_data *rstcs) 433 400 { 434 - return __reset_control_bulk_get(dev, num_rstcs, rstcs, false, true, true); 401 + return __reset_control_bulk_get(dev, num_rstcs, rstcs, RESET_CONTROL_OPTIONAL_EXCLUSIVE); 435 402 } 436 403 437 404 /** ··· 448 415 static inline struct reset_control *reset_control_get_optional_shared( 449 416 struct device *dev, const char *id) 450 417 { 451 - return __reset_control_get(dev, id, 0, true, true, false); 418 + return __reset_control_get(dev, id, 0, RESET_CONTROL_OPTIONAL_SHARED); 452 419 } 453 420 454 421 /** ··· 468 435 reset_control_bulk_get_optional_shared(struct device *dev, int num_rstcs, 469 436 struct reset_control_bulk_data *rstcs) 470 437 { 471 - return __reset_control_bulk_get(dev, num_rstcs, rstcs, true, true, false); 438 + return __reset_control_bulk_get(dev, num_rstcs, rstcs, RESET_CONTROL_OPTIONAL_SHARED); 472 439 } 473 440 474 441 /** ··· 484 451 static inline struct reset_control *of_reset_control_get_exclusive( 485 452 struct device_node *node, const char *id) 486 453 { 487 - return __of_reset_control_get(node, id, 0, false, false, true); 454 + return __of_reset_control_get(node, id, 0, RESET_CONTROL_EXCLUSIVE); 488 455 } 489 456 490 457 /** ··· 504 471 static inline struct reset_control *of_reset_control_get_optional_exclusive( 505 472 struct device_node *node, const char *id) 506 473 { 507 - return __of_reset_control_get(node, id, 0, false, true, true); 474 + return __of_reset_control_get(node, id, 0, RESET_CONTROL_OPTIONAL_EXCLUSIVE); 508 475 } 509 476 510 477 /** ··· 529 496 static inline struct reset_control *of_reset_control_get_shared( 530 497 struct device_node *node, const char *id) 531 498 { 532 - return __of_reset_control_get(node, id, 0, true, false, false); 499 + return __of_reset_control_get(node, id, 0, RESET_CONTROL_SHARED); 533 500 } 534 501 535 502 /** ··· 546 513 static inline struct reset_control *of_reset_control_get_exclusive_by_index( 547 514 struct device_node *node, int index) 548 515 { 549 - return __of_reset_control_get(node, NULL, index, false, false, true); 516 + return __of_reset_control_get(node, NULL, index, RESET_CONTROL_EXCLUSIVE); 550 517 } 551 518 552 519 /** ··· 574 541 static inline struct reset_control *of_reset_control_get_shared_by_index( 575 542 struct device_node *node, int index) 576 543 { 577 - return __of_reset_control_get(node, NULL, index, true, false, false); 544 + return __of_reset_control_get(node, NULL, index, RESET_CONTROL_SHARED); 578 545 } 579 546 580 547 /** ··· 593 560 __must_check devm_reset_control_get_exclusive(struct device *dev, 594 561 const char *id) 595 562 { 596 - return __devm_reset_control_get(dev, id, 0, false, false, true); 563 + return __devm_reset_control_get(dev, id, 0, RESET_CONTROL_EXCLUSIVE); 597 564 } 598 565 599 566 /** ··· 613 580 devm_reset_control_bulk_get_exclusive(struct device *dev, int num_rstcs, 614 581 struct reset_control_bulk_data *rstcs) 615 582 { 616 - return __devm_reset_control_bulk_get(dev, num_rstcs, rstcs, false, false, true); 583 + return __devm_reset_control_bulk_get(dev, num_rstcs, rstcs, 584 + RESET_CONTROL_EXCLUSIVE); 617 585 } 618 586 619 587 /** ··· 633 599 __must_check devm_reset_control_get_exclusive_released(struct device *dev, 634 600 const char *id) 635 601 { 636 - return __devm_reset_control_get(dev, id, 0, false, false, false); 602 + return __devm_reset_control_get(dev, id, 0, RESET_CONTROL_EXCLUSIVE_RELEASED); 637 603 } 638 604 639 605 /** ··· 653 619 devm_reset_control_bulk_get_exclusive_released(struct device *dev, int num_rstcs, 654 620 struct reset_control_bulk_data *rstcs) 655 621 { 656 - return __devm_reset_control_bulk_get(dev, num_rstcs, rstcs, false, false, false); 622 + return __devm_reset_control_bulk_get(dev, num_rstcs, rstcs, 623 + RESET_CONTROL_EXCLUSIVE_RELEASED); 657 624 } 658 625 659 626 /** ··· 673 638 __must_check devm_reset_control_get_optional_exclusive_released(struct device *dev, 674 639 const char *id) 675 640 { 676 - return __devm_reset_control_get(dev, id, 0, false, true, false); 641 + return __devm_reset_control_get(dev, id, 0, RESET_CONTROL_OPTIONAL_EXCLUSIVE_RELEASED); 677 642 } 678 643 679 644 /** ··· 693 658 devm_reset_control_bulk_get_optional_exclusive_released(struct device *dev, int num_rstcs, 694 659 struct reset_control_bulk_data *rstcs) 695 660 { 696 - return __devm_reset_control_bulk_get(dev, num_rstcs, rstcs, false, true, false); 661 + return __devm_reset_control_bulk_get(dev, num_rstcs, rstcs, 662 + RESET_CONTROL_OPTIONAL_EXCLUSIVE_RELEASED); 697 663 } 698 664 699 665 /** ··· 709 673 static inline struct reset_control *devm_reset_control_get_shared( 710 674 struct device *dev, const char *id) 711 675 { 712 - return __devm_reset_control_get(dev, id, 0, true, false, false); 676 + return __devm_reset_control_get(dev, id, 0, RESET_CONTROL_SHARED); 713 677 } 714 678 715 679 /** ··· 729 693 devm_reset_control_bulk_get_shared(struct device *dev, int num_rstcs, 730 694 struct reset_control_bulk_data *rstcs) 731 695 { 732 - return __devm_reset_control_bulk_get(dev, num_rstcs, rstcs, true, false, false); 696 + return __devm_reset_control_bulk_get(dev, num_rstcs, rstcs, RESET_CONTROL_SHARED); 733 697 } 734 698 735 699 /** ··· 747 711 static inline struct reset_control *devm_reset_control_get_optional_exclusive( 748 712 struct device *dev, const char *id) 749 713 { 750 - return __devm_reset_control_get(dev, id, 0, false, true, true); 714 + return __devm_reset_control_get(dev, id, 0, RESET_CONTROL_OPTIONAL_EXCLUSIVE); 751 715 } 752 716 753 717 /** ··· 767 731 devm_reset_control_bulk_get_optional_exclusive(struct device *dev, int num_rstcs, 768 732 struct reset_control_bulk_data *rstcs) 769 733 { 770 - return __devm_reset_control_bulk_get(dev, num_rstcs, rstcs, false, true, true); 734 + return __devm_reset_control_bulk_get(dev, num_rstcs, rstcs, 735 + RESET_CONTROL_OPTIONAL_EXCLUSIVE); 771 736 } 772 737 773 738 /** ··· 786 749 static inline struct reset_control *devm_reset_control_get_optional_shared( 787 750 struct device *dev, const char *id) 788 751 { 789 - return __devm_reset_control_get(dev, id, 0, true, true, false); 752 + return __devm_reset_control_get(dev, id, 0, RESET_CONTROL_OPTIONAL_SHARED); 790 753 } 791 754 792 755 /** ··· 806 769 devm_reset_control_bulk_get_optional_shared(struct device *dev, int num_rstcs, 807 770 struct reset_control_bulk_data *rstcs) 808 771 { 809 - return __devm_reset_control_bulk_get(dev, num_rstcs, rstcs, true, true, false); 772 + return __devm_reset_control_bulk_get(dev, num_rstcs, rstcs, RESET_CONTROL_OPTIONAL_SHARED); 810 773 } 811 774 812 775 /** ··· 824 787 static inline struct reset_control * 825 788 devm_reset_control_get_exclusive_by_index(struct device *dev, int index) 826 789 { 827 - return __devm_reset_control_get(dev, NULL, index, false, false, true); 790 + return __devm_reset_control_get(dev, NULL, index, RESET_CONTROL_EXCLUSIVE); 828 791 } 829 792 830 793 /** ··· 840 803 static inline struct reset_control * 841 804 devm_reset_control_get_shared_by_index(struct device *dev, int index) 842 805 { 843 - return __devm_reset_control_get(dev, NULL, index, true, false, false); 806 + return __devm_reset_control_get(dev, NULL, index, RESET_CONTROL_SHARED); 844 807 } 845 808 846 809 /* ··· 888 851 static inline struct reset_control * 889 852 devm_reset_control_array_get_exclusive(struct device *dev) 890 853 { 891 - return devm_reset_control_array_get(dev, false, false); 854 + return devm_reset_control_array_get(dev, RESET_CONTROL_EXCLUSIVE); 892 855 } 893 856 894 857 static inline struct reset_control * 895 858 devm_reset_control_array_get_shared(struct device *dev) 896 859 { 897 - return devm_reset_control_array_get(dev, true, false); 860 + return devm_reset_control_array_get(dev, RESET_CONTROL_SHARED); 898 861 } 899 862 900 863 static inline struct reset_control * 901 864 devm_reset_control_array_get_optional_exclusive(struct device *dev) 902 865 { 903 - return devm_reset_control_array_get(dev, false, true); 866 + return devm_reset_control_array_get(dev, RESET_CONTROL_OPTIONAL_EXCLUSIVE); 904 867 } 905 868 906 869 static inline struct reset_control * 907 870 devm_reset_control_array_get_optional_shared(struct device *dev) 908 871 { 909 - return devm_reset_control_array_get(dev, true, true); 872 + return devm_reset_control_array_get(dev, RESET_CONTROL_OPTIONAL_SHARED); 910 873 } 911 874 912 875 static inline struct reset_control * 913 876 of_reset_control_array_get_exclusive(struct device_node *node) 914 877 { 915 - return of_reset_control_array_get(node, false, false, true); 878 + return of_reset_control_array_get(node, RESET_CONTROL_EXCLUSIVE); 916 879 } 917 880 918 881 static inline struct reset_control * 919 882 of_reset_control_array_get_exclusive_released(struct device_node *node) 920 883 { 921 - return of_reset_control_array_get(node, false, false, false); 884 + return of_reset_control_array_get(node, RESET_CONTROL_EXCLUSIVE_RELEASED); 922 885 } 923 886 924 887 static inline struct reset_control * 925 888 of_reset_control_array_get_shared(struct device_node *node) 926 889 { 927 - return of_reset_control_array_get(node, true, false, true); 890 + return of_reset_control_array_get(node, RESET_CONTROL_SHARED); 928 891 } 929 892 930 893 static inline struct reset_control * 931 894 of_reset_control_array_get_optional_exclusive(struct device_node *node) 932 895 { 933 - return of_reset_control_array_get(node, false, true, true); 896 + return of_reset_control_array_get(node, RESET_CONTROL_OPTIONAL_EXCLUSIVE); 934 897 } 935 898 936 899 static inline struct reset_control * 937 900 of_reset_control_array_get_optional_shared(struct device_node *node) 938 901 { 939 - return of_reset_control_array_get(node, true, true, true); 902 + return of_reset_control_array_get(node, RESET_CONTROL_OPTIONAL_SHARED); 940 903 } 941 904 #endif