lkml.org 
[lkml]   [2021]   [Aug]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v8 07/34] clk: tegra: Support runtime PM and power domain
On Tue, Aug 17, 2021 at 04:27:27AM +0300, Dmitry Osipenko wrote:
[...]
> +struct clk *tegra_clk_register(struct clk_hw *hw)
> +{
> + struct platform_device *pdev;
> + struct device *dev = NULL;
> + struct device_node *np;
> + const char *dev_name;
> +
> + np = tegra_clk_get_of_node(hw);
> +
> + if (!of_device_is_available(np))
> + goto put_node;
> +
> + dev_name = kasprintf(GFP_KERNEL, "tegra_clk_%s", hw->init->name);
> + if (!dev_name)
> + goto put_node;
> +
> + pdev = of_platform_device_create(np, dev_name, NULL);
> + if (!pdev) {
> + pr_err("%s: failed to create device for %pOF\n", __func__, np);
> + kfree(dev_name);
> + goto put_node;
> + }
> +
> + dev = &pdev->dev;
> + pm_runtime_enable(dev);
> +put_node:
> + of_node_put(np);
> +
> + return clk_register(dev, hw);
> +}

This looks wrong. Why do we need struct platform_device objects for each
of these clocks? That's going to be a massive amount of platform devices
and they will completely mess up sysfs.

Thierry
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2021-08-18 16:08    [W:0.707 / U:0.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site