Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp66485pxb; Mon, 13 Sep 2021 13:06:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyVVlXaCzFlTS07ViXuVGudtl2G9/5RezJ0iMsOODEE1umnhcxvUTny8UZMy64dLg5wft5 X-Received: by 2002:a50:ab18:: with SMTP id s24mr8108769edc.88.1631563590221; Mon, 13 Sep 2021 13:06:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631563590; cv=none; d=google.com; s=arc-20160816; b=xGanlt3Ns3wEtJDzlF7/6xTmvKR3uiP4a58khqOfSnqLCbXzks8awZPxdy/+IKexrH r4K1zmC30Ay8sdROlllvpJ6UuuGsLogYcfc2Vcw4dizimSGecu7RQeTCAffK26gpNOw7 j0gNHt+aNWA/8yzXDpQAVkXfbUsQGgXUod+EBJD2Pl1NVJmB+696qtjFCwSP4yyh1tXc mLBOgwVnyr10AbBEgQ36zQLQzvoYp9z6ZaBjCWpJnenrIY6GPPpE5554KlKalhEQsAQs pLaX6TW3wGOvjY1O+hc/Mccg3HVvOSMX+Vjdv5+MV0K6uoMPOo4pJ5ar6pM5xqKiQIhl 3f0Q== 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=zHuACiqfHJGRkn3LvkZU/ICLTuVnR2u0QI+vacu+BPw=; b=XlRChewvWZ6wT+cgxYuI2XvtMsLe2V1973ppFZOoXZDGZJPeh+MboEi0Wn85w5GDfJ csqA5VKHBu2ZCqXJ0tHF6nygBVyM7qv0nOdd4qpEP9ODIL7SNlG3w9pHEz/swD8yckR1 vr3hft03mqrpTUYivsQgr6OSYaowDsVAqm1CihVYz48c9ssjhFeeO3mG2L7vUPgirox3 tMBYj2qdpuM09jSr5wyfL/vy5FfQKhjGBIkbWXouSxeXL9qCjkMYSHCBOcBH/WmD8ovm M29CtrhSqEtdMU6eGKgRKFdFggZA+YrHoU5nuzgj9dlbQp/m0YOrpyKXeyInJU47l8YL n9vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ErbGmJX5; 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 og49si7867302ejc.305.2021.09.13.13.05.51; Mon, 13 Sep 2021 13:06:30 -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=ErbGmJX5; 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 S243865AbhIMNo7 (ORCPT + 99 others); Mon, 13 Sep 2021 09:44:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:40602 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243776AbhIMNkC (ORCPT ); Mon, 13 Sep 2021 09:40:02 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 756BF614C8; Mon, 13 Sep 2021 13:29:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631539746; bh=deuDyUC7ukFY9Dx4K5QWJ5oIG8ywpuqET6D2sF01QNM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ErbGmJX5aqbQh0p+MCIpJpTH/a0LsBbBT4Evg1LGNpdD3YpeIIX9VZ1KTG7/Mrh0M M93Cz9srA1t/AFPZJhyPLN0fFzx66LeD1cpbkVNmQgr05u8BpZri6Z/wEaKKthU4zK UdxAMk82lku+7zYpNJnhW5xZ9Aqozqm0E22HSf+0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jairaj Arava , Sathyanarayana Nujella , Pierre-Louis Bossart , Shuming Fan , Ranjani Sridharan , Stephen Boyd , Mark Brown , Sasha Levin Subject: [PATCH 5.10 145/236] ASoC: rt5682: Implement remove callback Date: Mon, 13 Sep 2021 15:14:10 +0200 Message-Id: <20210913131105.300916075@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131100.316353015@linuxfoundation.org> References: <20210913131100.316353015@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: Stephen Boyd [ Upstream commit 87b42abae99d3d851aec64cd4d0f7def8113950e ] Let's implement a remove callback for this driver that's similar to the shutdown hook, but also disables the regulators before they're put by devm code. Cc: Jairaj Arava Cc: Sathyanarayana Nujella Cc: Pierre-Louis Bossart Cc: Shuming Fan Cc: Ranjani Sridharan Signed-off-by: Stephen Boyd Link: https://lore.kernel.org/r/20210508075151.1626903-2-swboyd@chromium.org Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/rt5682-i2c.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sound/soc/codecs/rt5682-i2c.c b/sound/soc/codecs/rt5682-i2c.c index 547445d1e3c6..e2b4b10e679a 100644 --- a/sound/soc/codecs/rt5682-i2c.c +++ b/sound/soc/codecs/rt5682-i2c.c @@ -275,6 +275,16 @@ static void rt5682_i2c_shutdown(struct i2c_client *client) rt5682_reset(rt5682); } +static int rt5682_i2c_remove(struct i2c_client *client) +{ + struct rt5682_priv *rt5682 = i2c_get_clientdata(client); + + rt5682_i2c_shutdown(client); + regulator_bulk_disable(ARRAY_SIZE(rt5682->supplies), rt5682->supplies); + + return 0; +} + static const struct of_device_id rt5682_of_match[] = { {.compatible = "realtek,rt5682i"}, {}, @@ -301,6 +311,7 @@ static struct i2c_driver rt5682_i2c_driver = { .probe_type = PROBE_PREFER_ASYNCHRONOUS, }, .probe = rt5682_i2c_probe, + .remove = rt5682_i2c_remove, .shutdown = rt5682_i2c_shutdown, .id_table = rt5682_i2c_id, }; -- 2.30.2