From patchwork Wed Apr 10 10:37:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viorel Suman X-Patchwork-Id: 1083305 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44fLL21tDXz9s4V for ; Wed, 10 Apr 2019 20:41:14 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="vjlEbidd"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 44fLL20qWJzDqNv for ; Wed, 10 Apr 2019 20:41:14 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nxp.com (client-ip=40.107.0.65; helo=eur02-am5-obe.outbound.protection.outlook.com; envelope-from=viorel.suman@nxp.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="vjlEbidd"; dkim-atps=neutral Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00065.outbound.protection.outlook.com [40.107.0.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 44fLFq5pZxzDqP2 for ; Wed, 10 Apr 2019 20:37:35 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7k8MdTq2WZP8IZ9fXNE30HwJBwh33rYsVy6IBwalXDw=; b=vjlEbiddAA2v0xNY49YC9QPbD5Qcw9qw3q3un83gYtP84fDadicfYVmoI4Q1v1tyNinNpUXd2BId8f8noghioXXKzhygiNZBcw/eUdPCbdT4yloByjbhnEhOdM693nvu9KZnT8C40poL4WhP/UFfOB3r/Q4ksREMCpHTP0zr2Y0= Received: from VI1PR04MB4704.eurprd04.prod.outlook.com (20.177.48.157) by VI1PR04MB5549.eurprd04.prod.outlook.com (20.178.122.219) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1771.16; Wed, 10 Apr 2019 10:37:29 +0000 Received: from VI1PR04MB4704.eurprd04.prod.outlook.com ([fe80::2594:3cf0:20a2:8888]) by VI1PR04MB4704.eurprd04.prod.outlook.com ([fe80::2594:3cf0:20a2:8888%3]) with mapi id 15.20.1792.009; Wed, 10 Apr 2019 10:37:29 +0000 From: Viorel Suman To: Timur Tabi , Nicolin Chen , Xiubo Li , Fabio Estevam , Liam Girdwood , Mark Brown , Jaroslav Kysela , Rob Herring , Mark Rutland , Takashi Iwai , Shawn Guo , Sascha Hauer , Julia Lawall Subject: [PATCH v3 1/4] ASoC: fsl_audmix: remove "model" attribute Thread-Topic: [PATCH v3 1/4] ASoC: fsl_audmix: remove "model" attribute Thread-Index: AQHU74llTOya3frf1k2uzJ2X5c1hIw== Date: Wed, 10 Apr 2019 10:37:29 +0000 Message-ID: <1554892629-17646-2-git-send-email-viorel.suman@nxp.com> References: <1554892629-17646-1-git-send-email-viorel.suman@nxp.com> In-Reply-To: <1554892629-17646-1-git-send-email-viorel.suman@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: VI1PR08CA0085.eurprd08.prod.outlook.com (2603:10a6:800:d3::11) To VI1PR04MB4704.eurprd04.prod.outlook.com (2603:10a6:803:52::29) authentication-results: spf=none (sender IP is ) smtp.mailfrom=viorel.suman@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.7.4 x-originating-ip: [212.146.100.6] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 2ab55d0a-5dd1-43fc-3f46-08d6bda087b7 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600139)(711020)(4605104)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020); SRVR:VI1PR04MB5549; x-ms-traffictypediagnostic: VI1PR04MB5549: x-microsoft-antispam-prvs: x-forefront-prvs: 00032065B2 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(376002)(136003)(396003)(366004)(39860400002)(199004)(189003)(105586002)(71190400001)(71200400001)(256004)(5660300002)(68736007)(106356001)(8676002)(81166006)(81156014)(508600001)(36756003)(66066001)(97736004)(102836004)(6506007)(486006)(25786009)(2616005)(11346002)(446003)(50226002)(386003)(26005)(4326008)(186003)(76176011)(14454004)(8936002)(6436002)(53936002)(7416002)(6486002)(2906002)(52116002)(6116002)(44832011)(54906003)(99286004)(3846002)(316002)(110136005)(86362001)(305945005)(6512007)(7736002)(476003)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR04MB5549; H:VI1PR04MB4704.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: szUsqtwxWE4n07x3Lj5Iws9gSPSPaLTdnhrhD/VxvbQtEn4Z175vUjU13cvTr29+aeCAlLTbllXkiOBC4ZugaDdowgm/t3H1u+XFhy6VIaxBLTL1RQZ0r38Ob/FZtIyp0nOESjV62Jws6yHpyz6NW5aGk0qcY72Nhka9HhPd3RXFr1AKee8NFbGHvQx/EI9QkC0aJpIPmJwRgxhN6BGK3FczvrME2S1/eisHF9gh5ffeOWWEzWQhxJyTm+yjtRKSY5KivWQN5ZqBYCMSExriqLAS9Vkz6gv/hWECPN6MLkfhAzvdCXxUy0gj8spYTevLpcHHMjj3KeEaNVjO2KGnVwTDXtdyMJdI4hf5kklU+Q0M0wMJzcuPXi18RNHhzepZz8ODtEHUcN1RWeFd84IKyOj8Tc/cDRAtbOJ22DJ7diE= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2ab55d0a-5dd1-43fc-3f46-08d6bda087b7 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Apr 2019 10:37:29.1666 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5549 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "devicetree@vger.kernel.org" , "alsa-devel@alsa-project.org" , Viorel Suman , "linux-kernel@vger.kernel.org" , Viorel Suman , dl-linux-imx , Pengutronix Kernel Team , "linuxppc-dev@lists.ozlabs.org" , "linux-arm-kernel@lists.infradead.org" Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Use "of_device_id.data" to specify the machine driver instead of "model" DTS attribute. Signed-off-by: Viorel Suman Acked-by: Nicolin Chen --- sound/soc/fsl/fsl_audmix.c | 43 +++++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/sound/soc/fsl/fsl_audmix.c b/sound/soc/fsl/fsl_audmix.c index dabde03..dc802d5 100644 --- a/sound/soc/fsl/fsl_audmix.c +++ b/sound/soc/fsl/fsl_audmix.c @@ -445,13 +445,29 @@ static const struct regmap_config fsl_audmix_regmap_config = { .cache_type = REGCACHE_FLAT, }; +static const struct of_device_id fsl_audmix_ids[] = { + { + .compatible = "fsl,imx8qm-audmix", + .data = "imx-audmix", + }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, fsl_audmix_ids); + static int fsl_audmix_probe(struct platform_device *pdev) { struct fsl_audmix *priv; struct resource *res; + const char *mdrv; + const struct of_device_id *of_id; void __iomem *regs; int ret; - const char *sprop; + + of_id = of_match_device(fsl_audmix_ids, &pdev->dev); + if (!of_id || !of_id->data) + return -EINVAL; + + mdrv = of_id->data; priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); if (!priv) @@ -487,19 +503,12 @@ static int fsl_audmix_probe(struct platform_device *pdev) return ret; } - sprop = of_get_property(pdev->dev.of_node, "model", NULL); - if (sprop) { - priv->pdev = platform_device_register_data(&pdev->dev, sprop, 0, - NULL, 0); - if (IS_ERR(priv->pdev)) { - ret = PTR_ERR(priv->pdev); - dev_err(&pdev->dev, - "failed to register platform %s: %d\n", sprop, - ret); - } - } else { - dev_err(&pdev->dev, "[model] attribute missing.\n"); - ret = -EINVAL; + priv->pdev = platform_device_register_data(&pdev->dev, mdrv, 0, NULL, + 0); + if (IS_ERR(priv->pdev)) { + ret = PTR_ERR(priv->pdev); + dev_err(&pdev->dev, "failed to register platform %s: %d\n", + mdrv, ret); } return ret; @@ -553,12 +562,6 @@ static const struct dev_pm_ops fsl_audmix_pm = { pm_runtime_force_resume) }; -static const struct of_device_id fsl_audmix_ids[] = { - { .compatible = "fsl,imx8qm-audmix", }, - { /* sentinel */ } -}; -MODULE_DEVICE_TABLE(of, fsl_audmix_ids); - static struct platform_driver fsl_audmix_driver = { .probe = fsl_audmix_probe, .remove = fsl_audmix_remove,