From patchwork Fri Nov 13 00:20:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= X-Patchwork-Id: 11902329 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_ALL,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DA8D4C2D0E4 for ; Fri, 13 Nov 2020 00:21:46 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 413DE20A8B for ; Fri, 13 Nov 2020 00:21:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Ck0VlXc1"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=rere.qmqm.pl header.i=@rere.qmqm.pl header.b="VSygM+O3" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 413DE20A8B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=rere.qmqm.pl Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:MIME-Version:Subject:From:References:In-Reply-To: Message-Id:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=rm+k5Px8efGjKpBYM+n4NdWkyXVwYby9xboCgacUaMo=; b=Ck0VlXc15ncK5QX9pv54XBRP2 MCgA5wAym7DKUfJ6H0MwTndRnVFW/5YMfE5rqqSQIjGQZyPfJdW5bPlBktu+ti8xrs4f71EYqF+a9 YW28dB9TbwLj+ozFfZwZ1JvDKw79wLyS6lD58bdSWAychBkjoh7unS6PY5yNFukVjVDxSKUO5ptnZ RyyiYCuLeipJde1eD0m4JCwrId1oU34pER9Y5Hpe99WkwXApoQ3fR4H4j1DYLtwIX+yc3zQSQNSFp 5H4QF7rZJRmtLqQ30PUuQkTS58jaJth1BWiwh71ewW9UoDyvBKMDvggadCsWO3BBDO7nulDzyR+VL nnv9MV4BA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kdMpP-0001V3-Uo; Fri, 13 Nov 2020 00:20:36 +0000 Received: from rere.qmqm.pl ([91.227.64.183]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kdMpM-0001T9-KR for linux-arm-kernel@lists.infradead.org; Fri, 13 Nov 2020 00:20:33 +0000 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?b?TWljaGHFgiBNaXJvc8WCYXc=?= Subject: [PATCH RESEND 4/4] regulator: workaround self-referent regulators MIME-Version: 1.0 To: Liam Girdwood , Mark Brown X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201112_192032_877682_D4726A67 X-CRM114-Status: GOOD ( 11.68 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ahmad Fatoum , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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); } /*