From patchwork Fri Nov 23 05:17:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 151832 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp1620383ljp; Thu, 22 Nov 2018 21:17:51 -0800 (PST) X-Google-Smtp-Source: AFSGD/W0Rq10aFidP3c0d0rE//heqLCu7mHKDcKoJRvEBjf+n6xfDneRVjMAx9klWrIwFUOzrYnC X-Received: by 2002:a17:902:a9:: with SMTP id a38-v6mr14288465pla.7.1542950271258; Thu, 22 Nov 2018 21:17:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542950271; cv=none; d=google.com; s=arc-20160816; b=r66ytQLdLZZ2GP4YuMif/8rHoKSgiEY8x2XytRgWUDkErNlSQb7GKUs9kI/xiiG+0Q DfmXwHIsYTiHUvsUK4QSqAyoTf4jQGxKJ+e8qyjAVE/7SCXAMMVGN8JfwG+ERECFHVuE QBsqx5Y6BYAMiX74w1aL7NCC2nLKsJxZMzyHbCxfYhp1Dde9kXiSyVhGgnNRzjcJwTfZ v+SqSlLZCL6g1QheHzEAME8nCvaM8rbx4rV7WvxDbqtSHLdFI0h5tnMhrWZzKFA8Shkw 1VEZ9tnQDsNHVU8pVygXok9in7G65/TW+m4jphuaPA6MNdalD+hlAQvfJEi4xUSsit6Z 4vgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=CrGF4Pn0d98pLUFr05KPUGiIPnRW8D0Q9xw+2xE4GC0=; b=apWT8/YcndLvQZqZX0Ouwe1BKsCkCPiEUsSBTtEUHXuRiufKjo5YTssI9rHyxzLm2O +xDp0Wx+prGoEdzD8nZOrATWeeublAX/Mtvce1+s91zYovCZkdRLaePHbMr5Zg1zui2Q j17he+7BRAtpBNaLDPgeCMDqlWaa6iURFDy6gcoCXxRRRfUi0xSQuSBqMzeFDLn8evVZ Yz5vHMssjBaugHGfh1cIEV0ddnldB/OjeqzlqMYcRBRwzzUK1X3Pjc5mBmj6avfiro9v QV79n9NDRbsrY9GLyPrtB7V4ot+Rea1FRNVw/siWXlQhv0ErxTbvDi+ccmV2O8zgH1ad cyKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MJsKdtTe; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l4si47857448pgr.346.2018.11.22.21.17.50; Thu, 22 Nov 2018 21:17:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MJsKdtTe; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2501927AbeKWQA0 (ORCPT + 11 others); Fri, 23 Nov 2018 11:00:26 -0500 Received: from mail-pf1-f196.google.com ([209.85.210.196]:34865 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731634AbeKWQA0 (ORCPT ); Fri, 23 Nov 2018 11:00:26 -0500 Received: by mail-pf1-f196.google.com with SMTP id z9so2826097pfi.2 for ; Thu, 22 Nov 2018 21:17:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=CrGF4Pn0d98pLUFr05KPUGiIPnRW8D0Q9xw+2xE4GC0=; b=MJsKdtTedsWF16VgfZJ+CUjONmM2B5JosVsewpkSkoIj0iHvMVIMyTGI7f9316OBwL 09zV8tkqmhkLqJm0+X3POECtb86Q+3zDJrevm3s31mCCHrG+ywKV8ennAYzQdKaaNggu eVd4JDThnPbF+EkEbjLBvwSvz21g13Mi16o/I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=CrGF4Pn0d98pLUFr05KPUGiIPnRW8D0Q9xw+2xE4GC0=; b=ZumVmq/Kn6J9ArGrL3pMu/qCh5qe0/GUgfGC3GKEHt2cf6YGercoBFIi3AYpRnfX4m uG+D08M3aS8mxrQnVkcHlmzZn4vzd90HoNsowG7TmsiPZzv5u51t5ok4sZJlj+rBuV8h 7fJaVZab5nR4dg6mf+Dc0SpenPTmDwEkb3Q/1BDcBvokh1HWHrsx4R1UccxP6+3zTjxq cAfCjaXgXGP/uvwXMbe6nBHKmeZjsIWPGhXsQSaeH2zKefNuNx2JXe8xuUcupu+YX+xp TMeCMyDYhx7I04VUgK4yOnyeEs5LIAIhzEXVSEBQESZMKykwlbZOArnObzwxSVymxGFt KCCg== X-Gm-Message-State: AA+aEWZinEqwSjAmTTY0cUZ1UpdDeEKvjDj6pM0R0z3VDkn0HOoS3XGr 8EtkWCj6jUhdttgReQKotlcvXg== X-Received: by 2002:a63:e545:: with SMTP id z5mr12769946pgj.195.1542950268056; Thu, 22 Nov 2018 21:17:48 -0800 (PST) Received: from localhost ([122.172.88.116]) by smtp.gmail.com with ESMTPSA id i123sm34900075pfg.164.2018.11.22.21.17.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Nov 2018 21:17:47 -0800 (PST) From: Viresh Kumar To: Viresh Kumar , Nishanth Menon , Stephen Boyd Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , Rafael Wysocki , linux-kernel@vger.kernel.org Subject: [PATCH] OPP: Fix parsing of multiple phandles in "operating-points-v2" property Date: Fri, 23 Nov 2018 10:47:30 +0530 Message-Id: <3e27c79c4b121a64e85f26ab8957e5d0a09ff28e.1542950247.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.19.1.568.g152ad8e3369a MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org We currently return error if more than one phandle is present in the "operating-points-v2" property, which is incorrect. We only want to check the count of phandles here and set index to 0 if only one phandle is present. Fix it. Fixes: 5ed4cecd75e9 ("OPP: Pass OPP table to _of_add_opp_table_v{1|2}()") Signed-off-by: Viresh Kumar --- drivers/opp/of.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) -- 2.19.1.568.g152ad8e3369a diff --git a/drivers/opp/of.c b/drivers/opp/of.c index 5a4b47958073..38a08805a30c 100644 --- a/drivers/opp/of.c +++ b/drivers/opp/of.c @@ -579,10 +579,8 @@ int dev_pm_opp_of_add_table_indexed(struct device *dev, int index) */ count = of_count_phandle_with_args(dev->of_node, "operating-points-v2", NULL); - if (count != 1) - return -ENODEV; - - index = 0; + if (count == 1) + index = 0; } opp_table = dev_pm_opp_get_opp_table_indexed(dev, index);