On Mon, Aug 18, 2014 at 03:45:15PM +0530, Subhransu S. Prusty wrote:
On Mon, Aug 18, 2014 at 11:06:09AM +0530, Subhransu S. Prusty wrote:
I wouldn't expect an info call to be allocating anything - why is it doing that? It's not looking at the alocated data except to see if the allocation succeeded. What happens if someone manages to do a get or set without having first done an info and why aren't we doing any allocation on initialisation?
Will move after control initialization.
As I have to initialize the params, and if it's done in probe after control creation, it's required to iterate over the controls list and match certain pattern to find the control and then initialize. This doesn't look elegant. Instead I would prefer adding an init callback in the control to do this operation. What do you recommend?
Something like that sounds reasonable, or doing it when writing to the control - the point is that info() is a terrible place to do this for the reasons outline above.