lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Wed, 1 Jul 2015 11:41:05 +0200 From: Tomeu Vizoso <tomeu.vizoso@...labora.com> To: linux-kernel@...r.kernel.org Cc: Mark Brown <broonie@...nel.org>, linux-acpi@...r.kernel.org, dri-devel@...ts.freedesktop.org, linux-fbdev@...r.kernel.org, linux-gpio@...r.kernel.org, devicetree@...r.kernel.org, linux-pwm@...r.kernel.org, "Rafael J. Wysocki" <rjw@...ysocki.net>, alsa-devel@...a-project.org, Tomeu Vizoso <tomeu.vizoso@...labora.com>, Thierry Reding <thierry.reding@...il.com> Subject: [PATCH v2 10/12] pwm: register dependency parser for firmware nodes So others can find out what depends on pwm controllers, as specified in bindings/pwm/pwm.txt. Signed-off-by: Tomeu Vizoso <tomeu.vizoso@...labora.com> --- Changes in v2: None drivers/pwm/core.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c index 3a7769f..81b4fc0 100644 --- a/drivers/pwm/core.c +++ b/drivers/pwm/core.c @@ -917,11 +917,39 @@ static const struct file_operations pwm_debugfs_ops = { .release = seq_release, }; +static void pwm_get_dependencies(struct fwnode_handle *fwnode, + struct list_head *deps) +{ + struct device_node *np; + struct of_phandle_args pspec; + int count, i, ret; + + np = to_of_node(fwnode); + if (!np) + return; + + count = of_count_phandle_with_args(np, "pwms", + "#pwm-cells"); + for (i = 0; i < count; i++) { + ret = of_parse_phandle_with_args(np, "pwms", + "#pwm-cells", i, + &pspec); + if (ret || !pspec.np) + continue; + + fwnode_add_dependency(&pspec.np->fwnode, deps); + + of_node_put(pspec.np); + } +} + static int __init pwm_debugfs_init(void) { debugfs_create_file("pwm", S_IFREG | S_IRUGO, NULL, NULL, &pwm_debugfs_ops); + fwnode_add_dependency_parser(pwm_get_dependencies); + return 0; } -- 2.4.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@...r.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists