Commit 560331ea authored by Lubomir Rintel's avatar Lubomir Rintel Committed by Andy Shevchenko

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: default avatarLubomir Rintel <lkundrak@v3.sk>
Acked-by: default avatarPavel Machek <pavel@ucw.cz>
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
parent ec9964b4
...@@ -125,8 +125,11 @@ int olpc_ec_cmd(u8 cmd, u8 *inbuf, size_t inlen, u8 *outbuf, size_t outlen) ...@@ -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 olpc_ec_priv *ec = ec_priv;
struct ec_cmd_desc desc; struct ec_cmd_desc desc;
/* Ensure a driver and ec hook have been registered */ /* Driver not yet registered. */
if (WARN_ON(!ec_driver || !ec_driver->ec_cmd)) if (!ec_driver)
return -EPROBE_DEFER;
if (WARN_ON(!ec_driver->ec_cmd))
return -ENODEV; return -ENODEV;
if (!ec) if (!ec)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment