Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1412585 > unrolled thread

Re: [Patch v5 2/8] firmware: qcom: scm: Convert SCM to platform driver

Started byStephen Boyd <sboyd@codeaurora.org>
First post2016-06-03 00:20 +0200
Last post2016-06-03 05:50 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [Patch v5 2/8] firmware: qcom: scm: Convert SCM to platform  driver Stephen Boyd <sboyd@codeaurora.org> - 2016-06-03 00:20 +0200
    Re: [Patch v5 2/8] firmware: qcom: scm: Convert SCM to platform  driver Andy Gross <andy.gross@linaro.org> - 2016-06-03 05:50 +0200

#1412585 — Re: [Patch v5 2/8] firmware: qcom: scm: Convert SCM to platform driver

FromStephen Boyd <sboyd@codeaurora.org>
Date2016-06-03 00:20 +0200
SubjectRe: [Patch v5 2/8] firmware: qcom: scm: Convert SCM to platform driver
Message-ID<rFJ86-3ml-17@gated-at.bofh.it>
On 05/12, Andy Gross wrote:
> This patch converts the Qualcomm SCM firmware driver into a platform
> driver.

And introduces clk enable/disable + rate setting logic because
the firmware uses crypto clks during some scm calls.

> 
> +
> +static struct platform_driver qcom_scm_driver = {
> +	.driver = {
> +		.name	= "qcom_scm",
> +		.of_match_table = qcom_scm_dt_match,
> +	},
> +	.probe = qcom_scm_probe,
> +};
> +
> +static int __init qcom_scm_init(void)
> +{
> +	struct device_node *np, *parent;
> +	int ret;
> +
> +	np = of_find_matching_node_and_match(NULL, qcom_scm_dt_match, NULL);

Why can't we find a node called "firmware" in the root of the
tree? That would be clearer what's going on here, and avoid the
need to do the of_get_next_parent() dance, which just feels
awkward.

> +
> +	if (!np)
> +		return -ENODEV;
> +
> +	parent = of_get_next_parent(np);
> +	ret = of_platform_populate(parent, qcom_scm_dt_match, NULL, NULL);
> +
> +	of_node_put(parent);
> +
> +	if (ret)
> +		return ret;
> +
> +	return platform_driver_register(&qcom_scm_driver);
> +}

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

[toc] | [next] | [standalone]


#1412759

FromAndy Gross <andy.gross@linaro.org>
Date2016-06-03 05:50 +0200
Message-ID<rFOhr-6qj-1@gated-at.bofh.it>
In reply to#1412585
On Thu, Jun 02, 2016 at 03:14:24PM -0700, Stephen Boyd wrote:
> On 05/12, Andy Gross wrote:
> > This patch converts the Qualcomm SCM firmware driver into a platform
> > driver.
> 
> And introduces clk enable/disable + rate setting logic because
> the firmware uses crypto clks during some scm calls.

I'll make the commit message more descriptive of the change.

> > 
> > +
> > +static struct platform_driver qcom_scm_driver = {
> > +	.driver = {
> > +		.name	= "qcom_scm",
> > +		.of_match_table = qcom_scm_dt_match,
> > +	},
> > +	.probe = qcom_scm_probe,
> > +};
> > +
> > +static int __init qcom_scm_init(void)
> > +{
> > +	struct device_node *np, *parent;
> > +	int ret;
> > +
> > +	np = of_find_matching_node_and_match(NULL, qcom_scm_dt_match, NULL);
> 
> Why can't we find a node called "firmware" in the root of the
> tree? That would be clearer what's going on here, and avoid the
> need to do the of_get_next_parent() dance, which just feels
> awkward.

Well I had reworked it previously to avoid calling of_platform_populate on
anyone with a firmware node.  I guess what I can do is find the firmware node
and then only populate if I get a match starting from the firmware node itself.
That satisfies both comments.

> > +
> > +	if (!np)
> > +		return -ENODEV;
> > +
> > +	parent = of_get_next_parent(np);
> > +	ret = of_platform_populate(parent, qcom_scm_dt_match, NULL, NULL);
> > +
> > +	of_node_put(parent);
> > +
> > +	if (ret)
> > +		return ret;
> > +
> > +	return platform_driver_register(&qcom_scm_driver);
> > +}
> 
> -- 
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
> a Linux Foundation Collaborative Project
> --
> To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web