Thread (14 messages) flat view 14 messages, 7 authors, 2016-02-16

Re: [PATCH] PM / OPP: Initialize regulator pointer to an error value

From: Mark Brown <broonie@kernel.org>
Date: 2016-02-16 01:56:43
Also in: lkml

On Tue, Feb 16, 2016 at 06:30:59AM +0530, Viresh Kumar wrote:
- And so I left the regulator pointer to NULL in OPP core.
- But then I realized that its not safe to call many regulator core
  APIs with NULL regulator, as those caused the crashes reported by
  multiple people now.
- clk APIs guarantee that they return early when NULL clk is passed to
  them.
- Do we need to do the same for regulator core as well ?
No, NULL is explicitly not something you can substitute in,
essentially all the users are just not bothering to implement error
checking and we don't want to encourage that.  The set of use cases
where we legitimately have optional supplies is very small, much smaller
than clocks, because it makes the electrical engineering a lot harder.

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help