Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp92048rdg; Tue, 10 Oct 2023 05:20:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFUz/afRqqQGLgNwRGKru2EvA2NqccZoOSlSJhESMgQvKgV/HKNY0fp0ak96wI3EBEwogG1 X-Received: by 2002:a05:6a00:2d1e:b0:690:463a:fa9d with SMTP id fa30-20020a056a002d1e00b00690463afa9dmr18848156pfb.22.1696940399874; Tue, 10 Oct 2023 05:19:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696940399; cv=none; d=google.com; s=arc-20160816; b=B3H6U/fNkYGfy8PrzDMyotZJ0PLGtVOejTBMK5R7S0hlDxJ1UWtaYIDP1iZvHnC+pF 12hucn6lcz4fVq0E8lCsW59lR0PwNHg9iFr8IWvCtlTAfwDACZHinPVFZNuOj9KwVzIr 7uBKKAXZyLIABYFMkaZ0Lm+3X65eqC78Db5fwYAyTMzE+EyEOOFUhUveUyWiXv42dJkj AjmE7mCT2ES8psS2bPH+Q5yzH7VMV0BSe3od7cnYV35a4bMUzCqrIk36nEW+0UhxgItp y66I7PUIMEucfN+qJAS66Nn6/kaQZ1LCKuK+ePyfrloYhxYGQdUAyuxOVkfMAc9Hq93a OyLg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=HgMFBZpZg4YAWv9hA928Akj5lifcYMHNCkpezYqKcvk=; fh=8xhZaWrcsa9KVDITBp6xbCTfVkf+prxeestuu29D3YI=; b=mXMWeeJsb+QCzQVCpqguPiLDu7+i8HL4vlWTdiWXbWl86qI6biNDm1lxs/C3zdS+PA vg5F+EvzBIYsQDj3R+fnGbLJnJG7nX9UmJffim6ob0B4tgsYZ/yjM5e2bkxrIjYTyWje T9awD1o9x6ty4LryqKax6gXrScBGjZKfLznJZsTDAn0eHulewsVdqFIIV4x4ZXpfw6h8 F7gtXFyFsyjp7IlRlyv4ostV7kCcKiJbdRVj+LF+yGMCwAFKQYivjS8Ek93HGrtBDrOZ RgcgjVh3eRskqn9htU2mcGpZpK1jRs2TnrYkXYuf1VZVQ/1XM7EHAppK+eEJxmGgN8+V QI6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=ZtH63OGK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id u185-20020a6385c2000000b005775e17f560si11986361pgd.82.2023.10.10.05.19.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 05:19:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=ZtH63OGK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 75421801BF75; Tue, 10 Oct 2023 05:19:57 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231714AbjJJMTt (ORCPT + 99 others); Tue, 10 Oct 2023 08:19:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231681AbjJJMTq (ORCPT ); Tue, 10 Oct 2023 08:19:46 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D90EBAF; Tue, 10 Oct 2023 05:19:45 -0700 (PDT) Received: from IcarusMOD.eternityproject.eu (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id 06E3366072E7; Tue, 10 Oct 2023 13:19:43 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1696940384; bh=YFh6qAUpCGl4Tk3sMb7K34FQqqhAH7T1fXGALRzD3k0=; h=From:To:Cc:Subject:Date:From; b=ZtH63OGKpty6eflEjW+Hc+DyiqtTtvDe+vaHEwIHH9UvKBXF2u9qRo1u7LVGPvm+4 okBCkmXNPGkAylmlpTOjydnze7Cmncqoo6unKdlJk70vJt9BTiKP9weIGJagqXlBBU 7QQjO5KhICVGQkRls9zJ/cx8pTmibuDPCm+GoQ7zBZ0NnnXNpa5SHocOnDMQSOxO3B x5kW8VF+I0jJxII5gEC2UqLHMHerhzI8RkGxsbb8+sagZwHgfdJMuuzhpSOoVSJtpL pSMavBFtR23l6Mxk5EyOfVT4JtAzCRQxg7aR/+eFEdTVRPsnuZ8+V40oKjF83C/irp CC/I9CVrEZhsQ== From: AngeloGioacchino Del Regno To: jic23@kernel.org Cc: lars@metafoo.de, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, ruanjinjie@huawei.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, wenst@chromium.org, kernel@collabora.com Subject: [PATCH] iio: adc: mt6577_auxadc: Fix kernel panic on suspend Date: Tue, 10 Oct 2023 14:19:40 +0200 Message-ID: <20231010121940.159696-1-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Tue, 10 Oct 2023 05:19:57 -0700 (PDT) X-Spam-Level: ** Commit a2d518fbe376 ("iio: adc: mt6577_auxadc: Simplify with device managed function") simplified the driver with devm hooks, but wrongly states that the platform_set_drvdata(), platform_get_drvdata() are unused after the simplification: the driver data is infact used in .suspend() and .resume() PM callbacks, currently producing a kernel panic. Reintroduce the call to platform_set_drvdata() in the probe function Fixes: a2d518fbe376 ("iio: adc: mt6577_auxadc: Simplify with device managed function") Signed-off-by: AngeloGioacchino Del Regno --- drivers/iio/adc/mt6577_auxadc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/iio/adc/mt6577_auxadc.c b/drivers/iio/adc/mt6577_auxadc.c index 370b84c2d0ba..3343b54e8e44 100644 --- a/drivers/iio/adc/mt6577_auxadc.c +++ b/drivers/iio/adc/mt6577_auxadc.c @@ -293,6 +293,7 @@ static int mt6577_auxadc_probe(struct platform_device *pdev) mt6577_auxadc_mod_reg(adc_dev->reg_base + MT6577_AUXADC_MISC, MT6577_AUXADC_PDN_EN, 0); mdelay(MT6577_AUXADC_POWER_READY_MS); + platform_set_drvdata(pdev, indio_dev); ret = devm_add_action_or_reset(&pdev->dev, mt6577_power_off, adc_dev); if (ret) -- 2.42.0