linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: mpa@pengutronix.de (Markus Pargmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 04/16] ASoC: fsl-ssi: Use dev_name for DAI driver struct
Date: Sat, 15 Mar 2014 13:44:12 +0100	[thread overview]
Message-ID: <1394887464-969-5-git-send-email-mpa@pengutronix.de> (raw)
In-Reply-To: <1394887464-969-1-git-send-email-mpa@pengutronix.de>

Instead of creating a name using string manipulation functions, we can
simply use the device name for the DAI driver struct.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
---
 sound/soc/fsl/fsl_ssi.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
index 6b198f3..f31bd15 100644
--- a/sound/soc/fsl/fsl_ssi.c
+++ b/sound/soc/fsl/fsl_ssi.c
@@ -997,17 +997,13 @@ static int fsl_ssi_probe(struct platform_device *pdev)
 	if (!strcmp(sprop, "ac97-slave"))
 		ac97 = true;
 
-	/* The DAI name is the last part of the full name of the node. */
-	p = strrchr(np->full_name, '/') + 1;
-	ssi_private = devm_kzalloc(&pdev->dev, sizeof(*ssi_private) + strlen(p),
-			      GFP_KERNEL);
+	ssi_private = devm_kzalloc(&pdev->dev, sizeof(*ssi_private),
+			GFP_KERNEL);
 	if (!ssi_private) {
 		dev_err(&pdev->dev, "could not allocate DAI object\n");
 		return -ENOMEM;
 	}
 
-	strcpy(ssi_private->name, p);
-
 	ssi_private->use_dma = !of_property_read_bool(np,
 			"fsl,fiq-stream-filter");
 	ssi_private->hw_type = hw_type;
@@ -1025,7 +1021,7 @@ static int fsl_ssi_probe(struct platform_device *pdev)
 		memcpy(&ssi_private->cpu_dai_drv, &fsl_ssi_dai_template,
 		       sizeof(fsl_ssi_dai_template));
 	}
-	ssi_private->cpu_dai_drv.name = ssi_private->name;
+	ssi_private->cpu_dai_drv.name = dev_name(&pdev->dev);
 
 	/* Get the addresses and IRQ */
 	ret = of_address_to_resource(np, 0, &res);
@@ -1173,7 +1169,6 @@ static int fsl_ssi_probe(struct platform_device *pdev)
 	 * different writeable interrupt status registers.
 	 */
 	if (ssi_private->use_dma) {
-		/* The 'name' should not have any slashes in it. */
 		ret = devm_request_irq(&pdev->dev, ssi_private->irq,
 					fsl_ssi_isr, 0, ssi_private->name,
 					ssi_private);
-- 
1.9.0

  parent reply	other threads:[~2014-03-15 12:44 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-15 12:44 [PATCH v2 00/16] ASoC: fsl-ssi: Driver cleanup Markus Pargmann
2014-03-15 12:44 ` [PATCH v2 01/16] ASoC: fsl-ssi: Remove fsl_ssi_setup Markus Pargmann
2014-03-15 12:44 ` [PATCH v2 02/16] ASoC: fsl-ssi: Fix i2s_mode variable setup Markus Pargmann
2014-03-15 12:44 ` [PATCH v2 03/16] ASoC: fsl-ssi: Move debugging to seperate file Markus Pargmann
2014-03-15 12:44 ` Markus Pargmann [this message]
2014-03-15 12:44 ` [PATCH v2 05/16] ASoC: fsl-ssi: Move imx-specific probe to seperate function Markus Pargmann
2014-03-15 12:44 ` [PATCH v2 06/16] ASoC: fsl-ssi: Remove useless DMA code Markus Pargmann
2014-03-15 12:44 ` [PATCH v2 07/16] ASoC: fsl-ssi: baud clock error handling Markus Pargmann
2014-03-15 12:44 ` [PATCH v2 08/16] ASoC: fsl-ssi: Cleanup probe function Markus Pargmann
2014-03-15 12:44 ` [PATCH v2 09/16] ASoC: fsl-ssi: Remove unnecessary variables from ssi_private Markus Pargmann
2014-03-15 12:44 ` [PATCH v2 10/16] ASoC: fsl-ssi: reorder and document fsl_ssi_private Markus Pargmann
2014-03-15 12:44 ` [PATCH v2 11/16] ASoC: fsl-ssi: Fix register values when disabling Markus Pargmann
2014-04-03 22:11   ` Mark Brown
2014-04-04  6:52     ` Markus Pargmann
2014-03-15 12:44 ` [PATCH v2 12/16] ASoC: fsl-ssi: Only enable baudclk when used Markus Pargmann
2014-03-15 12:44 ` [PATCH v2 13/16] ASoC: fsl-ssi: Set default dai-fmts Markus Pargmann
2014-03-15 12:44 ` [PATCH v2 14/16] ASoC: fsl-ssi: Transmit enable synchronization Markus Pargmann
2014-03-15 12:44 ` [PATCH v2 15/16] ASoC: fsl-ssi: Update binding documentation Markus Pargmann
2014-03-15 12:44 ` [PATCH v2 16/16] ASoC: fsl-ssi: Use regmap Markus Pargmann
2014-03-15 14:43   ` Alexander Shiyan
2014-03-18  8:10     ` Markus Pargmann
2014-03-20  6:07       ` Li.Xiubo at freescale.com
2014-03-20 15:10         ` Timur Tabi
2014-03-21  1:52           ` Li.Xiubo at freescale.com
2014-03-21  8:45           ` Markus Pargmann
2014-03-21  9:19             ` Li.Xiubo at freescale.com
2014-03-18 12:44 ` [PATCH v2 00/16] ASoC: fsl-ssi: Driver cleanup Mark Brown
2014-04-03 22:14 ` Mark Brown
2014-04-04  6:49   ` Markus Pargmann
2014-04-04  7:58     ` [alsa-devel] " Michael Trimarchi
2014-04-04 10:59       ` Markus Pargmann
2014-04-04 12:59         ` Michael Trimarchi
2014-04-04 10:03     ` Mark Brown
2014-04-04 10:51       ` Markus Pargmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1394887464-969-5-git-send-email-mpa@pengutronix.de \
    --to=mpa@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).