From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755668AbcBIEWx (ORCPT ); Mon, 8 Feb 2016 23:22:53 -0500 Received: from mail-pa0-f52.google.com ([209.85.220.52]:33432 "EHLO mail-pa0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753606AbcBIEWv (ORCPT ); Mon, 8 Feb 2016 23:22:51 -0500 Date: Tue, 9 Feb 2016 09:52:47 +0530 From: Viresh Kumar To: Rafael Wysocki Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, Stephen Boyd , nm@ti.com, open list Subject: Re: [PATCH V2 15/16] cpufreq: dt: drop references to DT node Message-ID: <20160209042247.GF10843@vireshk> References: <20160202061132.GD31828@vireshk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160202061132.GD31828@vireshk> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02-02-16, 11:41, Viresh Kumar wrote: > diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c > +static const char *find_supply_name(struct device *dev) > { > + struct device_node *np; > struct property *pp; > int cpu = dev->id; > + const char *name = NULL; > + > + np = of_node_get(dev->of_node); > + if (!np) { > + dev_err(dev, "failed to find cpu%d node\n", cpu); > + return ERR_PTR(-ENOENT); > + } I have updated that as: + np = of_node_get(dev->of_node); + + /* This must be valid for sure */ + if (WARN_ON(!np)) + return NULL; so that we don't have to check return value of find_supply_name() for errors, as you pointed out in the other patch. Will keep your RBY tag :) -- viresh