{"id":2228041,"url":"http://patchwork.ozlabs.org/api/patches/2228041/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-tegra/patch/20260425014244.439788-1-rosenp@gmail.com/","project":{"id":21,"url":"http://patchwork.ozlabs.org/api/projects/21/?format=json","name":"Linux Tegra Development","link_name":"linux-tegra","list_id":"linux-tegra.vger.kernel.org","list_email":"linux-tegra@vger.kernel.org","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20260425014244.439788-1-rosenp@gmail.com>","list_archive_url":null,"date":"2026-04-25T01:42:44","name":"ASoC: tegra: ADX: simplify probe allocation","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"61944a91696027f9246c0a16eed0745a4fda1c6e","submitter":{"id":70304,"url":"http://patchwork.ozlabs.org/api/people/70304/?format=json","name":"Rosen Penev","email":"rosenp@gmail.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linux-tegra/patch/20260425014244.439788-1-rosenp@gmail.com/mbox/","series":[{"id":501414,"url":"http://patchwork.ozlabs.org/api/series/501414/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-tegra/list/?series=501414","date":"2026-04-25T01:42:44","name":"ASoC: tegra: ADX: simplify probe allocation","version":1,"mbox":"http://patchwork.ozlabs.org/series/501414/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2228041/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2228041/checks/","tags":{},"related":[],"headers":{"Return-Path":"\n <linux-tegra+bounces-13956-incoming=patchwork.ozlabs.org@vger.kernel.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-tegra@vger.kernel.org"],"Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=G6Gfbe4r;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=104.64.211.4; helo=sin.lore.kernel.org;\n envelope-from=linux-tegra+bounces-13956-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)","smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com\n header.b=\"G6Gfbe4r\"","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=209.85.214.170","smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com","smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=gmail.com"],"Received":["from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g2Xf44QHNz1y2d\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 25 Apr 2026 11:43:08 +1000 (AEST)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sin.lore.kernel.org (Postfix) with ESMTP id A66B03003BEE\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 25 Apr 2026 01:43:05 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 39BFD22068D;\n\tSat, 25 Apr 2026 01:43:04 +0000 (UTC)","from mail-pl1-f170.google.com (mail-pl1-f170.google.com\n [209.85.214.170])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id D80E2204F93\n\tfor <linux-tegra@vger.kernel.org>; Sat, 25 Apr 2026 01:43:02 +0000 (UTC)","by mail-pl1-f170.google.com with SMTP id\n d9443c01a7336-2ab46931cf1so65640735ad.0\n        for <linux-tegra@vger.kernel.org>;\n Fri, 24 Apr 2026 18:43:02 -0700 (PDT)","from ryzen ([2601:644:8000:5b5d::8bd])\n        by smtp.gmail.com with ESMTPSA id\n d9443c01a7336-2b5faa494e1sm235306615ad.35.2026.04.24.18.43.01\n        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n        Fri, 24 Apr 2026 18:43:01 -0700 (PDT)"],"ARC-Seal":"i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1777081384; cv=none;\n b=ASvVY05BrF1Um3t717GNrFlvWRXBa2OUDsVmPHahwluzj9m8vuDunjIKGu81aUsVW91I0w8PpdPex4jE4lygxNDen2j/6jvzSKcdTTsYS+tcLKF3CJDo+QHIfawyqBjHI94HRFa4aL9myn2hqLDog4vlHKRwiGavdnONfYS30do=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1777081384; c=relaxed/simple;\n\tbh=+cdLIRk7vhwZO1mTjgtO6cxF+uoVQlfIJe72382/1X8=;\n\th=From:To:Cc:Subject:Date:Message-ID:MIME-Version;\n b=uN6wqxhjSugXR1J5/nAWxJYHMYz4Nd4pzwQ804XgpqIiLb9RNoH2ceCossbV2AAQjbXXvhPCy18yVeDjoziY+rP8nEuj+hVmRpHt7HrsGrwcvGYkgswUiObqQv77hEP+1ADkW1NXqzS75tYGlJwchxKz1rvh/UEGJqAQs0OB7Pk=","ARC-Authentication-Results":"i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com;\n spf=pass smtp.mailfrom=gmail.com;\n dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com\n header.b=G6Gfbe4r; arc=none smtp.client-ip=209.85.214.170","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=gmail.com; s=20251104; t=1777081382; x=1777686182;\n darn=vger.kernel.org;\n        h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n         :to:from:from:to:cc:subject:date:message-id:reply-to;\n        bh=Z7jfOZXdYS61UScW0k+/0N0W+wALOe5mQD08+f58S0o=;\n        b=G6Gfbe4rwPdKE9yQ1N9dR77SsaGX7INzaTIO5P3JFJHkv6EaucQ/fxW6QlI7+7acCE\n         9W7wAh2T+1Kw/PUNRaay4Eq6rcL9YAqS2EkIeY1+O6JYFBgMDWRtHW21FRMOw0qCFp/f\n         jlmOlF7AjXr4xpcIz+zYv3GD5GLz6tpuiz/1D97uryvXiKhcuOULbRy2rKoLLWw8oMd0\n         ZZDeifch6lO+6weuXgTy5yA49XxnazinE3xGPjBEpRKvst4Fn32zJ+szEiUEr1t3sRej\n         9NfkHFScdHDxf12rwpyT9kZawrk16CbJsdN66KPqJ6ulTHmksBuhYvhsRpkjMHjnh1gc\n         gY/A==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=1e100.net; s=20251104; t=1777081382; x=1777686182;\n        h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n         :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n         :message-id:reply-to;\n        bh=Z7jfOZXdYS61UScW0k+/0N0W+wALOe5mQD08+f58S0o=;\n        b=Sq+1yYWLxSCR0eBcY0PtyKm90mDY/SDHqNFx26PaYNq/uyxM/lgugT8efJi/PBXNC/\n         vMBq25qUS54RZdQNpbFZPgaWLfU+iMzgdRu+3BdLRciikcukUN+rKedVmlozYmBby7Sa\n         eMKKiXVmEKzwLwNcsqKt72lBtxhxX4udohcJ926HQd//RY90ZprxQ6Whmcd/NplAy5Gx\n         2tNCEsHbY4PuaRwKhFiJlSNGKHA94uyrutFmcwsurdU780G53fJ8li09x0D8lge0Ru4e\n         24D4fd36Mn8fQaT6tJ5x9Uzk5slx0XSQ+IMq4JNPTU79kDqJTdXWrJpg5lUEKpy3pckn\n         a27Q==","X-Forwarded-Encrypted":"i=1;\n AFNElJ+TWZpw0U2siQfQMjn2UxbwtUgvdtsfsIs/yyiCvPrYPVnicxvLT8Wl1lFNRx+MPWCyHQRQ3xIQ1dFVgA==@vger.kernel.org","X-Gm-Message-State":"AOJu0YwyJ9Ha+U8/9uYykMNiHCfGqWtkbTdlmTQzzaUg9P1Y3odNaRMj\n\tV1e1sU/ybFlUoxQ/v8pRafthkeEfqtu992t3P0tjBHkqK3uqYGIW4i1g","X-Gm-Gg":"AeBDievRlwiZLSURHTLYq3tGG8P1sGZapcp7uRtzH63nzW7HmeGh6oudm2T8HgIVdpu\n\twomD6gKZGD2KCbTeqwAfKv2cisyY82VRGUdzZq+ydub+a/kaLo1lNjA5Zqj3TZwq+tmNf39cXTv\n\tXz9GEj3Oadn2S1fEt996yPS98M2Yfouj9L0giHZAAWLlhEE3bX0ShubZNpsZtoZ7DQ8kqTiJzY0\n\twc4slTJEPgXNtQYxb8FzpN1yAdQp+Ib/IVFPpbyxgoJc1Cprl6GBXNWXKQjKXCpdcSn9aueXlgG\n\twCxwwmKbYi5c5mLYY6XuR4gB5j3lK20o+jydBm6sO46bpZDIYk3xKMRdhCTScgO6IcewbrAQZD0\n\tQ0fVjdwLYzNnll/PVy0eXXOSzfE3Y0QhJTRQIuCNp6Un9VY1ceX45yJLMMd5EE2GoSMV3Th+8p6\n\tUhuImXwz2eCd1RZFX4WIqKpvwBgnee+sSQLSKXcIq3RsRuMZef9xAA3oYadZSKvEpsoG+IlvR3h\n\tqNCsEezzXjJYTZoBHtswQzdxQ==","X-Received":"by 2002:a17:902:e748:b0:2b4:5d0c:7a85 with SMTP id\n d9443c01a7336-2b5f9dbcd42mr318493365ad.3.1777081382212;\n        Fri, 24 Apr 2026 18:43:02 -0700 (PDT)","From":"Rosen Penev <rosenp@gmail.com>","To":"linux-sound@vger.kernel.org","Cc":"Liam Girdwood <lgirdwood@gmail.com>,\n\tMark Brown <broonie@kernel.org>,\n\tJaroslav Kysela <perex@perex.cz>,\n\tTakashi Iwai <tiwai@suse.com>,\n\tThierry Reding <thierry.reding@kernel.org>,\n\tJonathan Hunter <jonathanh@nvidia.com>,\n\tlinux-tegra@vger.kernel.org (open list:TEGRA ARCHITECTURE SUPPORT),\n\tlinux-kernel@vger.kernel.org (open list)","Subject":"[PATCH] ASoC: tegra: ADX: simplify probe allocation","Date":"Fri, 24 Apr 2026 18:42:44 -0700","Message-ID":"<20260425014244.439788-1-rosenp@gmail.com>","X-Mailer":"git-send-email 2.54.0","Precedence":"bulk","X-Mailing-List":"linux-tegra@vger.kernel.org","List-Id":"<linux-tegra.vger.kernel.org>","List-Subscribe":"<mailto:linux-tegra+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-tegra+unsubscribe@vger.kernel.org>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit"},"content":"Reduce 3 allocations to one using a flexible array member.\n\nAlso use of_device_get_match_data. No error checking since it cannot be\nNULL.\n\nSigned-off-by: Rosen Penev <rosenp@gmail.com>\n---\n sound/soc/tegra/tegra210_adx.c | 24 ++++++++----------------\n sound/soc/tegra/tegra210_adx.h |  2 +-\n 2 files changed, 9 insertions(+), 17 deletions(-)","diff":"diff --git a/sound/soc/tegra/tegra210_adx.c b/sound/soc/tegra/tegra210_adx.c\nindex d2f742ffc59d..3f6c068d00c8 100644\n--- a/sound/soc/tegra/tegra210_adx.c\n+++ b/sound/soc/tegra/tegra210_adx.c\n@@ -676,17 +676,20 @@ static int tegra210_adx_platform_probe(struct platform_device *pdev)\n {\n \tstruct device *dev = &pdev->dev;\n \tstruct tegra210_adx *adx;\n-\tconst struct of_device_id *match;\n-\tstruct tegra210_adx_soc_data *soc_data;\n+\tconst struct tegra210_adx_soc_data *soc_data;\n \tvoid __iomem *regs;\n+\tsize_t alloc_size;\n \tint err;\n \n-\tadx = devm_kzalloc(dev, sizeof(*adx), GFP_KERNEL);\n+\tsoc_data = of_device_get_match_data(&pdev->dev);\n+\talloc_size = struct_size(adx, map, soc_data->ram_depth);\n+\talloc_size += sizeof(u32) * soc_data->byte_mask_size;\n+\n+\tadx = devm_kzalloc(dev, alloc_size, GFP_KERNEL);\n \tif (!adx)\n \t\treturn -ENOMEM;\n \n-\tmatch = of_match_device(tegra210_adx_of_match, dev);\n-\tsoc_data = (struct tegra210_adx_soc_data *)match->data;\n+\tadx->byte_mask = adx->map + soc_data->ram_depth;\n \tadx->soc_data = soc_data;\n \n \tdev_set_drvdata(dev, adx);\n@@ -703,17 +706,6 @@ static int tegra210_adx_platform_probe(struct platform_device *pdev)\n \n \tregcache_cache_only(adx->regmap, true);\n \n-\tadx->map = devm_kzalloc(dev, soc_data->ram_depth * sizeof(*adx->map),\n-\t\t\t\tGFP_KERNEL);\n-\tif (!adx->map)\n-\t\treturn -ENOMEM;\n-\n-\tadx->byte_mask = devm_kzalloc(dev,\n-\t\t\t\t      soc_data->byte_mask_size * sizeof(*adx->byte_mask),\n-\t\t\t\t      GFP_KERNEL);\n-\tif (!adx->byte_mask)\n-\t\treturn -ENOMEM;\n-\n \ttegra210_adx_dais[TEGRA_ADX_IN_DAI_ID].playback.channels_max =\n \t\t\tadx->soc_data->max_ch;\n \ndiff --git a/sound/soc/tegra/tegra210_adx.h b/sound/soc/tegra/tegra210_adx.h\nindex 176a4e40de0a..4406a4a74496 100644\n--- a/sound/soc/tegra/tegra210_adx.h\n+++ b/sound/soc/tegra/tegra210_adx.h\n@@ -88,9 +88,9 @@ struct tegra210_adx_soc_data {\n \n struct tegra210_adx {\n \tstruct regmap *regmap;\n-\tunsigned int *map;\n \tunsigned int *byte_mask;\n \tconst struct tegra210_adx_soc_data *soc_data;\n+\tunsigned int map[];\n };\n \n #endif\n","prefixes":[]}