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


Groups > linux.kernel > #1314247

Re: [PATCH V3 06/11] thermal: tegra: add a debugfs to show registers

From Thierry Reding <thierry.reding@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH V3 06/11] thermal: tegra: add a debugfs to show registers
Date 2016-01-21 16:00 +0100
Message-ID <qToSn-6CC-35@gated-at.bofh.it> (permalink)
References <qSeV4-7C5-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On Mon, Jan 18, 2016 at 06:03:57PM +0800, Wei Ni wrote:
[...]
> diff --git a/drivers/thermal/tegra/soctherm.c b/drivers/thermal/tegra/soctherm.c
[...]
> +static void soctherm_debug_init(struct platform_device *pdev)
> +{
> +	struct tegra_soctherm *tegra = platform_get_drvdata(pdev);
> +	struct dentry *root, *file;
> +
> +	root = debugfs_create_dir("tegra_soctherm", NULL);

Perhaps leave away the tegra_ prefix here? It's kind of redundant.

> +	if (!root) {
> +		dev_err(&pdev->dev, "failed to create debugfs directory\n");
> +		return;
> +	}
> +
> +	tegra->debugfs_dir = root;
> +
> +	file = debugfs_create_file("regs", 0644, root, pdev, &regs_fops);

Can we call this something different, please? "summary" would be a
better name, in my opinion.

> +	if (!file)
> +		dev_err(&pdev->dev, "failed to create debugfs file\n");
> +}
> +#else
> +static inline void soctherm_debug_init(struct platform_device *pdev)
> +{ return 0; }

Please follow the regular CodingStyle here, too:

	...
	{
		return 0;
	}

> @@ -178,6 +309,10 @@ static int tegra_soctherm_probe(struct platform_device *pdev)
>  	if (!tegra)
>  		return -ENOMEM;
>  
> +	dev_set_drvdata(&pdev->dev, tegra);
> +
> +	tegra->soc = soc;

This looks odd here. Does this perhaps belong in one of the previous
patches?

Thierry

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH V3 06/11] thermal: tegra: add a debugfs to show registers Wei Ni <wni@nvidia.com> - 2016-01-18 11:10 +0100
  Re: [PATCH V3 06/11] thermal: tegra: add a debugfs to show registers Thierry Reding <thierry.reding@gmail.com> - 2016-01-21 16:00 +0100
    Re: [PATCH V3 06/11] thermal: tegra: add a debugfs to show registers Wei Ni <wni@nvidia.com> - 2016-01-25 07:00 +0100

csiph-web