Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp27821pxb; Wed, 30 Mar 2022 21:58:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCB1dbdgZW3VYyRDE4/+yUBO3pRScnvcb+gj2ru9abpvqYVAafMRGaAqlTZvJQZFc6X0ZP X-Received: by 2002:a17:90b:1c07:b0:1c7:5324:c68e with SMTP id oc7-20020a17090b1c0700b001c75324c68emr3975109pjb.202.1648702733419; Wed, 30 Mar 2022 21:58:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648702733; cv=none; d=google.com; s=arc-20160816; b=wXwPS7lWe56f6vRQGb68YACk2Xr9c7R1YsQUXFtTxsF5JploOVLyYrGajpfdzT9UWU PMq5x73i9Y6Pn7UpgNLTEilDYWY9Zn7k4qjrM+znvb1oqiMA5u5hL8a3WJKKkb+FOylt R0yYTM03CI/i6eZ4a3SsFoihyHksgSvIB93RWnDSrIZswxFr3IkfLYUdJkXCs0xzs+/m gD9f2mO1rEILPrTfqXdyu10lSzrdnEGkE1cqR3l5jRwgs6DMAQvDyR1QdeumuRQ7MQ+6 iTuYczJXB2oKQJ4Ure5giXDExevv7ER7m0Y3Vq2LnTcc2P4NHf+6XmL5c6NPVBHFDtqt HyCg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=fm/j2IvDDhS3AcpXsqNBKLiW0/eydSAJQFD6w0WFpCA=; b=xudmXcYJgplRbaI/kzVkRZUaka2zIG74gRFBrZeULepCeG/A+TiRQxRhoAxdRPql4Y nh6NcdXO8FPiiF/YUZzVPxv5RYsstOzu0JM2IEqvFUr+ma90XE4f0Qh61SPNcKjZDJ9t GHw8N0/0FJ+mR1HoW1H+i4x2xk1RTjoaA3Ew4KCNfxyg0L8+iCtlYYDJAtsBsA1+Pqqd jNmyYSwQdevOOAspwauvYBdPM4LIqpK/oQ5MUMOUoDA89NzvipvQuR3jTJCAuNgNK/sb 1kX2jsqxWeRBIE2CWQ0BzUsliRU1IV19Z5jjrWSmbpoTXH29OYWCYyktaxEj3dmA7M0p B1Pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ngt4D4eP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id o25-20020a635d59000000b003816043efd4si23045343pgm.457.2022.03.30.21.58.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Mar 2022 21:58:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ngt4D4eP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9D2FE23F39B; Wed, 30 Mar 2022 20:36:22 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347921AbiC3MH6 (ORCPT + 99 others); Wed, 30 Mar 2022 08:07:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344346AbiC3Lw6 (ORCPT ); Wed, 30 Mar 2022 07:52:58 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1E7A261304; Wed, 30 Mar 2022 04:48:43 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9F2B061618; Wed, 30 Mar 2022 11:48:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DC384C36AE2; Wed, 30 Mar 2022 11:48:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648640922; bh=HHjBaMZZNUVS7HlclTpFmCYSIBZArxrZX0QEnHO+Zzk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ngt4D4eP2xmEVf7N4D2jMAB/G1k/9cAsJWgUyUAsJEkdUgNEyEk47qVUQHeqp2p3u YwGatRF0uVDsy+96yiJZzb1piO/qxzXkJ/YQFfkK0yGoGCHS+AANuzL4Hz5AmSFrQg /kLJgndJnbCZ4YlUyZ8tXP5QxzALQuOEFYeek62mv+3+lCvI7vudlXKLw4msjrUFJn 3InEEkziYHkQPasD0EcKpBBKbvFLfOIireV/lEvi2EA+FHp6X/FzOYRwP2D5IAFQxk shzOrwMmVyX/PRwMWf97cSIFRzBWoAngH7DDyrJXaXv6K9zv2jVHttWHMjIgp9PvFW 8ObFuoffpiXcg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Lad Prabhakar , Pavel Machek , Biju Das , Mark Brown , Sasha Levin , lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org Subject: [PATCH AUTOSEL 5.16 06/59] ASoC: sh: rz-ssi: Make the data structures available before registering the handlers Date: Wed, 30 Mar 2022 07:47:38 -0400 Message-Id: <20220330114831.1670235-6-sashal@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220330114831.1670235-1-sashal@kernel.org> References: <20220330114831.1670235-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lad Prabhakar [ Upstream commit 0788785c78342d422f93b1c9831c2b2b7f137937 ] Initialize the spinlock and make the data structures available before registering the interrupt handlers. Reported-by: Pavel Machek Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Link: https://lore.kernel.org/r/20220110094711.8574-3-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/sh/rz-ssi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sound/soc/sh/rz-ssi.c b/sound/soc/sh/rz-ssi.c index fa0cc08f70ec..f6ba00bfcc80 100644 --- a/sound/soc/sh/rz-ssi.c +++ b/sound/soc/sh/rz-ssi.c @@ -975,6 +975,9 @@ static int rz_ssi_probe(struct platform_device *pdev) ssi->playback.priv = ssi; ssi->capture.priv = ssi; + spin_lock_init(&ssi->lock); + dev_set_drvdata(&pdev->dev, ssi); + /* Error Interrupt */ ssi->irq_int = platform_get_irq_byname(pdev, "int_req"); if (ssi->irq_int < 0) @@ -1022,8 +1025,6 @@ static int rz_ssi_probe(struct platform_device *pdev) pm_runtime_enable(&pdev->dev); pm_runtime_resume_and_get(&pdev->dev); - spin_lock_init(&ssi->lock); - dev_set_drvdata(&pdev->dev, ssi); ret = devm_snd_soc_register_component(&pdev->dev, &rz_ssi_soc_component, rz_ssi_soc_dai, ARRAY_SIZE(rz_ssi_soc_dai)); -- 2.34.1