* [PATCH] Bluetooth: btqcomsmd: Fix channel open check
@ 2018-02-28 0:17 Bjorn Andersson
2018-02-28 6:25 ` Marcel Holtmann
0 siblings, 1 reply; 3+ messages in thread
From: Bjorn Andersson @ 2018-02-28 0:17 UTC (permalink / raw)
To: Marcel Holtmann, Johan Hedberg, Andy Gross, David Brown
Cc: linux-bluetooth, linux-kernel, linux-arm-msm, linux-soc, stable
rpmsg_create_ept() returns NULL on error and as such
qcom_wcnss_open_channel() does the same. Clarify this in the
kernel-doc and correct the error checks in btqcomsmd.
Fixes: 1511cc750c3d ("Bluetooth: Introduce Qualcomm WCNSS SMD based HCI driver")
Cc: stable@vger.kernel.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---
drivers/bluetooth/btqcomsmd.c | 8 ++++----
drivers/soc/qcom/wcnss_ctrl.c | 2 ++
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/bluetooth/btqcomsmd.c b/drivers/bluetooth/btqcomsmd.c
index 2c9a5fc9137d..24f702927875 100644
--- a/drivers/bluetooth/btqcomsmd.c
+++ b/drivers/bluetooth/btqcomsmd.c
@@ -151,13 +151,13 @@ static int btqcomsmd_probe(struct platform_device *pdev)
btq->acl_channel = qcom_wcnss_open_channel(wcnss, "APPS_RIVA_BT_ACL",
btqcomsmd_acl_callback, btq);
- if (IS_ERR(btq->acl_channel))
- return PTR_ERR(btq->acl_channel);
+ if (!btq->acl_channel)
+ return -ENOENT;
btq->cmd_channel = qcom_wcnss_open_channel(wcnss, "APPS_RIVA_BT_CMD",
btqcomsmd_cmd_callback, btq);
- if (IS_ERR(btq->cmd_channel))
- return PTR_ERR(btq->cmd_channel);
+ if (!btq->cmd_channel)
+ return -ENOENT;
/* The local-bd-address property is usually injected by the
* bootloader which has access to the allocated BD address.
diff --git a/drivers/soc/qcom/wcnss_ctrl.c b/drivers/soc/qcom/wcnss_ctrl.c
index d008e5b82db4..e968559b0fc4 100644
--- a/drivers/soc/qcom/wcnss_ctrl.c
+++ b/drivers/soc/qcom/wcnss_ctrl.c
@@ -275,6 +275,8 @@ static int wcnss_download_nv(struct wcnss_ctrl *wcnss, bool *expect_cbc)
* @wcnss: wcnss handle, retrieved from drvdata
* @name: SMD channel name
* @cb: callback to handle incoming data on the channel
+ *
+ * Return: rpmsg_endpoint object on success, NULL on error
*/
struct rpmsg_endpoint *qcom_wcnss_open_channel(void *wcnss, const char *name, rpmsg_rx_cb_t cb, void *priv)
{
--
2.16.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Bluetooth: btqcomsmd: Fix channel open check
2018-02-28 0:17 [PATCH] Bluetooth: btqcomsmd: Fix channel open check Bjorn Andersson
@ 2018-02-28 6:25 ` Marcel Holtmann
2018-03-04 19:55 ` Bjorn Andersson
0 siblings, 1 reply; 3+ messages in thread
From: Marcel Holtmann @ 2018-02-28 6:25 UTC (permalink / raw)
To: Bjorn Andersson
Cc: Johan Hedberg, Andy Gross, David Brown, Bluez mailing list,
Linux Kernel Mailing List, linux-arm-msm, linux-soc, stable
Hi Bjorn,
> rpmsg_create_ept() returns NULL on error and as such
> qcom_wcnss_open_channel() does the same. Clarify this in the
> kernel-doc and correct the error checks in btqcomsmd.
>
> Fixes: 1511cc750c3d ("Bluetooth: Introduce Qualcomm WCNSS SMD based HCI driver")
> Cc: stable@vger.kernel.org
> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> ---
> drivers/bluetooth/btqcomsmd.c | 8 ++++----
> drivers/soc/qcom/wcnss_ctrl.c | 2 ++
> 2 files changed, 6 insertions(+), 4 deletions(-)
I think you better split this into two separate patches so they can go via its subsystems independently.
>
> diff --git a/drivers/bluetooth/btqcomsmd.c b/drivers/bluetooth/btqcomsmd.c
> index 2c9a5fc9137d..24f702927875 100644
> --- a/drivers/bluetooth/btqcomsmd.c
> +++ b/drivers/bluetooth/btqcomsmd.c
> @@ -151,13 +151,13 @@ static int btqcomsmd_probe(struct platform_device *pdev)
>
> btq->acl_channel = qcom_wcnss_open_channel(wcnss, "APPS_RIVA_BT_ACL",
> btqcomsmd_acl_callback, btq);
> - if (IS_ERR(btq->acl_channel))
> - return PTR_ERR(btq->acl_channel);
> + if (!btq->acl_channel)
> + return -ENOENT;
>
> btq->cmd_channel = qcom_wcnss_open_channel(wcnss, "APPS_RIVA_BT_CMD",
> btqcomsmd_cmd_callback, btq);
> - if (IS_ERR(btq->cmd_channel))
> - return PTR_ERR(btq->cmd_channel);
> + if (!btq->cmd_channel)
> + return -ENOENT;
Any reason not to fix qcom_wcnss_open_channel to use PTR_ERR?
Regards
Marcel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Bluetooth: btqcomsmd: Fix channel open check
2018-02-28 6:25 ` Marcel Holtmann
@ 2018-03-04 19:55 ` Bjorn Andersson
0 siblings, 0 replies; 3+ messages in thread
From: Bjorn Andersson @ 2018-03-04 19:55 UTC (permalink / raw)
To: Marcel Holtmann
Cc: Johan Hedberg, Andy Gross, David Brown, Bluez mailing list,
Linux Kernel Mailing List, linux-arm-msm, linux-soc, stable
On Tue 27 Feb 22:25 PST 2018, Marcel Holtmann wrote:
> > btq->cmd_channel = qcom_wcnss_open_channel(wcnss, "APPS_RIVA_BT_CMD",
> > btqcomsmd_cmd_callback, btq);
> > - if (IS_ERR(btq->cmd_channel))
> > - return PTR_ERR(btq->cmd_channel);
> > + if (!btq->cmd_channel)
> > + return -ENOENT;
>
> Any reason not to fix qcom_wcnss_open_channel to use PTR_ERR?
>
Not that I can come up with, and obviously I did expect it to do so in
the past. I'll do that.
Thanks,
Bjorn
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-03-04 19:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-28 0:17 [PATCH] Bluetooth: btqcomsmd: Fix channel open check Bjorn Andersson
2018-02-28 6:25 ` Marcel Holtmann
2018-03-04 19:55 ` Bjorn Andersson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).