[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAE-0n50G_OYqR6R8+K5RkrCBvdQW-E-zDoMZ-yyAoEJW2WyxcA@mail.gmail.com>
Date: Tue, 24 Aug 2021 11:34:45 -0700
From: Stephen Boyd <swboyd@...omium.org>
To: Deepak Kumar Singh <deesin@...eaurora.org>,
bjorn.andersson@...aro.org, clew@...eaurora.org,
sibis@...eaurora.org
Cc: linux-kernel@...r.kernel.org, linux-arm-msm@...r.kernel.org,
linux-remoteproc@...r.kernel.org, Andy Gross <agross@...nel.org>
Subject: Re: [PATCH V6 1/2] soc: qcom: aoss: Expose send for generic usecase
Quoting Deepak Kumar Singh (2021-08-16 04:39:13)
> Not all upcoming usecases will have an interface to allow the aoss
> driver to hook onto. Expose the send api and create a get function to
> enable drivers to send their own messages to aoss.
>
> Signed-off-by: Chris Lew <clew@...eaurora.org>
> Signed-off-by: Deepak Kumar Singh <deesin@...eaurora.org>
> ---
With one nit below
Reviewed-by: Stephen Boyd <swboyd@...omium.org>
> diff --git a/drivers/soc/qcom/qcom_aoss.c b/drivers/soc/qcom/qcom_aoss.c
> index 934fcc4..a43c22c 100644
> --- a/drivers/soc/qcom/qcom_aoss.c
> +++ b/drivers/soc/qcom/qcom_aoss.c
> @@ -515,6 +521,48 @@ static void qmp_cooling_devices_remove(struct qmp *qmp)
> thermal_cooling_device_unregister(qmp->cooling_devs[i].cdev);
> }
>
> +/**
> + * qmp_get() - get a qmp handle from a device
> + * @dev: client device pointer
> + *
> + * Return: handle to qmp device on success, ERR_PTR() on failure
> + */
> +struct qmp *qmp_get(struct device *dev)
> +{
> + struct platform_device *pdev;
> + struct device_node *np;
> + struct qmp *qmp;
> +
> + if (!dev || !dev->of_node)
> + return ERR_PTR(-EINVAL);
> +
> + np = of_parse_phandle(dev->of_node, "qcom,qmp", 0);
> + if (!np)
> + return ERR_PTR(-ENODEV);
> +
> + pdev = of_find_device_by_node(np);
> + of_node_put(np);
> + if (!pdev)
> + return ERR_PTR(-EINVAL);
> +
> + qmp = platform_get_drvdata(pdev);
> +
> + return qmp ? qmp : ERR_PTR(-EPROBE_DEFER);
> +}
> +EXPORT_SYMBOL(qmp_get);
> +
> +/**
> + * qmp_put() - Match get_device() inside of_find_device_by_node()
> + * in qmp_get()
I meant to put this comment next to the put_device() call. This should
say something like "release a qmp handle" and then the existing comment
moved down to the if below.
> + * @qmp: qmp handle obtained from qmp_get()
> + */
> +void qmp_put(struct qmp *qmp)
> +{
> + if (!IS_ERR_OR_NULL(qmp))
> + put_device(qmp->dev);
> +}
> +EXPORT_SYMBOL(qmp_put);
> +
> static int qmp_probe(struct platform_device *pdev)
> {
> struct resource *res;
Powered by blists - more mailing lists