From patchwork Fri Nov 9 04:31:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasily Khoruzhick X-Patchwork-Id: 10675299 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BCDCB14BD for ; Fri, 9 Nov 2018 04:31:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9E4C42E6EA for ; Fri, 9 Nov 2018 04:31:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8B2542E748; Fri, 9 Nov 2018 04:31:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 385202E6EA for ; Fri, 9 Nov 2018 04:31:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=+24gA1iCe948L3mje1l9pcfNAa1gsbIrBIJXB0PjKV0=; b=XWB69LKwUOH1Bo LgcFzRsBX60cTRO6Xf9VYy2I0YO8TUrc0gvSeLPy4jtG/dmGRtxENQoep1tFnKElzlqhdSdqJT4iV e8SE1Nwj7rCN33/+HavISNhztUybbIphEpaPNHdosygwbteucVxppNCG7q438wuWIIgyfR57yhmuW pENhmYnEjEeY0XpilZxpRwpxWNAMnymJh3Lai+nrJixr51KDDuvSHl7r/SNS71hWahauXVgcBy07q Z0Q+k8iC2PYekrH+VdOJQkx3v96GhOhKuH45R9yn/PYoR74EiB5Jirppfp96Gy3QpkDrl7QjpPWMN HrQUIv33xoZRXIFJ8VTA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gKySZ-0001s3-FG; Fri, 09 Nov 2018 04:31:55 +0000 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gKySW-0001rd-2R for linux-arm-kernel@lists.infradead.org; Fri, 09 Nov 2018 04:31:53 +0000 Received: by mail-pg1-x542.google.com with SMTP id 80so315754pge.4 for ; Thu, 08 Nov 2018 20:31:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=qpgjPTY057hOdoFwluk4psgsWwrZlqO0757eoQR8vHM=; b=n6zxY0GkleLGHSKmPYIVmU6vP1vYmhzU4Al51Xn71hNKlN2bUU+TmaAdlXuHqDgsQ/ ZI7lNi2VbaoikKUvVtsFV73/mxM3Tf+kofiC1MLjr46CaLdch9XBi7p9poGTJUtij3i4 KJSMbsVL6UAdEuwB6XeLja3Zqn74EoDaM21JMdklL04LtEm5Te5p1CLJSpEFMgSOcXQy rahP20XkC4tt3I++8wJAs94144IVCFwKFp+6Ms64xe1WWgzTupXqGmrmUyAvDEVx9461 0/E841v76X8dY6Jxsz3lJvtqcqaqissh55qkaJBf6oVOrGxY8nYs5H3FvVXoPfF5IRQi RjpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=qpgjPTY057hOdoFwluk4psgsWwrZlqO0757eoQR8vHM=; b=ixZExl2x8qnGthhNaxYfoIpzggEGaJzZ13jvrJk4e2EfMIPsRnEUR2q2O23rlJlAfA VI0G2e7VL6ODN30D3w3FTQThkJ/jp1TwS1O/DWKioM0ODTyvEzQw1qEu3/JouUH4R9bW z/OgWWFJ2Upl0Pn1Te0bs4C7RFv4tvGnDmlpFwwjH6K7J09KZbmiZdHa2wfeDXciQAzf IdTbOgLwZ7EXkPLIkdSnAxbIlOj+e5QB2uPk3Dmct1EdjRR2kjeVPQqM8BakXViVwZiF si0jW9/JSMeOQ2Gr8rtakIyhTxYwn5/AhnUyjzZc6u0CyIyJ2l8XZ/vdSTOz4hXVllQi CO5Q== X-Gm-Message-State: AGRZ1gLFE561PBw+NVnFsHTAxutSUi+Zvto+KF+Lq+DvCKvtrilqgowc mVtWvgawu7ZO2stsj83o1Ds= X-Google-Smtp-Source: AJdET5cfggPaZPq8kf++gnkdE2W6h9exMANeyrhgn/e39I8TcHhah4Iv6eJziP7vlS93jdmAOvYr0w== X-Received: by 2002:a63:f0c:: with SMTP id e12mr6132808pgl.274.1541737901162; Thu, 08 Nov 2018 20:31:41 -0800 (PST) Received: from anarsoul-thinkpad.lan (216-71-193-140.dyn.novuscom.net. [216.71.193.140]) by smtp.gmail.com with ESMTPSA id 3-v6sm4937856pga.12.2018.11.08.20.31.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Nov 2018 20:31:40 -0800 (PST) From: Vasily Khoruzhick To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Maxime Ripard , Chen-Yu Tsai , Mylene JOSSERAND , Kuninori Morimoto , alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] ASoC: sun8i-codec: fix crash on module removal Date: Thu, 8 Nov 2018 20:31:35 -0800 Message-Id: <20181109043135.26200-1-anarsoul@gmail.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181108_203152_116054_8BBE2366 X-CRM114-Status: GOOD ( 11.44 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vasily Khoruzhick Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP drvdata is actually sun8i_codec, not snd_soc_card, so it crashes when calling snd_soc_card_get_drvdata(). Drop card and scodec vars anyway since we don't need to disable/unprepare clocks - it's already done by calling runtime_suspend() Drop clk_disable_unprepare() calls for the same reason. Fixes: 36c684936fae7 ("ASoC: Add sun8i digital audio codec") Signed-off-by: Vasily Khoruzhick Acked-by: Maxime Ripard --- sound/soc/sunxi/sun8i-codec.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/sound/soc/sunxi/sun8i-codec.c b/sound/soc/sunxi/sun8i-codec.c index 522a72fde78d..c4196d4e5915 100644 --- a/sound/soc/sunxi/sun8i-codec.c +++ b/sound/soc/sunxi/sun8i-codec.c @@ -605,16 +605,10 @@ static int sun8i_codec_probe(struct platform_device *pdev) static int sun8i_codec_remove(struct platform_device *pdev) { - struct snd_soc_card *card = platform_get_drvdata(pdev); - struct sun8i_codec *scodec = snd_soc_card_get_drvdata(card); - pm_runtime_disable(&pdev->dev); if (!pm_runtime_status_suspended(&pdev->dev)) sun8i_codec_runtime_suspend(&pdev->dev); - clk_disable_unprepare(scodec->clk_module); - clk_disable_unprepare(scodec->clk_bus); - return 0; }