From mboxrd@z Thu Jan 1 00:00:00 1970 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 314C47E for ; Wed, 2 Nov 2022 03:02:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0E092C433D6; Wed, 2 Nov 2022 03:02:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1667358137; bh=YzukgQzP0UDxJa2aug/vZNRPeOzJJeN7yFJQljMfWKE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dPHxVe7jwI/Ql/MfhIfc1UTbqPC/VgDRvkUtx9XFH9xqRwNdRhnBgOfOhok/d4Mht DTdoo4a3OEhbbKNfoO3eauYZCAtvP73zbUYswJ8v9EsJC8MSEdJYaYXVjrMBzvQKCF dD4QhILfAINecHk6MqFuwikOtDwFoCwFpRn3xucU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Shreeya Patel , Stable@vger.kernel.org, Jonathan Cameron Subject: [PATCH 5.15 021/132] iio: light: tsl2583: Fix module unloading Date: Wed, 2 Nov 2022 03:32:07 +0100 Message-Id: <20221102022100.181998612@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221102022059.593236470@linuxfoundation.org> References: <20221102022059.593236470@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Shreeya Patel commit 0dec4d2f2636b9e54d9d29f17afc7687c5407f78 upstream. tsl2583 probe() uses devm_iio_device_register() and calling iio_device_unregister() causes the unregister to occur twice. s Switch to iio_device_register() instead of devm_iio_device_register() in probe to avoid the device managed cleanup. Fixes: 371894f5d1a0 ("iio: tsl2583: add runtime power management support") Signed-off-by: Shreeya Patel Link: https://lore.kernel.org/r/20220826122352.288438-1-shreeya.patel@collabora.com Cc: Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- drivers/iio/light/tsl2583.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/iio/light/tsl2583.c +++ b/drivers/iio/light/tsl2583.c @@ -858,7 +858,7 @@ static int tsl2583_probe(struct i2c_clie TSL2583_POWER_OFF_DELAY_MS); pm_runtime_use_autosuspend(&clientp->dev); - ret = devm_iio_device_register(indio_dev->dev.parent, indio_dev); + ret = iio_device_register(indio_dev); if (ret) { dev_err(&clientp->dev, "%s: iio registration failed\n", __func__);