mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-17 17:24:17 +08:00
Platform: OLPC: Avoid a warning if the EC didn't register yet
Just return EPROBE_DEFER, so that whoever attempted to use the EC call can defer their work. Signed-off-by: Lubomir Rintel <lkundrak@v3.sk> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
This commit is contained in:
parent
ec9964b480
commit
560331eaee
@ -125,8 +125,11 @@ int olpc_ec_cmd(u8 cmd, u8 *inbuf, size_t inlen, u8 *outbuf, size_t outlen)
|
||||
struct olpc_ec_priv *ec = ec_priv;
|
||||
struct ec_cmd_desc desc;
|
||||
|
||||
/* Ensure a driver and ec hook have been registered */
|
||||
if (WARN_ON(!ec_driver || !ec_driver->ec_cmd))
|
||||
/* Driver not yet registered. */
|
||||
if (!ec_driver)
|
||||
return -EPROBE_DEFER;
|
||||
|
||||
if (WARN_ON(!ec_driver->ec_cmd))
|
||||
return -ENODEV;
|
||||
|
||||
if (!ec)
|
||||
|
Loading…
Reference in New Issue
Block a user