diff options
author | Markus Pargmann <mpa@pengutronix.de> | 2014-04-28 06:54:44 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-05-20 18:02:31 -0400 |
commit | 2a1d102de40a799072309d4d84fa6f214c5ee999 (patch) | |
tree | 736a17efdb346b27ae46a21f694eb001759aafa6 | |
parent | f138e6212427d0ea6283e07b706823b657ddf14f (diff) |
ASoC: fsl-ssi: Use dev_name for DAI driver struct
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>
Tested-By: Michael Grzeschik <mgr@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r-- | sound/soc/fsl/fsl_ssi.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index 344f752e997d..65d9da190d0c 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c | |||
@@ -1027,17 +1027,13 @@ static int fsl_ssi_probe(struct platform_device *pdev) | |||
1027 | if (!strcmp(sprop, "ac97-slave")) | 1027 | if (!strcmp(sprop, "ac97-slave")) |
1028 | ac97 = true; | 1028 | ac97 = true; |
1029 | 1029 | ||
1030 | /* The DAI name is the last part of the full name of the node. */ | 1030 | ssi_private = devm_kzalloc(&pdev->dev, sizeof(*ssi_private), |
1031 | p = strrchr(np->full_name, '/') + 1; | 1031 | GFP_KERNEL); |
1032 | ssi_private = devm_kzalloc(&pdev->dev, sizeof(*ssi_private) + strlen(p), | ||
1033 | GFP_KERNEL); | ||
1034 | if (!ssi_private) { | 1032 | if (!ssi_private) { |
1035 | dev_err(&pdev->dev, "could not allocate DAI object\n"); | 1033 | dev_err(&pdev->dev, "could not allocate DAI object\n"); |
1036 | return -ENOMEM; | 1034 | return -ENOMEM; |
1037 | } | 1035 | } |
1038 | 1036 | ||
1039 | strcpy(ssi_private->name, p); | ||
1040 | |||
1041 | ssi_private->use_dma = !of_property_read_bool(np, | 1037 | ssi_private->use_dma = !of_property_read_bool(np, |
1042 | "fsl,fiq-stream-filter"); | 1038 | "fsl,fiq-stream-filter"); |
1043 | ssi_private->hw_type = hw_type; | 1039 | ssi_private->hw_type = hw_type; |
@@ -1055,7 +1051,7 @@ static int fsl_ssi_probe(struct platform_device *pdev) | |||
1055 | memcpy(&ssi_private->cpu_dai_drv, &fsl_ssi_dai_template, | 1051 | memcpy(&ssi_private->cpu_dai_drv, &fsl_ssi_dai_template, |
1056 | sizeof(fsl_ssi_dai_template)); | 1052 | sizeof(fsl_ssi_dai_template)); |
1057 | } | 1053 | } |
1058 | ssi_private->cpu_dai_drv.name = ssi_private->name; | 1054 | ssi_private->cpu_dai_drv.name = dev_name(&pdev->dev); |
1059 | 1055 | ||
1060 | /* Get the addresses and IRQ */ | 1056 | /* Get the addresses and IRQ */ |
1061 | ret = of_address_to_resource(np, 0, &res); | 1057 | ret = of_address_to_resource(np, 0, &res); |
@@ -1203,7 +1199,6 @@ static int fsl_ssi_probe(struct platform_device *pdev) | |||
1203 | * different writeable interrupt status registers. | 1199 | * different writeable interrupt status registers. |
1204 | */ | 1200 | */ |
1205 | if (ssi_private->use_dma) { | 1201 | if (ssi_private->use_dma) { |
1206 | /* The 'name' should not have any slashes in it. */ | ||
1207 | ret = devm_request_irq(&pdev->dev, ssi_private->irq, | 1202 | ret = devm_request_irq(&pdev->dev, ssi_private->irq, |
1208 | fsl_ssi_isr, 0, ssi_private->name, | 1203 | fsl_ssi_isr, 0, ssi_private->name, |
1209 | ssi_private); | 1204 | ssi_private); |