From patchwork Tue Dec 30 01:52:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 5550801 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6A92D9F1BF for ; Tue, 30 Dec 2014 01:53:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 80A7C200E6 for ; Tue, 30 Dec 2014 01:53:18 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 597C4200E1 for ; Tue, 30 Dec 2014 01:53:17 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id CE71026058F; Tue, 30 Dec 2014 02:53:10 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 6F69A260597; Tue, 30 Dec 2014 02:53:02 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id B421526059A; Tue, 30 Dec 2014 02:53:01 +0100 (CET) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by alsa0.perex.cz (Postfix) with ESMTP id 6965326058F for ; Tue, 30 Dec 2014 02:52:54 +0100 (CET) Received: by mail-vc0-f174.google.com with SMTP id id10so5490051vcb.19 for ; Mon, 29 Dec 2014 17:52:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=HhSodTlZ/YW7pysHUVmY7FKiXb0575qAPCjA7Q+xTfg=; b=qfhROePTqVf3cdPmceABKrfSBGiD6R5q6AleNIctXugGGyAsMYAVXSRNmTBKEqY+0a QCx1PA5iUaaf65i28DaIgHHNUt+Gbg31hDcQYqvBP/uujuPULvT0aew4TcW+PQX3QVgb vjgr23RJRIJl4Q6S0BKG3Z3JsS0QloJB4Q73POtQg2bUkZ7SzyNa/1+5LTWuCrZHIno0 fkLSV28WyrTgmlLbQCViBjFZfAlXihyVu+3y0AhMHI06zy98HwJHNxEhU10fO7+/m4zH LvKFTVmz/ZK4448fGbF7CciTUukp4JCEF5zCLndxvj2fZVGIcS+EjfCVcrfzoh6UlCn8 LV7g== X-Received: by 10.52.110.195 with SMTP id ic3mr28219501vdb.47.1419904373297; Mon, 29 Dec 2014 17:52:53 -0800 (PST) Received: from localhost.localdomain ([189.101.176.228]) by mx.google.com with ESMTPSA id oh11sm10619938vdb.9.2014.12.29.17.52.51 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 29 Dec 2014 17:52:52 -0800 (PST) From: Fabio Estevam To: broonie@kernel.org Date: Mon, 29 Dec 2014 23:52:35 -0200 Message-Id: <1419904356-6865-1-git-send-email-festevam@gmail.com> X-Mailer: git-send-email 1.9.1 Cc: nicoleotsuka@gmail.com, Fabio Estevam , alsa-devel@alsa-project.org Subject: [alsa-devel] [PATCH 1/2] ASoC: fsl_spdif: Use dev_name() for registering the irq X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Fabio Estevam The 'name' array is currently stored inside the fsl_spdif_priv private structure only for registering the interrupt name. This can be simplified by registering it with dev_name() instead. Signed-off-by: Fabio Estevam Acked-by: Nicolin Chen --- sound/soc/fsl/fsl_spdif.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/sound/soc/fsl/fsl_spdif.c b/sound/soc/fsl/fsl_spdif.c index af042942..73da1f0 100644 --- a/sound/soc/fsl/fsl_spdif.c +++ b/sound/soc/fsl/fsl_spdif.c @@ -90,7 +90,6 @@ struct spdif_mixer_control { * @sysclk: system clock for rx clock rate measurement * @dma_params_tx: DMA parameters for transmit channel * @dma_params_rx: DMA parameters for receive channel - * @name: driver name */ struct fsl_spdif_priv { struct spdif_mixer_control fsl_spdif_control; @@ -109,12 +108,8 @@ struct fsl_spdif_priv { struct clk *sysclk; struct snd_dmaengine_dai_dma_data dma_params_tx; struct snd_dmaengine_dai_dma_data dma_params_rx; - - /* The name space will be allocated dynamically */ - char name[0]; }; - /* DPLL locked and lock loss interrupt handler */ static void spdif_irq_dpll_lock(struct fsl_spdif_priv *spdif_priv) { @@ -1169,19 +1164,15 @@ static int fsl_spdif_probe(struct platform_device *pdev) if (!np) return -ENODEV; - spdif_priv = devm_kzalloc(&pdev->dev, - sizeof(struct fsl_spdif_priv) + strlen(np->name) + 1, - GFP_KERNEL); + spdif_priv = devm_kzalloc(&pdev->dev, sizeof(*spdif_priv), GFP_KERNEL); if (!spdif_priv) return -ENOMEM; - strcpy(spdif_priv->name, np->name); - spdif_priv->pdev = pdev; /* Initialize this copy of the CPU DAI driver structure */ memcpy(&spdif_priv->cpu_dai_drv, &fsl_spdif_dai, sizeof(fsl_spdif_dai)); - spdif_priv->cpu_dai_drv.name = spdif_priv->name; + spdif_priv->cpu_dai_drv.name = dev_name(&pdev->dev); /* Get the addresses and IRQ */ res = platform_get_resource(pdev, IORESOURCE_MEM, 0); @@ -1203,7 +1194,7 @@ static int fsl_spdif_probe(struct platform_device *pdev) } ret = devm_request_irq(&pdev->dev, irq, spdif_isr, 0, - spdif_priv->name, spdif_priv); + dev_name(&pdev->dev), spdif_priv); if (ret) { dev_err(&pdev->dev, "could not claim irq %u\n", irq); return ret;