Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp830549pxu; Mon, 23 Nov 2020 05:24:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJyRPRZhsD4N4c5YO87KyX7fLWSBKSbV9HnPqW9MG9UrM5egHsgj1BcKze3WY+R7OB7eyoE0 X-Received: by 2002:aa7:d514:: with SMTP id y20mr45449356edq.384.1606137855338; Mon, 23 Nov 2020 05:24:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606137855; cv=none; d=google.com; s=arc-20160816; b=Bj3igwd5nct81uBrcSdaKlUBGWK21hOOnUtGltfWObEodXW5/I3L+VGB5296oAeosy bKd6Ho2F4TCaItipIoJoyKF4I3ReRROiOq18GAqHVkgm/m9DrPV00o2C0S3VN0KexLxX 17v8ze7kcg8BbejWr7BYlgMBlD/3VS3bJSN1QHAUBcf7mIlN3fJBcA+lXFSCYW748lNm t+/glVgjFwYrxNbATgzf3icpO193QcIo8CcYV54CZiqUZyVeyOa3zHscAKal91v2cxSx 5t4MYH40fSyJ7EX7XOm5hlcrTqZ/C/rH0ejmlSOY96UlxnoiHs+pnE5iMF4JZdTjtReo B/Nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=h1DBZCVcTw9wh9Ngz9Z0oreaW8uJTpt6GgVk8n5em+4=; b=MGEfVgNbyta03vEqkRCxbEHNG9txFUgzkQCW3JzxzJMuHdamLGOt4E+OrUtY0zYiQR 3uqjFoMP2Iu1jzXygm2EAtxTAl4H+nhHWbUYa/62Lf07HTYBWZhWLyPvEW/T0OM3vP6/ OU8zHAz5Vrv713Vlws+Ac2TxOTbay16pR8W0tw9zsfk4+j9IoSmlOoqDvtkwm+t3lTdA hagz3fzwz01X8WXTrelL5BCHOB/Y52p/kqcS/I8IR9KyjyUP8QMrGSJBpeEprhO+/wHS I/dQMcO8CgpxqObGZiIVul8NBvGgzM+7ulPowTSCn0XN2TTPSUP9CV4w4ofDGE01i8Zd rHmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bwz3N9c4; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 91si8627783edy.541.2020.11.23.05.23.40; Mon, 23 Nov 2020 05:24:15 -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=@linuxfoundation.org header.s=korg header.b=bwz3N9c4; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387562AbgKWNSe (ORCPT + 99 others); Mon, 23 Nov 2020 08:18:34 -0500 Received: from mail.kernel.org ([198.145.29.99]:52756 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732387AbgKWMj6 (ORCPT ); Mon, 23 Nov 2020 07:39:58 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C1FB520732; Mon, 23 Nov 2020 12:39:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606135198; bh=gX1p4Y5MitexvVH9K4BRrzAl0O7oxDDxFk29VLH9UN0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bwz3N9c4GTG/2IX6l9jsBq01M09yIi1bBQ6ll43hC8V/J7X/RC9pXJ5VxB5tGBsPY Rn7FYiOtnOiksNIzpE0ROpf+n6Taoh/vB6m+x4ROvNq/ARRZqUOHfF4sWPlp+JbqfD omDlg3Dom3IOXmKMA0a8IZEc7uwDa+QZBRKXbYE4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ahmad Fatoum , =?UTF-8?q?Micha=C5=82=20Miros=C5=82aw?= , Mark Brown Subject: [PATCH 5.4 140/158] regulator: workaround self-referent regulators Date: Mon, 23 Nov 2020 13:22:48 +0100 Message-Id: <20201123121826.690597325@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201123121819.943135899@linuxfoundation.org> References: <20201123121819.943135899@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Michał Mirosław commit f5c042b23f7429e5c2ac987b01a31c69059a978b upstream. 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 Tested-by: Ahmad Fatoum # stpmic1 Link: https://lore.kernel.org/r/d703acde2a93100c3c7a81059d716c50ad1b1f52.1605226675.git.mirq-linux@rere.qmqm.pl Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- drivers/regulator/core.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -1803,7 +1803,10 @@ static int regulator_resolve_supply(stru 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); } /*