All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] of: functions to count number of elements and convert regulators
@ 2014-02-11 23:59 Heiko Stübner
  2014-02-12  0:00   ` Heiko Stübner
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Heiko Stübner @ 2014-02-11 23:59 UTC (permalink / raw)
  To: grant.likely; +Cc: robh+dt, devicetree, linux-kernel, Liam Girdwood, Mark Brown

In a different thread [0] Mark Rutland suggested that drivers should not
repeatedly open-code the counting of array elements in a property as well
as handling the format and endianes of the DTB, as these should be limited
to the of_ helper functions.

Therefore the first patch introduces a set of helper functions for counting
the number of u8,...,u64 elements in a property.

The second and third patch convert the two regulator drivers that use this
pattern to instead use both of_property_count_u32_elemens as well as
of_property_read_u32_index.

gpio-regulator change tested on a s3c2416-based device, ti-abb-regulator
compile-tested only.


[0] https://lkml.org/lkml/2014/1/16/172

Heiko Stuebner (3):
  of: add functions to count number of elements in a property
  regulator: gpio-regulator: do not open-code counting and access of dt array elements
  regulator: ti-abb-regulator: do not open-code counting and access of dt array elements

 drivers/of/base.c                    |   32 ++++++++++++++
 drivers/regulator/gpio-regulator.c   |   15 +++----
 drivers/regulator/ti-abb-regulator.c |   43 +++++++++----------
 include/linux/of.h                   |   76 ++++++++++++++++++++++++++++++++++
 4 files changed, 134 insertions(+), 32 deletions(-)

-- 
1.7.10.4

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2014-02-12 15:51 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-11 23:59 [PATCH 0/3] of: functions to count number of elements and convert regulators Heiko Stübner
2014-02-12  0:00 ` [PATCH 1/3] of: add functions to count number of elements in a property Heiko Stübner
2014-02-12  0:00   ` Heiko Stübner
2014-02-12 15:48   ` Mark Brown
2014-02-12  0:01 ` [PATCH 2/3] regulator: gpio-regulator: do not open-code counting and access of dt array elements Heiko Stübner
2014-02-12  0:01   ` Heiko Stübner
2014-02-12 15:51   ` Mark Brown
2014-02-12  0:01 ` [PATCH 3/3] regulator: ti-abb-regulator: " Heiko Stübner
2014-02-12  0:01   ` Heiko Stübner
2014-02-12 15:50   ` Mark Brown
2014-02-12 15:50     ` Mark Brown
2014-02-12  9:25 ` [PATCH 0/3] of: functions to count number of elements and convert regulators Mark Rutland

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.