Message ID | 1670981831-12583-1-git-send-email-u0084500@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp476553wrn; Tue, 13 Dec 2022 17:49:55 -0800 (PST) X-Google-Smtp-Source: AA0mqf7gYXEBNL7Sfo7hkkRJgDTz9xbbHxw2xn3puWQHy8UYYKPVtfK9I6YIB5X9BRENqYe0/F0V X-Received: by 2002:a05:6402:f23:b0:46b:159e:9511 with SMTP id i35-20020a0564020f2300b0046b159e9511mr22564534eda.7.1670982595353; Tue, 13 Dec 2022 17:49:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670982595; cv=none; d=google.com; s=arc-20160816; b=ztCKbiYeXx0YE6y0FGCCjvR1waXJjAq+f4jwmGBXW1mz/eoB17iCq01M7vhZopQ/Wr 9ZW5XMNu6MsmqUgEkWTFe7eytjFH/N3qsATkFCpiZs3fv+Lxw7yFIgBBT5nkyvE8am3m EQKv9Do/wIJZXqe318rDzc9Fh0htHRt1HSMX2PEedr1hj2nqtGSnQIFfc/JNXsdD/5ku p/1Zwwbhfmj/L9t0hNJjVDvOpZnFj7Hf7FLnwuF2hVi1Znl72yXd/0kSnFUKI6Hz8o4v xd5nAqEy/TWVx5JCEls/qiDriPKlyqmgGMF4LbtevFrZejKzCcsm4Q6cUbaAVlK72dPx RuRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=1+X+IlnDqYuFPQTAvWtr2QazQA6Soh/VIDkNFnd7BDc=; b=ATTaucSHxkGK7oxReA1pmVaQIkyHrXdZD++07iqSwLQvvlXBcBltt1VBt2uIxfdfhX yp9t7xg6SrH4V7jS0cJ+LLLRpLiGhhOXVE2TaQoVDSbOCmzvNTnh19GLDUjrdlSe5qNy citVDdB6wQ94UFQ53SE/gSGTu6WVpQJc98AbPRG5HPm/C555SAf16tPBtxqtpxvmg+89 /m7KhTD3CnV6FUPSimOi0xhNqYlUAs9jW6scP6ioKJCwvPhPEA0e6OEmU7sZz57Zo4FB yJRMe2gYQzNsw22MG8u7vxzpOmSh77nGEaoXe/9KED4AoWssBHyQECI5myZv4/o+h1xt LUlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=eFgVwWxR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f6-20020a056402354600b004634dd8b6edsi13144671edd.296.2022.12.13.17.49.31; Tue, 13 Dec 2022 17:49:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=eFgVwWxR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236860AbiLNBi2 (ORCPT <rfc822;jeantsuru.cumc.mandola@gmail.com> + 99 others); Tue, 13 Dec 2022 20:38:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229870AbiLNBi0 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 13 Dec 2022 20:38:26 -0500 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A29A1B1C4 for <linux-kernel@vger.kernel.org>; Tue, 13 Dec 2022 17:38:25 -0800 (PST) Received: by mail-pl1-x632.google.com with SMTP id p24so1833763plw.1 for <linux-kernel@vger.kernel.org>; Tue, 13 Dec 2022 17:38:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=1+X+IlnDqYuFPQTAvWtr2QazQA6Soh/VIDkNFnd7BDc=; b=eFgVwWxRnFPSv+O1XkeQ4RrcC1gUB9yJwdiEj/nYAmAbztlHeE3RDrgYcFF59+uSEm eT9Uw3XGt6Xz/eanAEkbYsny/stwxcG/O+FV0HUri7P/cscnxNgWAtLZZj2DXTy374a+ UwM8xWJbTDDWGVEcrSOtHAPcNIJXDN9nplMshnZ1cbuEHUilJNi4tDIdy6YvJMqxzLol md6FVrgmv9JhtfiGf/VPtVjTCfg6bnLg6+4W1sj5CJzjPef3JkDBl9c9gcQCeJ3yK+Sm qm6RWp+AqUgFKGoSin4rAuP3o2UzWrwsiL7VTjP/NGYLu1qRMxExH1kTgoUQ8k4o6jCB u8VQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1+X+IlnDqYuFPQTAvWtr2QazQA6Soh/VIDkNFnd7BDc=; b=LWxJQoVOYtSjdCwEg2QjmCDsa0kk9To6EnoNTRQVNfhXN6DqDNLDlW59/Y3neW5sHx NgMAYh08c+L0lCD8JGLfj+XqnlZ1+JHmS0LzsKhU++tx4q9tA1qyf9+HC2sgvQMu0ZuO FMUFohOWGnSrM4Zrd6zJqdi37H+dkkE+zhtUa6jsaM3D2zShTRu+fzJs1pP26bgmrknL lxwieSJXMcEiRGp1QbOA7LbhBVJBzy5+MBaGMw1Je3LbO6/01BI12lMZDlXnhxQA1Xwi EvFHha17fZCwzvsi99SmsZE15T0pkAHSZt9JQCFe4B/aTBpKi5XXmb13A6YEqV1lWIfB hqZA== X-Gm-Message-State: ANoB5pmSP6jhXWTNd/XrSIBsyeVxl602DWgUOoymIzxFDAH3Hfzu/Aqp 23ml/1pfYA4EQ8U5FlXChyViUgb54rI= X-Received: by 2002:a17:902:6a8c:b0:185:441e:4cef with SMTP id n12-20020a1709026a8c00b00185441e4cefmr21583269plk.31.1670981904609; Tue, 13 Dec 2022 17:38:24 -0800 (PST) Received: from localhost.localdomain ([2402:7500:487:c29a:45bc:c5bc:b838:9a0b]) by smtp.gmail.com with ESMTPSA id u4-20020a17090341c400b00187033cac81sm518486ple.145.2022.12.13.17.38.21 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Dec 2022 17:38:24 -0800 (PST) From: cy_huang <u0084500@gmail.com> To: broonie@kernel.org, lgirdwood@gmail.com Cc: m.szyprowski@samsung.com, cy_huang@richtek.com, chiaen_wu@richtek.com, gene_chen@richtek.com, linux-kernel@vger.kernel.org Subject: [PATCH] regulator: core: Fix resolve supply lookup issue Date: Wed, 14 Dec 2022 09:37:11 +0800 Message-Id: <1670981831-12583-1-git-send-email-u0084500@gmail.com> X-Mailer: git-send-email 2.7.4 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752152245963594926?= X-GMAIL-MSGID: =?utf-8?q?1752152245963594926?= |
Series |
regulator: core: Fix resolve supply lookup issue
|
|
Commit Message
ChiYuan Huang
Dec. 14, 2022, 1:37 a.m. UTC
From: ChiYuan Huang <cy_huang@richtek.com> From Marek's log, the previous change modify the parent of rdev. https://lore.kernel.org/all/58b92e75-f373-dae7-7031-8abd465bb874@samsung.com/ In 'regulator_resolve_supply', it uses the parent DT node of rdev as the DT-lookup starting node. But the parent DT node may not exist. This will cause the NULL supply issue. This patch modify the parent of rdev back to the device that provides from 'regulator_config' in 'regulator_register'. Fixes: 8f3cbcd6b440 ("regulator: core: Use different devices for resource allocation and DT lookup") Reported-by: Marek Szyprowski <m.szyprowski@samsung.com> Tested-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: ChiYuan Huang <cy_huang@richtek.com> --- drivers/regulator/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Wed, 14 Dec 2022 09:37:11 +0800, cy_huang wrote: > From Marek's log, the previous change modify the parent of rdev. > https://lore.kernel.org/all/58b92e75-f373-dae7-7031-8abd465bb874@samsung.com/ > > In 'regulator_resolve_supply', it uses the parent DT node of rdev as the > DT-lookup starting node. But the parent DT node may not exist. This will > cause the NULL supply issue. > > [...] Applied to https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next Thanks! [1/1] regulator: core: Fix resolve supply lookup issue commit: 0debed5b117d11e33cba52870c4dcb64f5911891 All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index ace4ecc..729c453 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -5540,7 +5540,7 @@ regulator_register(struct device *dev, /* register with sysfs */ rdev->dev.class = ®ulator_class; - rdev->dev.parent = dev; + rdev->dev.parent = config->dev; dev_set_name(&rdev->dev, "regulator.%lu", (unsigned long) atomic_inc_return(®ulator_no)); dev_set_drvdata(&rdev->dev, rdev);