mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-06 08:46:46 +00:00
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>
This commit is contained in:
parent
f138e62124
commit
2a1d102de4
1 changed files with 3 additions and 8 deletions
|
@ -1027,17 +1027,13 @@ static int fsl_ssi_probe(struct platform_device *pdev)
|
||||||
if (!strcmp(sprop, "ac97-slave"))
|
if (!strcmp(sprop, "ac97-slave"))
|
||||||
ac97 = true;
|
ac97 = true;
|
||||||
|
|
||||||
/* The DAI name is the last part of the full name of the node. */
|
ssi_private = devm_kzalloc(&pdev->dev, sizeof(*ssi_private),
|
||||||
p = strrchr(np->full_name, '/') + 1;
|
GFP_KERNEL);
|
||||||
ssi_private = devm_kzalloc(&pdev->dev, sizeof(*ssi_private) + strlen(p),
|
|
||||||
GFP_KERNEL);
|
|
||||||
if (!ssi_private) {
|
if (!ssi_private) {
|
||||||
dev_err(&pdev->dev, "could not allocate DAI object\n");
|
dev_err(&pdev->dev, "could not allocate DAI object\n");
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy(ssi_private->name, p);
|
|
||||||
|
|
||||||
ssi_private->use_dma = !of_property_read_bool(np,
|
ssi_private->use_dma = !of_property_read_bool(np,
|
||||||
"fsl,fiq-stream-filter");
|
"fsl,fiq-stream-filter");
|
||||||
ssi_private->hw_type = hw_type;
|
ssi_private->hw_type = hw_type;
|
||||||
|
@ -1055,7 +1051,7 @@ static int fsl_ssi_probe(struct platform_device *pdev)
|
||||||
memcpy(&ssi_private->cpu_dai_drv, &fsl_ssi_dai_template,
|
memcpy(&ssi_private->cpu_dai_drv, &fsl_ssi_dai_template,
|
||||||
sizeof(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 */
|
/* Get the addresses and IRQ */
|
||||||
ret = of_address_to_resource(np, 0, &res);
|
ret = of_address_to_resource(np, 0, &res);
|
||||||
|
@ -1203,7 +1199,6 @@ static int fsl_ssi_probe(struct platform_device *pdev)
|
||||||
* different writeable interrupt status registers.
|
* different writeable interrupt status registers.
|
||||||
*/
|
*/
|
||||||
if (ssi_private->use_dma) {
|
if (ssi_private->use_dma) {
|
||||||
/* The 'name' should not have any slashes in it. */
|
|
||||||
ret = devm_request_irq(&pdev->dev, ssi_private->irq,
|
ret = devm_request_irq(&pdev->dev, ssi_private->irq,
|
||||||
fsl_ssi_isr, 0, ssi_private->name,
|
fsl_ssi_isr, 0, ssi_private->name,
|
||||||
ssi_private);
|
ssi_private);
|
||||||
|
|
Loading…
Reference in a new issue