Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp767719pxb; Thu, 12 Nov 2020 16:22:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJwsSPjZ2in9+KKudOGIyGCaQr3WXJOe17CjUwAsY68hPHmnsXLz4IuBIDYJ9hlfYQfd+gS0 X-Received: by 2002:a17:906:241b:: with SMTP id z27mr1830254eja.418.1605226971277; Thu, 12 Nov 2020 16:22:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605226971; cv=none; d=google.com; s=arc-20160816; b=JuIMclq+Q0rRZGacMz24ahEziSXSdN3X/1U8sF03dNnsjPh5ImgI5R1qkBuUWfrwzG 8g8NZg1nNqNJgdu/lCn/Ok7crhtnsZu7rVIXDQqwweDkRYTU/hUdr2eEvGXWZWlEaRki /W+DRlLwfb3EBz+J9RTYEj0GK2MUP6PEmPNYJXcjpdU+LBFcPkdf3smKy9iowAg1lI5i AOgzaJsVFmpLk2EEncSibFKkyA+owZFBTLTll0aQMKwSv2uiUurzNtpGYvX19dEf2IXe wMAqvvNG2XBvXI2hhLcR0DK6CN+tdUMLk9ShPrxwyfZsgEG+c7xz7W0wPRxOcOrqpvWf tFrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:content-transfer-encoding:mime-version :subject:from:references:in-reply-to:message-id:date:dkim-signature; bh=zYhyTtewv9cTBRFra3RVERLaQdRQvYeliH87v1CAyMQ=; b=U0FIFD4KpnnJopBhpXt4DxVs642v8tWyHLwElGKRoMoW1p3z6k/f7fekWqGhRWtAEr Yeozn3XHVEQKnEJCLns7SwN6ucMUROuFItsxsx0EKd2K8kuSlYmh5TbBbfxv1pdqpnVH KdLUtacZbrxdn29MAIKOcvESOK4TdKGRIR+jwvhuIUMGzvy1SDlViFpcCM0TqAjP9JyQ tJf0WdM2No08XFH3uygeANMqb+7fX+vH0ePBqYShI/4z4O8pWwrGut7KNRG2tcQqIKXF +u7zQAJHcRvOAOlPWJBPVuGfoxn+R2e2j1KnmBlLb7Sn7N4Jk0yxusJ9sRtputKzkecF GocQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rere.qmqm.pl header.s=1 header.b=VSygM+O3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s9si5193053edu.457.2020.11.12.16.22.27; Thu, 12 Nov 2020 16:22:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@rere.qmqm.pl header.s=1 header.b=VSygM+O3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726240AbgKMAUc (ORCPT + 99 others); Thu, 12 Nov 2020 19:20:32 -0500 Received: from rere.qmqm.pl ([91.227.64.183]:7626 "EHLO rere.qmqm.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726172AbgKMAUa (ORCPT ); Thu, 12 Nov 2020 19:20:30 -0500 Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 4CXJyj0dJVzSq; Fri, 13 Nov 2020 01:20:29 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1605226829; bh=GU5qJ1nTeXHIDvDBgFSSbRsT2IkPhz3ghAkGAasa5UQ=; h=Date:In-Reply-To:References:From:Subject:To:Cc:From; b=VSygM+O351lVRtDnV3l8XYihCzo7dw0YmgB/qdfCKlhUgrWMdEdMZoWwaqMrD/P6R GhAAzBtFyYDb7sMWC6owOnye3rI0dqOWdGb0Q4pm5ytwiGo6kCzHa7e9dp+DOq9ejs W9YTW+JOekeAn1RPTEfjfDpApVsbZFeyW+tmK2iHSghSP1MJfs4/R9CVgSUfhOqpWE E1tA96p5tOgeVGZ0iRZiCgj4cMk0pQrpL0BdbRaz2Jim1LYqQZE4ZruSLsEktZhCMx Quc7y6bg7SatLm4TUggkpgE9ORifDGmynlOh9iVx1AE3CARMs/7cqaUC22YkPID8V4 IJk5kqlyIfiZQ== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.102.4 at mail Date: Fri, 13 Nov 2020 01:20:28 +0100 Message-Id: In-Reply-To: References: From: =?UTF-8?q?Micha=C5=82=20Miros=C5=82aw?= Subject: [PATCH RESEND 4/4] regulator: workaround self-referent regulators MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To: Liam Girdwood , Mark Brown Cc: Ahmad Fatoum , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Workaround regulators whose supply name happens to be the same as its own name. This fixes boards that used to work before the early supply resolving was removed. The error message is left in place so that offending drivers can be detected. Fixes: aea6cb99703e ("regulator: resolve supply after creating regulator") Cc: stable@vger.kernel.org Reported-by: Ahmad Fatoum Signed-off-by: Michał Mirosław --- drivers/regulator/core.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index ab922ed273f3..38ba579efe2b 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -1844,7 +1844,10 @@ static int regulator_resolve_supply(struct regulator_dev *rdev) if (r == rdev) { dev_err(dev, "Supply for %s (%s) resolved to itself\n", rdev->desc->name, rdev->supply_name); - return -EINVAL; + if (!have_full_constraints()) + return -EINVAL; + r = dummy_regulator_rdev; + get_device(&r->dev); } /* -- 2.20.1