Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp497566pxt; Fri, 6 Aug 2021 07:06:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwZkaVFfsnEZvSf9sVh/sutltQHwpUwVKNFUEvpxj21PbFFsRil/JZj4gnsgTxitfNU8b5I X-Received: by 2002:a02:9696:: with SMTP id w22mr950137jai.119.1628258771778; Fri, 06 Aug 2021 07:06:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628258771; cv=none; d=google.com; s=arc-20160816; b=S8fYrU1JhCArm7LRzmakSUm0ZXK1MmvsPdn3TFRjNdcAtlxve/DLUfyoTCz7iYQjZO aXTTRzuXrH2PxDv4uXIcq855GA0TJDqbXq8q6DJXPsJDoeUjUHgUM2zn1+NBK4IcKpxX JZxi8syRAXZ0iCixsAsLWbluJqhqbbw9Un5VNckMH6fMelkiNKhtq7/F/+oVqniW8IQy LO5tbt16TAyc9cuv3IHD8Oz5Ohz7uOyR1gvn6JStyGkRjY8YUtW6d3/qeZJAjeIroZUd oH5LTEKtAeq6QV8gbW70rSyq8CTz4TdaWPb0OXCD9jCaujq0RCg1gBctnRXnP0kHtPKR OiLw== 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=BAKMNJ7MZ7AfxxozS0WpanMJMnBT7rvLncjTgv+9l6E=; b=pkzX9bWLuegBppaDG0pcoFOKQDMHotKGlQlEBe1AQjn/swRQJwR4iuvJjqtvjxdFKE HTEkNaIjEiXN9dbGNxx23r7nJVfO/3BMP04lvyyTeikwgy9mkdAp+tEAcTELXvYxIcAc sLnFi4CKZltDtzLvmPk8TAhNNm/P/S7pvKpPSoHbz5F0Xq3+gZyKOc0x08V6KF8P6Xqp 3DCSY/JR9X8snnP3b44YnJoFVLQXRwBd0rECnG2iE+s4OWXqR3BYdpeA36hnMemjdAjN f8PNYKt4peJdDIcXzqraIQP91+JDtOW23khKirWOi8zuOYjBuRSBvLZDXRNHUZhw+pCR ya8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="jx0WI//T"; 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 t4si7438696iln.130.2021.08.06.07.05.58; Fri, 06 Aug 2021 07:06:11 -0700 (PDT) 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="jx0WI//T"; 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 S244326AbhHFIX5 (ORCPT + 99 others); Fri, 6 Aug 2021 04:23:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:52206 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244210AbhHFIU0 (ORCPT ); Fri, 6 Aug 2021 04:20:26 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8C54C611C6; Fri, 6 Aug 2021 08:20:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1628238011; bh=mBenjGICbGqU4sL6JcNUEpVkieVEjgsM+z7KIGEOHJE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jx0WI//TE2wkksvZuZsGSPPl5PFp8lFvpieA6AVfVotBVrJlxE/akoOlcdgnfKpZk qSAYmZP4xIDH6E/aEAKTj9WuEtU26vcSySWqk37dAFw/6SRcXJJETeAbQXkIw0QGi+ uGnZ1dFvzCQd1+exSIHrBjjDxOoHxQ4ZGLalYBOQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Axel Lin , Mark Brown , Sasha Levin Subject: [PATCH 5.13 18/35] regulator: mtk-dvfsrc: Fix wrong dev pointer for devm_regulator_register Date: Fri, 6 Aug 2021 10:17:01 +0200 Message-Id: <20210806081114.321583628@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210806081113.718626745@linuxfoundation.org> References: <20210806081113.718626745@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: Axel Lin [ Upstream commit ea986908ccfcc53204a03bb0841227e1b26578c4 ] If use dev->parent, the regulator_unregister will not be called when this driver is unloaded. Fix it by using dev instead. Signed-off-by: Axel Lin Link: https://lore.kernel.org/r/20210702142140.2678130-1-axel.lin@ingics.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/regulator/mtk-dvfsrc-regulator.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/regulator/mtk-dvfsrc-regulator.c b/drivers/regulator/mtk-dvfsrc-regulator.c index d3d876198d6e..234af3a66c77 100644 --- a/drivers/regulator/mtk-dvfsrc-regulator.c +++ b/drivers/regulator/mtk-dvfsrc-regulator.c @@ -179,8 +179,7 @@ static int dvfsrc_vcore_regulator_probe(struct platform_device *pdev) for (i = 0; i < regulator_init_data->size; i++) { config.dev = dev->parent; config.driver_data = (mt_regulators + i); - rdev = devm_regulator_register(dev->parent, - &(mt_regulators + i)->desc, + rdev = devm_regulator_register(dev, &(mt_regulators + i)->desc, &config); if (IS_ERR(rdev)) { dev_err(dev, "failed to register %s\n", -- 2.30.2