aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/base/regmap/regmap.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
index e4e567e82b84..055a9c3a3b12 100644
--- a/drivers/base/regmap/regmap.c
+++ b/drivers/base/regmap/regmap.c
@@ -499,7 +499,6 @@ static int of_regmap_get_endian(struct device *dev,
499 * From the DT node the endianness value maybe: 499 * From the DT node the endianness value maybe:
500 * REGMAP_ENDIAN_BIG, 500 * REGMAP_ENDIAN_BIG,
501 * REGMAP_ENDIAN_LITTLE, 501 * REGMAP_ENDIAN_LITTLE,
502 * REGMAP_ENDIAN_NATIVE,
503 */ 502 */
504 switch (type) { 503 switch (type) {
505 case REGMAP_ENDIAN_VAL: 504 case REGMAP_ENDIAN_VAL:
@@ -507,8 +506,10 @@ static int of_regmap_get_endian(struct device *dev,
507 *endian = REGMAP_ENDIAN_BIG; 506 *endian = REGMAP_ENDIAN_BIG;
508 else if (of_property_read_bool(np, "little-endian")) 507 else if (of_property_read_bool(np, "little-endian"))
509 *endian = REGMAP_ENDIAN_LITTLE; 508 *endian = REGMAP_ENDIAN_LITTLE;
510 else 509
511 *endian = REGMAP_ENDIAN_NATIVE; 510 if (*endian != REGMAP_ENDIAN_DEFAULT)
511 return 0;
512
512 break; 513 break;
513 case REGMAP_ENDIAN_REG: 514 case REGMAP_ENDIAN_REG:
514 break; 515 break;
@@ -517,15 +518,6 @@ static int of_regmap_get_endian(struct device *dev,
517 } 518 }
518 519
519 /* 520 /*
520 * If the endianness parsed from DT node is REGMAP_ENDIAN_NATIVE, that
521 * maybe means the DT does not care the endianness or it should use
522 * the regmap bus's default endianness, then we should try to check
523 * whether the regmap bus has specified the default endianness.
524 */
525 if (*endian != REGMAP_ENDIAN_NATIVE)
526 return 0;
527
528 /*
529 * Finally, try to parse the endianness from regmap bus config 521 * Finally, try to parse the endianness from regmap bus config
530 * if in device's DT node the endianness property is absent. 522 * if in device's DT node the endianness property is absent.
531 */ 523 */