Thread (24 messages) 24 messages, 3 authors, 2016-03-31

[PATCH v7 01/20] PM / devfreq: exynos: Add generic exynos bus frequency driver

From: Chanwoo Choi <hidden>
Date: 2016-03-31 12:28:36
Also in: linux-devicetree, linux-pm, linux-samsung-soc, lkml

On Thu, Mar 31, 2016 at 9:10 PM, Sylwester Nawrocki
[off-list ref] wrote:
On 03/31/2016 11:05 AM, Chanwoo Choi wrote:
quoted
+static int exynos_bus_target(struct device *dev, unsigned long *freq, u32 flags)
+{
quoted
+     new_opp = devfreq_recommended_opp(dev, freq, flags);
+     if (IS_ERR_OR_NULL(new_opp)) {
+             dev_err(dev, "failed to get recommed opp instance\n");
s/recommed/recommended/
OK. I'll fix it.
quoted
+             rcu_read_unlock();
+             return PTR_ERR(new_opp);
+     }
quoted
+}
quoted
+static int exynos_bus_probe(struct platform_device *pdev)
+{
quoted
+     bus->devfreq = devm_devfreq_add_device(dev, profile, "simple_ondemand",
+                                             ondemand_data);
+     if (IS_ERR_OR_NULL(bus->devfreq)) {
+             dev_err(dev, "failed to add devfreq device\n");
+             return  PTR_ERR(bus->devfreq);
+     }
quoted
+}
You should use IS_ERR() instead of IS_ERR_OR_NULL(), since functions
of which the return value is being tested return only ERR_PTR() values.
IS_ERR_OR_NULL() suggest NULL values are possible and then constructs
like
        if (IS_ERR_OR_NULL(result))
                return PTR_ERR(result);

are not correct anyway.
OK. I'll use IS_ERR() instead of IS_ERR_OR_NULL()

Thanks,
Chanwoo Choi
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help