[PATCH 3/9] HSI: cmt_speech: Return error if HSI port not configured

From: Sebastian Reichel
Date: Sun Mar 01 2015 - 23:41:36 EST


From: Kai Vehmanen <kai.vehmanen@xxxxxxxxx>

If HSI port is not configured by ssi_protocol, return an error from
char device open.

Signed-off-by: Kai Vehmanen <kai.vehmanen@xxxxxxxxx>
Acked-by: Carlos Chinea <carlos.chinea@xxxxxxxxx>
Signed-off-by: Joni Lapilainen <joni.lapilainen@xxxxxxxxx>
Signed-off-by: Sebastian Reichel <sre@xxxxxxxxxx>
---
drivers/hsi/clients/cmt_speech.c | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/drivers/hsi/clients/cmt_speech.c b/drivers/hsi/clients/cmt_speech.c
index 389eafb..56846c9 100644
--- a/drivers/hsi/clients/cmt_speech.c
+++ b/drivers/hsi/clients/cmt_speech.c
@@ -1037,6 +1037,13 @@ static int cs_hsi_start(struct cs_hsi_iface **hi, struct hsi_client *cl,
dev_err(&cl->device, "Could not get HSI master client\n");
goto leave4;
}
+ if (!ssip_slave_running(hsi_if->master)) {
+ err = -ENODEV;
+ dev_err(&cl->device,
+ "HSI port not initialized\n");
+ goto leave4;
+ }
+
hsi_if->iface_state = CS_STATE_OPENED;
local_bh_disable();
cs_hsi_read_on_control(hsi_if);
--
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/