On 07/28/2011 07:59 PM, Anthony Liguori wrote:
Just define an interface that returns a struct then.  It's no more
complicated than that.

Ok, so we're debating whether to: 1) add an interface returning a pointer to an internal struct; 2) include in the internal struct a pointer-to-function that does a container_of and returns the outer Device object. Otherwise, we're on the same page. I'm quite relieved. ;)

I can see advantages to both approach. The main advantage to (2) is that it scales better when you have multiple interfaces of the same kind exposed by the device. You cannot implement an interface twice.

Paolo

Reply via email to