From patchwork Mon Jan 2 20:30:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 638436 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 534E0C3DA7A for ; Mon, 2 Jan 2023 20:32:54 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 78CCDA8D0; Mon, 2 Jan 2023 21:32:02 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 78CCDA8D0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1672691572; bh=dLrrjgSaqjRoOiqz+AdzNR8EU6j9NIhl3046q90cLfo=; h=From:To:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=WGaLFbQdmisPK7Bf5Au/QlZrFqI/OJPKGAr+ghafPk7mYS/HybPHwpKD5T6QKxKSC Sdve3sQbdnlSQCaY4mCf8iC/sZ2cc6rqVP0YfgxvmGNiBMZZ2ZYxNTTCMo6VVwoHR+ rUrFBBuwfbv96LeKwI4Wlyi1jrrBx5F9+ylbZ5VQ= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 28A4FF8057C; Mon, 2 Jan 2023 21:30:19 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 75AD4F8057A; Mon, 2 Jan 2023 21:30:18 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 59C4FF80571 for ; Mon, 2 Jan 2023 21:30:16 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 59C4FF80571 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=hvfxbTfE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1672691417; x=1704227417; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=dLrrjgSaqjRoOiqz+AdzNR8EU6j9NIhl3046q90cLfo=; b=hvfxbTfEqT367shTAucAbCP8XGBfJUN5wNHuo1USY/kL9pAnxckkCBj3 HSHAtd0jUXO1hsV7jIyQYk0huPOmuIe5c4cY+mZWQ0CXKmtyMApcJDRrt +co7oxVTWdroeq/Yz9R3VIVYOJXup8p9Rdc/7qOnvr4IlsKdaFt2bpmcB g+uW5/2F7j6zCp0h8WtsxYdnQQm45TwFckHkByDoQfVdJoZAcq9sujkW4 jSzi8fMYiomVdUIwOBmy3ngfRbwF9iILQgjLqGdq75a+MVlpyKtwM3h26 s4O8voyNSQolnT1gm1sYHCc0ISe0qKWzKOo/mw0u9BQz4pc7vjMoAMGi3 w==; X-IronPort-AV: E=McAfee;i="6500,9779,10578"; a="301224162" X-IronPort-AV: E=Sophos;i="5.96,295,1665471600"; d="scan'208";a="301224162" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jan 2023 12:30:11 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10578"; a="796962531" X-IronPort-AV: E=Sophos;i="5.96,295,1665471600"; d="scan'208";a="796962531" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 02 Jan 2023 12:30:08 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id CFEE6162; Mon, 2 Jan 2023 22:30:40 +0200 (EET) From: Andy Shevchenko To: Mark Brown , Andy Shevchenko , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH v1 3/5] ASoC: Intel: cht_bsw_rt5645: Replace open coded acpi_dev_put() Date: Mon, 2 Jan 2023 22:30:35 +0200 Message-Id: <20230102203037.16120-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230102203037.16120-1-andriy.shevchenko@linux.intel.com> References: <20230102203037.16120-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Cezary Rojewski , Kai Vehmanen , Peter Ujfalusi , Takashi Iwai , Pierre-Louis Bossart , Ranjani Sridharan , Liam Girdwood , Bard Liao Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Instead of calling put_device(&adev->dev) where adev is a pointer to an ACPI device, use specific call, i.e. acpi_dev_put(). Also move it out of the conditional to make it more visible in case some other code will be added which may use that pointer. We need to keep a reference as long as we use the pointer. Signed-off-by: Andy Shevchenko --- sound/soc/intel/boards/cht_bsw_rt5645.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/intel/boards/cht_bsw_rt5645.c b/sound/soc/intel/boards/cht_bsw_rt5645.c index 25a054bd4073..875bc0b3d85d 100644 --- a/sound/soc/intel/boards/cht_bsw_rt5645.c +++ b/sound/soc/intel/boards/cht_bsw_rt5645.c @@ -581,9 +581,9 @@ static int snd_cht_mc_probe(struct platform_device *pdev) if (adev) { snprintf(cht_rt5645_codec_name, sizeof(cht_rt5645_codec_name), "i2c-%s", acpi_dev_name(adev)); - put_device(&adev->dev); cht_dailink[dai_index].codecs->name = cht_rt5645_codec_name; } + acpi_dev_put(adev); /* * swap SSP0 if bytcr is detected From patchwork Mon Jan 2 20:30:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 638435 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 217B4C46467 for ; Mon, 2 Jan 2023 20:33:38 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 9940EA8B6; Mon, 2 Jan 2023 21:32:45 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 9940EA8B6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1672691615; bh=Sj85gbp/SwC5rJk1T732yN9wn+y6PFIsoPKjxU2H1VI=; h=From:To:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=IUiNK0x56EbEtaiG659OLgQtnNldZYBLPgQMQBQozJfF57T9aX3Hi+f0jwu+mEcuv 46+8R3HmhJhhI2s451mlgV81pntsnqRdNDl3k/moNWU2DPbigtnpfU1t1xtHX6ejDi XI8zUk6zG8RT58HxpAhSwXBvDvAODZw0wp4stKtw= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id D02F8F805A9; Mon, 2 Jan 2023 21:30:23 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E3E7CF8058C; Mon, 2 Jan 2023 21:30:21 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id C29D2F80580 for ; Mon, 2 Jan 2023 21:30:17 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz C29D2F80580 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=GgLs28OI DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1672691419; x=1704227419; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Sj85gbp/SwC5rJk1T732yN9wn+y6PFIsoPKjxU2H1VI=; b=GgLs28OIDUTWsUP9XbwunF93tuY2Nyu60VQ7JSowNttFzOTKAftz3GL2 XmkQroz8yeLQ9RE0uPyOevAMtRrdtnsSdIW0z4Whwy9PI2pWj6mnv97GW eU8rrasoxX1inT3vqMwGBYjFe3cd2VpfZC9uBeaWiO3IPVC964OcB+uM6 7WRr5tsJNJ1ApGsmBFDPi+WorlLqch7b+uAcDFKdO/eBuMgU0OMI2HkAw IhPBOJz7kiXirwKmO088hNI3lQjvFZOAklIzf2YYY3sc6NF8URacVOB+b YHblvCtkHVHjHkojPhsfHZBOzu25QOOvh6Ho+fHWKQDy+aQLUXvXZfeh7 Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10578"; a="301224167" X-IronPort-AV: E=Sophos;i="5.96,295,1665471600"; d="scan'208";a="301224167" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jan 2023 12:30:11 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10578"; a="796962529" X-IronPort-AV: E=Sophos;i="5.96,295,1665471600"; d="scan'208";a="796962529" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 02 Jan 2023 12:30:08 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id DE4521CA; Mon, 2 Jan 2023 22:30:40 +0200 (EET) From: Andy Shevchenko To: Mark Brown , Andy Shevchenko , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH v1 4/5] ASoC: Intel: cht_bsw_rt5672: Replace open coded acpi_dev_put() Date: Mon, 2 Jan 2023 22:30:36 +0200 Message-Id: <20230102203037.16120-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230102203037.16120-1-andriy.shevchenko@linux.intel.com> References: <20230102203037.16120-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Cezary Rojewski , Kai Vehmanen , Peter Ujfalusi , Takashi Iwai , Pierre-Louis Bossart , Ranjani Sridharan , Liam Girdwood , Bard Liao Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Instead of calling put_device(&adev->dev) where adev is a pointer to an ACPI device, use specific call, i.e. acpi_dev_put(). Also move it out of the conditional to make it more visible in case some other code will be added which may use that pointer. We need to keep a reference as long as we use the pointer. Signed-off-by: Andy Shevchenko --- sound/soc/intel/boards/cht_bsw_rt5672.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/intel/boards/cht_bsw_rt5672.c b/sound/soc/intel/boards/cht_bsw_rt5672.c index 49d3da8f7316..daa630a0efc1 100644 --- a/sound/soc/intel/boards/cht_bsw_rt5672.c +++ b/sound/soc/intel/boards/cht_bsw_rt5672.c @@ -473,9 +473,9 @@ static int snd_cht_mc_probe(struct platform_device *pdev) if (adev) { snprintf(drv->codec_name, sizeof(drv->codec_name), "i2c-%s", acpi_dev_name(adev)); - put_device(&adev->dev); cht_dailink[dai_index].codecs->name = drv->codec_name; } + acpi_dev_put(adev); /* Use SSP0 on Bay Trail CR devices */ if (soc_intel_is_byt() && mach->mach_params.acpi_ipc_irq_index == 0) {