
Hi Sean,
On Fri, 5 Mar 2021 at 08:12, Sean Anderson sean.anderson@seco.com wrote:
On 3/4/21 11:08 PM, Simon Glass wrote:
Hi Sean,
On Mon, 1 Mar 2021 at 15:46, Sean Anderson sean.anderson@seco.com wrote:
This updates sysinfo documentation to document that detect() must be called first. This allows drivers to cache information in detect() and perform (cheaper) retrieval in the other accessors. This also modifies the only instance where this sequencing was not followed.
Signed-off-by: Sean Anderson sean.anderson@seco.com
common/spl/spl_fit.c | 4 ++++ include/sysinfo.h | 29 ++++++++++++++++++++--------- 2 files changed, 24 insertions(+), 9 deletions(-)
Reviewed-by: Simon Glass sjg@chromium.org
Is it possible to enforce this in the uclass?
So have the uclass call detect() if it hasn't been called? Should there be a way to re-detect?
I mean have a check function (that all off the uclass methods call) that checks it has been called and returns an error immediately if not.
I don't think automatically detecting is a great idea - as you say it makes it hard to re-detect. But just a bool flag in the device's uclass-private data should be enough.
Also I think -EPERM or -EACCES might be better than -ENOENT.
Hm, I thought I saw gazerbeam using ENOENT for this purpose, but on further review it looks like it does not. I think EPERM is good for this.
OK.
Regards, Simon