Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp766497pxb; Thu, 12 Nov 2020 16:20:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJwZ1aSl1eJ+ZRcJ+3+hEDDdft83nJcSdeYxrJzSXx8d2Q8FUBxvCglYHo/S1oppEVSe3uV3 X-Received: by 2002:a50:fe18:: with SMTP id f24mr2722939edt.162.1605226824975; Thu, 12 Nov 2020 16:20:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605226824; cv=none; d=google.com; s=arc-20160816; b=Rk/4Gav6Q21mZ+7B3Nm12sVPmjA/NBwdZYaOo20L8uw5Zdnvv9oS3OyJpiUAAD0+46 x7XYeWiledSv+tKf5LK3e7YTZQvPO/jcDEFXAH9IfedDQaaL54FTKIhOk+NdJWxhGEyx woA8IkxTcDwzKwQ1CKINU7zLzEj2S95hHPHwBkNtKgP0wL1nGWwXHfMclGSSbJ7e4PE7 1u0cVFWCS/8wumbep/z84U8y12KTWRopookklw7vXqSUAZ5Xv8LzYTu/b02pJ/eQvqHG 6Q9VOAAYKi1wSG7o8lTrKTn2O/fiEM1ktU0i0c3zMyUUEvYtoEYoZE9TzEHGV22o57Nv J7kQ== 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=TOaE9VVtpHU7eoncw4FTklzJEvaEOV2B1qbAyabvT/uKs/a5fDAgAaVaBAJi3sBPBw pJQME9rlhUIp/7oRuWNUvudkGJoZPxAWzOj2O8I3hfiIl3lDGzhfCdWR7eyCGlZY9ASv UpraH/zqtWmbqx2HTa9FyzdNUy4DpTelpDKOtubPIUAK2nVJMwtpqwSmndpyrh1UWfh2 9T6/RGpGA/XNs69q2saBc8Alv+IR0eyCv7jRuyntKclGXW4gNDGO/BhIriM9hJ1MkJKE /DDhPfyuhksLdJe40LzcqOV8KD9d6RPwL1XZ9GY5TtnWAS+8H5rxZM/rBxryLYhw48xH fvpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rere.qmqm.pl header.s=1 header.b=IzlFN8fm; 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 g16si4653892ejw.559.2020.11.12.16.20.02; Thu, 12 Nov 2020 16:20:24 -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=IzlFN8fm; 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 S1726297AbgKMARV (ORCPT + 99 others); Thu, 12 Nov 2020 19:17:21 -0500 Received: from rere.qmqm.pl ([91.227.64.183]:16396 "EHLO rere.qmqm.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725929AbgKMAQw (ORCPT ); Thu, 12 Nov 2020 19:16:52 -0500 Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 4CXJtW0dPfzkL; Fri, 13 Nov 2020 01:16:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1605226611; bh=GU5qJ1nTeXHIDvDBgFSSbRsT2IkPhz3ghAkGAasa5UQ=; h=Date:In-Reply-To:References:From:Subject:To:Cc:From; b=IzlFN8fmmsWs4LZtqIXKKD9EGAyCm/uCe6GPTww7rSjai4h114WlMOv1t5xoUToGl Cz1NcitRrhxfb+gjm2fdVpOe9GpurNzX2StKz8mCNfCVVgMXCBNVaOSX1Mz3riB2gr yQqjqN29ngXChyKguYtsya3xJP/WxDcj12zpw/sGXnH3XgybXFp1gy+8L0polXCD7Q ICWHUBlmcRXWTl4N3RkvS0M0sBmv//107KXxafWyDUKWlN1ARrGkAdETNtMnKSFgYm jOp/D67yGHfxfOQeudnDpCpcNkwI+o5wu7T+ojuepFHMClMtdJ8qKhbJiUVkvhwL8W /mVnI0LOeUbjw== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.102.4 at mail Date: Fri, 13 Nov 2020 01:16:50 +0100 Message-Id: <6e250bd5d444db3afd010b1ce66db9843a9114d1.1605225991.git.mirq-linux@rere.qmqm.pl> In-Reply-To: References: From: =?UTF-8?q?Micha=C5=82=20Miros=C5=82aw?= Subject: [PATCH 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-arm-kernel@vger.kernel.org, linux-kernel@vger.kernel.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