From patchwork Thu Jun 4 03:18:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 11587815 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CEFB614E3 for ; Thu, 4 Jun 2020 11:55:34 +0000 (UTC) Received: from web01.groups.io (web01.groups.io [66.175.222.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A80EA20663 for ; Thu, 4 Jun 2020 11:55:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=lists.cip-project.org header.i=@lists.cip-project.org header.b="G6HyJFOz" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A80EA20663 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=csie.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=bounce+64572+4705+4520428+8129116@lists.cip-project.org X-Received: by 127.0.0.2 with SMTP id 7SIJYY4521763x4T1LpM9U7I; Thu, 04 Jun 2020 04:55:34 -0700 X-Received: from wens.tw (wens.tw [140.112.30.76]) by mx.groups.io with SMTP id smtpd.web10.6604.1591240766361827726 for ; Wed, 03 Jun 2020 20:19:26 -0700 X-Received: by wens.tw (Postfix, from userid 1000) id 155C860020; Thu, 4 Jun 2020 11:19:20 +0800 (CST) From: "Chen-Yu Tsai (Moxa)" To: nobuhiro1.iwamatsu@toshiba.co.jp, pavel@denx.de Cc: Bartlomiej Zolnierkiewicz , cip-dev@lists.cip-project.org, JohnsonCH.Chen@moxa.com, Viresh Kumar , "Rafael J . Wysocki" , Chen-Yu Tsai Subject: [cip-dev] [4.4.y-cip 09/15] PM / OPP: Fix parsing of opp-microvolt and opp-microamp properties Date: Thu, 4 Jun 2020 11:18:23 +0800 Message-Id: <20200604031829.3254-10-wens@csie.org> In-Reply-To: <20200604031829.3254-1-wens@csie.org> References: <20200604031829.3254-1-wens@csie.org> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: cip-dev@lists.cip-project.org List-Id: Mailing-List: list cip-dev@lists.cip-project.org; contact cip-dev+owner@lists.cip-project.org Delivered-To: mailing list cip-dev@lists.cip-project.org Reply-To: cip-dev@lists.cip-project.org X-Gm-Message-State: yqvK1evT3GiyGt8UXeGTDUhax4520428AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lists.cip-project.org; q=dns/txt; s=20140610; t=1591271734; bh=VBdPfmFTd9DWgFDdV4x+S5yFP8UPrYGfhgzcsGs031g=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=G6HyJFOzQdDcNuoRZe772cJl5MDJOEhOxELu/fjFlYBVhnMgy0IiLnJjQRILabtn1Xo o91G5NODfLCBZ7ZnAwYBkX6SdyvEwn0gI+rRI4J3cj7n7LLCNEX8C/G/D/RK5ONfTEemv csk5C3z2wksXy6HZDYQR3xJgTdkbL5/XO7I= From: Bartlomiej Zolnierkiewicz commit fd8d8e63467c922be9ae4452cca2980d473477d9 upstream. Commit 01fb4d3c39d3 ("PM / OPP: Parse 'opp--' bindings") broke support for parsing standard opp-microvolt and opp-microamp properties. Fix it by setting 'name' string to proper value for !prop cases. Fixes: 01fb4d3c39d3 ("PM / OPP: Parse 'opp-- 'bindings") Signed-off-by: Bartlomiej Zolnierkiewicz Acked-by: Viresh Kumar Signed-off-by: Rafael J. Wysocki Signed-off-by: Chen-Yu Tsai (Moxa) --- drivers/base/power/opp/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/base/power/opp/core.c b/drivers/base/power/opp/core.c index 408fee4cb72df..504a6d4e46723 100644 --- a/drivers/base/power/opp/core.c +++ b/drivers/base/power/opp/core.c @@ -814,7 +814,7 @@ static int opp_parse_supplies(struct dev_pm_opp *opp, struct device *dev, if (!prop) { /* Search for "opp-microvolt" */ - name[13] = '\0'; + sprintf(name, "opp-microvolt"); prop = of_find_property(opp->np, name, NULL); /* Missing property isn't a problem, but an invalid entry is */ @@ -861,7 +861,7 @@ static int opp_parse_supplies(struct dev_pm_opp *opp, struct device *dev, if (!prop) { /* Search for "opp-microamp" */ - name[12] = '\0'; + sprintf(name, "opp-microamp"); prop = of_find_property(opp->np, name, NULL); }