فهرست منبع

disp: msm: sde: set prop_count for U32 and BOOL type device node props

Set the prop_count corresponding to unsigned 32-bit integers and
boolean types to 1. With this change prop_count should have a
positive value for all properties which exist under the device node.

Change-Id: I601870dc25ab347b742fcc4aa2f6bea2397c6caf
Signed-off-by: Steve Cohen <[email protected]>
Steve Cohen 5 سال پیش
والد
کامیت
dd9f329b96
1فایلهای تغییر یافته به همراه10 افزوده شده و 0 حذف شده
  1. 10 0
      msm/sde/sde_hw_catalog.c

+ 10 - 0
msm/sde/sde_hw_catalog.c

@@ -912,6 +912,8 @@ static int _validate_dt_entry(struct device_node *np,
 		case PROP_TYPE_U32:
 			rc = of_property_read_u32(np, sde_prop[i].prop_name,
 				&val);
+			if (!rc)
+				prop_count[i] = 1;
 			break;
 		case PROP_TYPE_U32_ARRAY:
 			prop_count[i] = of_property_count_u32_elems(np,
@@ -935,6 +937,14 @@ static int _validate_dt_entry(struct device_node *np,
 			if (!snp)
 				rc = -EINVAL;
 			break;
+		case PROP_TYPE_BOOL:
+			/**
+			 * No special handling for bool properties here.
+			 * They will always exist, with value indicating
+			 * if the given key is present or not.
+			 */
+			prop_count[i] = 1;
+			break;
 		default:
 			SDE_DEBUG("invalid property type:%d\n",
 							sde_prop[i].type);