diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2012-03-14 14:39:42 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-03-14 12:14:25 -0700 |
commit | 1ccb7b6249f9bc50678e2a383084ed0a34cc9239 (patch) | |
tree | 09ffce08ad018f5a4cf2b0b6f42af0704946e6e4 /drivers/staging/mei/wd.c | |
parent | 5f9092f36fa8707d487a911299b21d6df846319c (diff) | |
download | linux-1ccb7b6249f9bc50678e2a383084ed0a34cc9239.tar.bz2 |
staging/mei: propagate error codes up in the write flow
Change mei_write_message's return type from bool to int
to enable propagation of the error code up to caller functions.
The function now returns -EIO when low level write fails and 0
on success.
A similar change is done in intermediate caller functions:
mei_send_flow_control, mei_connect, and mei_disconnect
This makes code more alike to typical Linux kernel error
handling.
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/mei/wd.c')
-rw-r--r-- | drivers/staging/mei/wd.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/staging/mei/wd.c b/drivers/staging/mei/wd.c index f397835d7be9..a6910da78a64 100644 --- a/drivers/staging/mei/wd.c +++ b/drivers/staging/mei/wd.c @@ -74,7 +74,7 @@ bool mei_wd_host_init(struct mei_device *dev) dev_dbg(&dev->pdev->dev, "check wd_cl\n"); if (MEI_FILE_CONNECTING == dev->wd_cl.state) { - if (!mei_connect(dev, &dev->wd_cl)) { + if (mei_connect(dev, &dev->wd_cl)) { dev_dbg(&dev->pdev->dev, "Failed to connect to WD client\n"); dev->wd_cl.state = MEI_FILE_DISCONNECTED; dev->wd_cl.host_client_id = 0; @@ -119,9 +119,7 @@ int mei_wd_send(struct mei_device *dev) else return -EINVAL; - if (mei_write_message(dev, mei_hdr, dev->wd_data, mei_hdr->length)) - return 0; - return -EIO; + return mei_write_message(dev, mei_hdr, dev->wd_data, mei_hdr->length); } /** |