Re: [PATCH v2 3/3] media: exynos4-is: fimc-is: replace duplicate pmu node with phandle

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Krzysztof,

[...]

> +static void __iomem *fimc_is_get_pmu_regs(struct device *dev)
> +{
> +	struct device_node *node;
> +	void __iomem *regs;
> +
> +	node = of_parse_phandle(dev->of_node, "samsung,pmu-syscon", 0);
> +	if (!node) {
> +		dev_warn(dev, "Finding PMU node via deprecated method, update your DTB\n");
> +		node = of_get_child_by_name(dev->of_node, "pmu");
> +		if (!node)
> +			return IOMEM_ERR_PTR(-ENODEV);

in my opinion this should be:

		...
		if (!node)
			return IOMEM_ERR_PTR(-ENODEV);

		dev_warn(dev, "Finding PMU node via deprecated method, update your DTB\n");

Because if you don't have both "samsung,pmu-syscon and "pmu" then
the warning should not be printed and you need to return -ENODEV.

... and... "*please* update your DTB", the user might get upset
and out of sheer spite, decides not to do it – just because! :)

Andi

> +	}



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux