Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2401017lqp; Sun, 24 Mar 2024 17:57:13 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUJ9habSHeFbgQEpCLmshRc4JYI36HOk9Aawpcv1bCBuQXLBhmP7VUvcOWmpvvT3UeKW/Fsd5I3Q8L/5rsjpe/mQUz1wRtpIguS1YHSaQ== X-Google-Smtp-Source: AGHT+IHbdKNW4HSP7cBNKPbA1DOlZH4JInXrd5BwVUp47FNo5zontBdHwxDrbQe7PKCKTH6Um+01 X-Received: by 2002:a05:622a:2998:b0:431:3da5:6b70 with SMTP id hd24-20020a05622a299800b004313da56b70mr6543177qtb.51.1711328232833; Sun, 24 Mar 2024 17:57:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711328232; cv=pass; d=google.com; s=arc-20160816; b=XPJFXk2pb13wSZrFmAnoBSyFJ7a8jBL+4UFpZ6sZM4eXlc84TEIECTw/6M2m/4VDys t6GoWNW9lKhP1lqOPGI8SLtnVFiub67ssFhV2He+57e6ql1IOCjeF4DK/1ZLyfL394y7 n5HzgrB635iuWhjnQotc/8iKMv0nS9s3P7RyyU+Gi0WpvFdhJ1owEH9wTQ1XbE+cQIbk ZpvJD5V/UBqFNiDIyJkMwiNO+K9F8yjjddVnjglWdS+7oJuqowHnnbJKjx4DwQj7aKwC f0ApRe9YAvtLifoNuFud2kLptaI6hfynRcq4I16wu2b6dJU0bxKNNjoIjEJMNbWmCar7 p9Rw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=HQc7VGPAf2jxhNbNLe5LypJvPkPBao5gQ2ZTx1NB7sE=; fh=uzWggxH4sw4jEuPx1jU0DHvCUyLVQRFHTGNG2uYYXVg=; b=xiLOoCdaQa0Gu/Ba6kxroKGWpShIo7xaQO7OkNuYSiR6JrOO74vXsRdoFZ0PcRP5O6 4AERmqAgiVVj/S40b8yV6IBBq5f6HmdjsIu6C1a4Bi587YJAK1z+cL55Y1AE3a7BETEe /IXHHlem9VEYfdwDkDREYQdP8CS1UByDSnfF3TxlHLPFHhEnBmKihBQulCG0f/Ncu91n Vzll0/VNIgKttgOC/juE1lxaxPv6n9yvchlX4IIwEfdgZA0qQMWK136Tj+G7TvQtHLyC 6bsF/pq65Jg67CQkwJ3hcAKxXT/Rp+jUELBe5SHEOgEsX8YRsi3l14eS/D8gMOIUd42G /c8Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="sUhz9/i7"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113527-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113527-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id ge5-20020a05622a5c8500b004312359aa67si4386039qtb.409.2024.03.24.17.57.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 17:57:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-113527-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="sUhz9/i7"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113527-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113527-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 7BD671C240B9 for ; Mon, 25 Mar 2024 00:57:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 45F601BEDCE; Sun, 24 Mar 2024 22:45:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="sUhz9/i7" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5CB4C1BEDB3; Sun, 24 Mar 2024 22:45:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320329; cv=none; b=r83WCzj8I0S6zmeHa1dFsNR7L7ek3EwHh8MhdZ0q87IrGXGMh0hPeLe5ytybbR3iVK33r5udclzOVNT/eglD7FiCiBFP+keAHKW5rtwN9Pr58ZNoyEIXtY0wESJSV1ivPlpmufMAhnGmvKXducbSpDiyFvEoLJov6FVjq8ASQXE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320329; c=relaxed/simple; bh=6DQJougX0ptKj6bY2XsiqJrGTso8eSy+jqQnXQDK+8M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=AIVqXpg14Oc0MjJb6KMOYAtIC6bjkyj3ZGI6ESPU5N13E0JxAcKZuXHhScZ2YrArfdqJahm8Laevj8o4oycP66hElq0P7YaCMkJVjkLxG54769elNo69YksoBANZAkzq6cWmNwrr9hygzd/ZZSjWHJmdNAvMsfz9XbB7gjhRK88= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=sUhz9/i7; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3AB5EC433F1; Sun, 24 Mar 2024 22:45:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711320328; bh=6DQJougX0ptKj6bY2XsiqJrGTso8eSy+jqQnXQDK+8M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sUhz9/i7PRpN1OB2789f1rlQr9ICwxkY1IplZrP/yNVlxA6QSFm205lQHvqq0Jcjt MFhEmM3m1JANx21+WEFlER6IT5KXOpRy7WObvS3Im9lQdceiQGIFatU+iOEh+IDxNn OZFMm0p/CQaSRn+N/fW/JzM2Tz432VRhdj/1b35iWCeoMIl17z1WRBBlhBhyV9+LVN W1ioi6lNrRcsKnhUZ0CICNwQ1goI6e51mp0h5Lm0+R6aEJ4+SAweQAjzJ91C9PTpZo XOlyVtifTBLo+9tPRhsybjWcZJXVuBYBmcXYRZXYtwxl5PyIpwnEc2ufCM2QkqfDgI V5RFiYAdgeJSg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , Geert Uytterhoeven , Mark Brown , Sasha Levin Subject: [PATCH 6.8 636/715] ASoC: tlv320adc3xxx: Don't strip remove function when driver is builtin Date: Sun, 24 Mar 2024 18:33:35 -0400 Message-ID: <20240324223455.1342824-637-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324223455.1342824-1-sashal@kernel.org> References: <20240324223455.1342824-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Uwe Kleine-König [ Upstream commit f31e0d0c2cad23e0cc48731634f85bb2d8707790 ] Using __exit for the remove function results in the remove callback being discarded with SND_SOC_TLV320ADC3XXX=y. When such a device gets unbound (e.g. using sysfs or hotplug), the driver is just removed without the cleanup being performed. This results in resource leaks. Fix it by compiling in the remove callback unconditionally. This also fixes a W=1 modpost warning: WARNING: modpost: sound/soc/codecs/snd-soc-tlv320adc3xxx: section mismatch in reference: adc3xxx_i2c_driver+0x10 (section: .data) -> adc3xxx_i2c_remove (section: .exit.text) (which only happens with SND_SOC_TLV320ADC3XXX=m). Fixes: e9a3b57efd28 ("ASoC: codec: tlv320adc3xxx: New codec driver") Signed-off-by: Uwe Kleine-König Reviewed-by: Geert Uytterhoeven Link: https://msgid.link/r/20240310143852.397212-2-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/tlv320adc3xxx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/tlv320adc3xxx.c b/sound/soc/codecs/tlv320adc3xxx.c index 420bbf588efea..e100cc9f5c192 100644 --- a/sound/soc/codecs/tlv320adc3xxx.c +++ b/sound/soc/codecs/tlv320adc3xxx.c @@ -1429,7 +1429,7 @@ static int adc3xxx_i2c_probe(struct i2c_client *i2c) return ret; } -static void __exit adc3xxx_i2c_remove(struct i2c_client *client) +static void adc3xxx_i2c_remove(struct i2c_client *client) { struct adc3xxx *adc3xxx = i2c_get_clientdata(client); @@ -1452,7 +1452,7 @@ static struct i2c_driver adc3xxx_i2c_driver = { .of_match_table = tlv320adc3xxx_of_match, }, .probe = adc3xxx_i2c_probe, - .remove = __exit_p(adc3xxx_i2c_remove), + .remove = adc3xxx_i2c_remove, .id_table = adc3xxx_i2c_id, }; -- 2.43.0