Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b0e413dd authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Will McVicker
Browse files

UPSTREAM: device property: Add helpers to count items in an array



The usual pattern to allocate the necessary space for an array of properties is
to count them first by calling:

  count = device_property_read_uXX_array(dev, propname, NULL, 0);
  if (count < 0)
	return count;

Introduce helpers device_property_count_uXX() to count items by supplying hard
coded last two parameters to device_property_readXX_array().

Bug: 150877929
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: default avatarHeikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: default avatarWill McVicker <willmcvicker@google.com>
Change-Id: If7cdedae76d0543997b96b3da3d28f6657472d29
(cherry picked from commit 33ee09cd59ce154b64f9df942dfa5456db90d5f9)
parent 55c129b8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment