Received: by 2002:ac0:de83:0:0:0:0:0 with SMTP id b3csp1346128imk; Mon, 4 Jul 2022 00:50:03 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sPew0BnwVolL7qpT6lj64jyMuJVACYy8pXrhTnIBt5v2vjjqNrXoeGPA5TYO7CsUfBgQfC X-Received: by 2002:a17:907:a088:b0:726:db8d:281f with SMTP id hu8-20020a170907a08800b00726db8d281fmr27098944ejc.601.1656921002958; Mon, 04 Jul 2022 00:50:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656921002; cv=none; d=google.com; s=arc-20160816; b=l9zCSIi8qNS5d3Ea/zbNktPPu4jthwBcxmsagaUx33w8AqNwj1yiNSLu0N/UpwBL9r T4lmztm8Xmj0ej7ge+BWcoB+kkVOX4rOj31gu6/TbDXTjv1JSI7GvtDwpS1Y9P+tLkzR 9KHhKZeVB34VPcEAarGQ3/omISfAWVMvkkF5JczRJt3Fk9SwRqb/bfYbU6iMMuDMaDC1 eI9DDTGfWb1NIytCNrl6AOIqwcyR9VdCWoBThWyaNq1P0w4qKOwvH9sGvTp1q/bgosGR bLrFH5rQ3JsMy7qDtYfUmCcQkzyJqma5pimM4r8efp3+iLK0QSIt5P/r0WRoVnY++lcU 7k3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=f5a8mKIRfNZwU2p1L4qrtF4ntjb+8UJQhe1v8pm8j6w=; b=jkqFhPltaurVFVQQSLc2sewwPBWXl+iDqq+28wuL/4Tr2hn7p0L1+6rvMoFLMgzQoM aOC0zRe8Jg2DGRVL+94YePG4pcpMt3x/1b40fO1PBTGcRca3KVAsgh9ENmWmZ/6e09mW 00xtTS38rKs9JfWC0TbfM+5f8FlYKRepbJJOL7lNHrW/Ndd/MC/1Zslm3WN7IOp8r+CC b3mF70SPgV1y2rpDFJbI3fXSTZajflbBwgw5AUdOufPoN6KUj40JqrDD2yMeUUvRu9pI rKCigC1/dGP5NCEjTomMQ6fZOGUda005raHTHDQzy1okdzZlgydb7L+0oPBHhG27S2Ct sGgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=J6+Tb43R; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s12-20020a1709064d8c00b006ff09d27800si33439505eju.536.2022.07.04.00.49.38; Mon, 04 Jul 2022 00:50:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=J6+Tb43R; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232560AbiGDHfw (ORCPT + 99 others); Mon, 4 Jul 2022 03:35:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229477AbiGDHfv (ORCPT ); Mon, 4 Jul 2022 03:35:51 -0400 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3618B92 for ; Mon, 4 Jul 2022 00:35:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1656920150; x=1688456150; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=Q0jhAfVtaXX/0rO/evIVGyVYSNPYOU8ggf+ALIBohTc=; b=J6+Tb43RwF7wikl+VSnIbhC6Eb/TJxHU6WmwGeraFQbOZVqOaH6CDj4p E5I4KiRaDoUeoANNwZOvfLpr+MLXChgcNgAVxI+zL3SdAyE8J3xWhtQf/ BjIDCBXbVQF6z4AKgICh7DkDBW3/q4C2Iqka9daRfI/lwKOEsuOndSGGR 0Tcy8FU1F0RKXkqb6LKTPz5YIVRPS3yDfm4/kduKn6Nf4kn0ZWOS588tR l9zsh8+M2Ewvdlph6zrAkdVxm6xYUiJnQlF/+5siB0JSW6y6+xJLTfoP9 NHJy8vbYe8faRlctVDsieomCpIHOFlb0EdpEUoWp/YE3cG1YcgPEvj5wP w==; X-IronPort-AV: E=McAfee;i="6400,9594,10397"; a="281819204" X-IronPort-AV: E=Sophos;i="5.92,243,1650956400"; d="scan'208";a="281819204" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jul 2022 00:35:50 -0700 X-IronPort-AV: E=Sophos;i="5.92,243,1650956400"; d="scan'208";a="567076613" Received: from rogerior-mobl1.ger.corp.intel.com (HELO [10.249.254.21]) ([10.249.254.21]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jul 2022 00:35:47 -0700 Message-ID: <9c67d656-9990-7206-58b4-3de25d8341a0@linux.intel.com> Date: Mon, 4 Jul 2022 10:36:33 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0 Thunderbird/91.10.0 Subject: Re: [PATCH v2 1/1] ASoC: Intel: catpt: remove duplicating driver data retrieval Content-Language: en-US To: Andy Shevchenko , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Cc: Cezary Rojewski , Pierre-Louis Bossart , Liam Girdwood , Bard Liao , Ranjani Sridharan , Kai Vehmanen , Mark Brown , Jaroslav Kysela , Takashi Iwai References: <20220703145152.62297-1-andriy.shevchenko@linux.intel.com> From: =?UTF-8?Q?P=c3=a9ter_Ujfalusi?= In-Reply-To: <20220703145152.62297-1-andriy.shevchenko@linux.intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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 On 03/07/2022 17:51, Andy Shevchenko wrote: > device_get_match_data() in ACPI case calls similar to acpi_match_device(). > Hence there is no need to duplicate the call. Just assign what is in > the id->driver_data. > > Signed-off-by: Andy Shevchenko > --- > v2: dropped device_get_match_data() and rewrote commit message > sound/soc/intel/catpt/device.c | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) > > diff --git a/sound/soc/intel/catpt/device.c b/sound/soc/intel/catpt/device.c > index 85a34e37316d..2eeaeb962532 100644 > --- a/sound/soc/intel/catpt/device.c > +++ b/sound/soc/intel/catpt/device.c > @@ -247,6 +247,7 @@ static int catpt_acpi_probe(struct platform_device *pdev) > id = acpi_match_device(dev->driver->acpi_match_table, dev); > if (!id) > return -ENODEV; > + spec = (const struct catpt_spec *)id->driver_data; > > ret = snd_intel_acpi_dsp_driver_probe(dev, id->id); > if (ret != SND_INTEL_DSP_DRIVER_ANY && ret != SND_INTEL_DSP_DRIVER_SST) { > @@ -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; We could just pass the "(const struct catpt_spec *)id->driver_data" in place of spec to catpt_dev_init() and we can get rid of the local temporary pointer? If not, then I would cast out the spec before it's use: spec = (const struct catpt_spec *)id->driver_data; catpt_dev_init(cdev, dev, spec); -- Péter