From patchwork Sat Jul 2 22:32:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 12904104 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 D7570C433EF for ; Sat, 2 Jul 2022 22:33:50 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 2DBC0168C; Sun, 3 Jul 2022 00:32:58 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 2DBC0168C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1656801228; bh=cGLiC8mmOC+hPN2iurZ2+B4LWJ9RFal0ibK69bgVPuo=; h=From:To:Subject:Date:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=lfqD3kyvQeDIr/twb0n9tpJvHcZG57fcSTzY3z2snDo8cSPksKCzPa1MgdJTN1vpW LB+hB08I182i2ruFi75txiuPRk3ShYieVs9P/bH+kZkhgkKKA8OyTnqvbamHqRmBKz mtoJATyRO5y3zcX4a68y3guJOlaThmVXkGxVuH1E= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id B9D98F802D2; Sun, 3 Jul 2022 00:32:57 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 70ACEF8032D; Sun, 3 Jul 2022 00:32:56 +0200 (CEST) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) (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 D5C7EF8019B for ; Sun, 3 Jul 2022 00:32:48 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D5C7EF8019B Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="ARfMW6S5" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1656801170; x=1688337170; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=cGLiC8mmOC+hPN2iurZ2+B4LWJ9RFal0ibK69bgVPuo=; b=ARfMW6S5B+BR2AONxCqTF0+6p5HFtrZUK1kswnuGsyELbN0A2gXOAiSR qgIvjajEJKBlwMdQYPaOu19jEkTYpZA739xizWyYzh+Wv9vPYB2ZQKvRO PdD0cRPY8jnbnoXV5ngt/Pwl8Xgpsp3CyknOTQILGmcXG54dcg5dv+rkW YngmqP1meBB0Rv33P/24dWonoMA9LRFDiTg3MmIAa5YCWftCWv3jEtTuw szKVqisSILEPiXgdSLDejIFCzB5KOL/EtljUdcauE9USJeYexryrf+hBF xUc8OjyTJDN1UtiUPgyr/DPEorI2m1XBr7xd0m45XCQSL/rwaJJE6WDNT g==; X-IronPort-AV: E=McAfee;i="6400,9594,10396"; a="344558880" X-IronPort-AV: E=Sophos;i="5.92,241,1650956400"; d="scan'208";a="344558880" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jul 2022 15:32:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,241,1650956400"; d="scan'208";a="838434018" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga006.fm.intel.com with ESMTP; 02 Jul 2022 15:32:39 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 5F52711D; Sun, 3 Jul 2022 01:32:46 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH v1 1/1] ASoC: Intel: catpt: remove duplicating driver data retrieval Date: Sun, 3 Jul 2022 01:32:43 +0300 Message-Id: <20220702223243.51364-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Cc: Cezary Rojewski , Kai Vehmanen , Peter Ujfalusi , Takashi Iwai , Pierre-Louis Bossart , Ranjani Sridharan , Liam Girdwood , Mark Brown , Bard Liao X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" device_get_match_data() in ACPI case calls similar to acpi_match_device() API. Hence there is no need to duplicate the call. Just check what the former returns. Signed-off-by: Andy Shevchenko Reported-by: kernel test robot --- sound/soc/intel/catpt/device.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/sound/soc/intel/catpt/device.c b/sound/soc/intel/catpt/device.c index 85a34e37316d..21856a394c3d 100644 --- a/sound/soc/intel/catpt/device.c +++ b/sound/soc/intel/catpt/device.c @@ -12,13 +12,14 @@ // helping backtrack its historical background // -#include #include #include +#include #include #include #include #include +#include #include #include #include @@ -244,8 +245,8 @@ static int catpt_acpi_probe(struct platform_device *pdev) struct resource *res; int ret; - id = acpi_match_device(dev->driver->acpi_match_table, dev); - if (!id) + spec = device_get_match_data(dev); + if (!spec) return -ENODEV; ret = snd_intel_acpi_dsp_driver_probe(dev, id->id); @@ -254,10 +255,6 @@ static int catpt_acpi_probe(struct platform_device *pdev) return -ENODEV; } - spec = device_get_match_data(dev); - if (!spec) - return -ENODEV; - cdev = devm_kzalloc(dev, sizeof(*cdev), GFP_KERNEL); if (!cdev) return -ENOMEM;