Skip to content

Commit f07eb22

Browse files
committed
dt/sound: Eliminate users of of_platform_{,un}register_driver
Get rid of users of of_platform_driver in drivers/sound. The of_platform_{,un}register_driver functions are going away, so the users need to be converted to using the platform_bus_type directly. Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
1 parent 18d306d commit f07eb22

8 files changed

Lines changed: 43 additions & 49 deletions

File tree

‎sound/soc/fsl/fsl_dma.c‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -896,8 +896,7 @@ static struct snd_pcm_ops fsl_dma_ops = {
896896
.pointer = fsl_dma_pointer,
897897
};
898898

899-
static int __devinit fsl_soc_dma_probe(struct platform_device *pdev,
900-
const struct of_device_id *match)
899+
static int __devinit fsl_soc_dma_probe(struct platform_device *pdev)
901900
{
902901
struct dma_object *dma;
903902
struct device_node *np = pdev->dev.of_node;
@@ -979,7 +978,7 @@ static const struct of_device_id fsl_soc_dma_ids[] = {
979978
};
980979
MODULE_DEVICE_TABLE(of, fsl_soc_dma_ids);
981980

982-
static struct of_platform_driver fsl_soc_dma_driver = {
981+
static struct platform_driver fsl_soc_dma_driver = {
983982
.driver = {
984983
.name = "fsl-pcm-audio",
985984
.owner = THIS_MODULE,
@@ -993,12 +992,12 @@ static int __init fsl_soc_dma_init(void)
993992
{
994993
pr_info("Freescale Elo DMA ASoC PCM Driver\n");
995994

996-
return of_register_platform_driver(&fsl_soc_dma_driver);
995+
return platform_driver_register(&fsl_soc_dma_driver);
997996
}
998997

999998
static void __exit fsl_soc_dma_exit(void)
1000999
{
1001-
of_unregister_platform_driver(&fsl_soc_dma_driver);
1000+
platform_driver_unregister(&fsl_soc_dma_driver);
10021001
}
10031002

10041003
module_init(fsl_soc_dma_init);

‎sound/soc/fsl/fsl_ssi.c‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -624,8 +624,7 @@ static void make_lowercase(char *s)
624624
}
625625
}
626626

627-
static int __devinit fsl_ssi_probe(struct platform_device *pdev,
628-
const struct of_device_id *match)
627+
static int __devinit fsl_ssi_probe(struct platform_device *pdev)
629628
{
630629
struct fsl_ssi_private *ssi_private;
631630
int ret = 0;
@@ -774,7 +773,7 @@ static const struct of_device_id fsl_ssi_ids[] = {
774773
};
775774
MODULE_DEVICE_TABLE(of, fsl_ssi_ids);
776775

777-
static struct of_platform_driver fsl_ssi_driver = {
776+
static struct platform_driver fsl_ssi_driver = {
778777
.driver = {
779778
.name = "fsl-ssi-dai",
780779
.owner = THIS_MODULE,
@@ -788,12 +787,12 @@ static int __init fsl_ssi_init(void)
788787
{
789788
printk(KERN_INFO "Freescale Synchronous Serial Interface (SSI) ASoC Driver\n");
790789

791-
return of_register_platform_driver(&fsl_ssi_driver);
790+
return platform_driver_register(&fsl_ssi_driver);
792791
}
793792

794793
static void __exit fsl_ssi_exit(void)
795794
{
796-
of_unregister_platform_driver(&fsl_ssi_driver);
795+
platform_driver_unregister(&fsl_ssi_driver);
797796
}
798797

799798
module_init(fsl_ssi_init);

‎sound/soc/fsl/mpc5200_dma.c‎

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -368,8 +368,7 @@ static struct snd_soc_platform_driver mpc5200_audio_dma_platform = {
368368
.pcm_free = &psc_dma_free,
369369
};
370370

371-
static int mpc5200_hpcd_probe(struct of_device *op,
372-
const struct of_device_id *match)
371+
static int mpc5200_hpcd_probe(struct of_device *op)
373372
{
374373
phys_addr_t fifo;
375374
struct psc_dma *psc_dma;
@@ -511,32 +510,31 @@ static int mpc5200_hpcd_remove(struct of_device *op)
511510
}
512511

513512
static struct of_device_id mpc5200_hpcd_match[] = {
514-
{
515-
.compatible = "fsl,mpc5200-pcm",
516-
},
513+
{ .compatible = "fsl,mpc5200-pcm", },
517514
{}
518515
};
519516
MODULE_DEVICE_TABLE(of, mpc5200_hpcd_match);
520517

521-
static struct of_platform_driver mpc5200_hpcd_of_driver = {
522-
.owner = THIS_MODULE,
523-
.name = "mpc5200-pcm-audio",
524-
.match_table = mpc5200_hpcd_match,
518+
static struct platform_driver mpc5200_hpcd_of_driver = {
525519
.probe = mpc5200_hpcd_probe,
526520
.remove = mpc5200_hpcd_remove,
521+
.dev = {
522+
.owner = THIS_MODULE,
523+
.name = "mpc5200-pcm-audio",
524+
.of_match_table = mpc5200_hpcd_match,
525+
}
527526
};
528527

529528
static int __init mpc5200_hpcd_init(void)
530529
{
531-
return of_register_platform_driver(&mpc5200_hpcd_of_driver);
530+
return platform_driver_register(&mpc5200_hpcd_of_driver);
532531
}
532+
module_init(mpc5200_hpcd_init);
533533

534534
static void __exit mpc5200_hpcd_exit(void)
535535
{
536-
of_unregister_platform_driver(&mpc5200_hpcd_of_driver);
536+
platform_driver_unregister(&mpc5200_hpcd_of_driver);
537537
}
538-
539-
module_init(mpc5200_hpcd_init);
540538
module_exit(mpc5200_hpcd_exit);
541539

542540
MODULE_AUTHOR("Grant Likely <grant.likely@secretlab.ca>");

‎sound/soc/fsl/mpc5200_psc_ac97.c‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,7 @@ static struct snd_soc_dai_driver psc_ac97_dai[] = {
272272
* - Probe/remove operations
273273
* - OF device match table
274274
*/
275-
static int __devinit psc_ac97_of_probe(struct platform_device *op,
276-
const struct of_device_id *match)
275+
static int __devinit psc_ac97_of_probe(struct platform_device *op)
277276
{
278277
int rc;
279278
struct snd_ac97 ac97;
@@ -316,7 +315,7 @@ static struct of_device_id psc_ac97_match[] __devinitdata = {
316315
};
317316
MODULE_DEVICE_TABLE(of, psc_ac97_match);
318317

319-
static struct of_platform_driver psc_ac97_driver = {
318+
static struct platform_driver psc_ac97_driver = {
320319
.probe = psc_ac97_of_probe,
321320
.remove = __devexit_p(psc_ac97_of_remove),
322321
.driver = {
@@ -332,13 +331,13 @@ static struct of_platform_driver psc_ac97_driver = {
332331
*/
333332
static int __init psc_ac97_init(void)
334333
{
335-
return of_register_platform_driver(&psc_ac97_driver);
334+
return platform_driver_register(&psc_ac97_driver);
336335
}
337336
module_init(psc_ac97_init);
338337

339338
static void __exit psc_ac97_exit(void)
340339
{
341-
of_unregister_platform_driver(&psc_ac97_driver);
340+
platform_driver_unregister(&psc_ac97_driver);
342341
}
343342
module_exit(psc_ac97_exit);
344343

‎sound/soc/fsl/mpc5200_psc_i2s.c‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,7 @@ static struct snd_soc_dai_driver psc_i2s_dai[] = {{
150150
* - Probe/remove operations
151151
* - OF device match table
152152
*/
153-
static int __devinit psc_i2s_of_probe(struct platform_device *op,
154-
const struct of_device_id *match)
153+
static int __devinit psc_i2s_of_probe(struct platform_device *op)
155154
{
156155
int rc;
157156
struct psc_dma *psc_dma;
@@ -213,7 +212,7 @@ static struct of_device_id psc_i2s_match[] __devinitdata = {
213212
};
214213
MODULE_DEVICE_TABLE(of, psc_i2s_match);
215214

216-
static struct of_platform_driver psc_i2s_driver = {
215+
static struct platform_driver psc_i2s_driver = {
217216
.probe = psc_i2s_of_probe,
218217
.remove = __devexit_p(psc_i2s_of_remove),
219218
.driver = {
@@ -229,13 +228,13 @@ static struct of_platform_driver psc_i2s_driver = {
229228
*/
230229
static int __init psc_i2s_init(void)
231230
{
232-
return of_register_platform_driver(&psc_i2s_driver);
231+
return platform_driver_register(&psc_i2s_driver);
233232
}
234233
module_init(psc_i2s_init);
235234

236235
static void __exit psc_i2s_exit(void)
237236
{
238-
of_unregister_platform_driver(&psc_i2s_driver);
237+
platform_driver_unregister(&psc_i2s_driver);
239238
}
240239
module_exit(psc_i2s_exit);
241240

‎sound/sparc/amd7930.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,7 +1002,7 @@ static int __devinit snd_amd7930_create(struct snd_card *card,
10021002
return 0;
10031003
}
10041004

1005-
static int __devinit amd7930_sbus_probe(struct platform_device *op, const struct of_device_id *match)
1005+
static int __devinit amd7930_sbus_probe(struct platform_device *op)
10061006
{
10071007
struct resource *rp = &op->resource[0];
10081008
static int dev_num;
@@ -1064,7 +1064,7 @@ static const struct of_device_id amd7930_match[] = {
10641064
{},
10651065
};
10661066

1067-
static struct of_platform_driver amd7930_sbus_driver = {
1067+
static struct platform_driver amd7930_sbus_driver = {
10681068
.driver = {
10691069
.name = "audio",
10701070
.owner = THIS_MODULE,
@@ -1075,7 +1075,7 @@ static struct of_platform_driver amd7930_sbus_driver = {
10751075

10761076
static int __init amd7930_init(void)
10771077
{
1078-
return of_register_platform_driver(&amd7930_sbus_driver);
1078+
return platform_driver_register(&amd7930_sbus_driver);
10791079
}
10801080

10811081
static void __exit amd7930_exit(void)
@@ -1092,7 +1092,7 @@ static void __exit amd7930_exit(void)
10921092

10931093
amd7930_list = NULL;
10941094

1095-
of_unregister_platform_driver(&amd7930_sbus_driver);
1095+
platform_driver_unregister(&amd7930_sbus_driver);
10961096
}
10971097

10981098
module_init(amd7930_init);

‎sound/sparc/cs4231.c‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1856,7 +1856,7 @@ static int __devinit snd_cs4231_sbus_create(struct snd_card *card,
18561856
return 0;
18571857
}
18581858

1859-
static int __devinit cs4231_sbus_probe(struct platform_device *op, const struct of_device_id *match)
1859+
static int __devinit cs4231_sbus_probe(struct platform_device *op)
18601860
{
18611861
struct resource *rp = &op->resource[0];
18621862
struct snd_card *card;
@@ -2048,7 +2048,7 @@ static int __devinit snd_cs4231_ebus_create(struct snd_card *card,
20482048
return 0;
20492049
}
20502050

2051-
static int __devinit cs4231_ebus_probe(struct platform_device *op, const struct of_device_id *match)
2051+
static int __devinit cs4231_ebus_probe(struct platform_device *op)
20522052
{
20532053
struct snd_card *card;
20542054
int err;
@@ -2072,16 +2072,16 @@ static int __devinit cs4231_ebus_probe(struct platform_device *op, const struct
20722072
}
20732073
#endif
20742074

2075-
static int __devinit cs4231_probe(struct platform_device *op, const struct of_device_id *match)
2075+
static int __devinit cs4231_probe(struct platform_device *op)
20762076
{
20772077
#ifdef EBUS_SUPPORT
20782078
if (!strcmp(op->dev.of_node->parent->name, "ebus"))
2079-
return cs4231_ebus_probe(op, match);
2079+
return cs4231_ebus_probe(op);
20802080
#endif
20812081
#ifdef SBUS_SUPPORT
20822082
if (!strcmp(op->dev.of_node->parent->name, "sbus") ||
20832083
!strcmp(op->dev.of_node->parent->name, "sbi"))
2084-
return cs4231_sbus_probe(op, match);
2084+
return cs4231_sbus_probe(op);
20852085
#endif
20862086
return -ENODEV;
20872087
}
@@ -2108,7 +2108,7 @@ static const struct of_device_id cs4231_match[] = {
21082108

21092109
MODULE_DEVICE_TABLE(of, cs4231_match);
21102110

2111-
static struct of_platform_driver cs4231_driver = {
2111+
static struct platform_driver cs4231_driver = {
21122112
.driver = {
21132113
.name = "audio",
21142114
.owner = THIS_MODULE,
@@ -2120,12 +2120,12 @@ static struct of_platform_driver cs4231_driver = {
21202120

21212121
static int __init cs4231_init(void)
21222122
{
2123-
return of_register_platform_driver(&cs4231_driver);
2123+
return platform_driver_register(&cs4231_driver);
21242124
}
21252125

21262126
static void __exit cs4231_exit(void)
21272127
{
2128-
of_unregister_platform_driver(&cs4231_driver);
2128+
platform_driver_unregister(&cs4231_driver);
21292129
}
21302130

21312131
module_init(cs4231_init);

‎sound/sparc/dbri.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2592,7 +2592,7 @@ static void snd_dbri_free(struct snd_dbri *dbri)
25922592
(void *)dbri->dma, dbri->dma_dvma);
25932593
}
25942594

2595-
static int __devinit dbri_probe(struct platform_device *op, const struct of_device_id *match)
2595+
static int __devinit dbri_probe(struct platform_device *op)
25962596
{
25972597
struct snd_dbri *dbri;
25982598
struct resource *rp;
@@ -2686,7 +2686,7 @@ static const struct of_device_id dbri_match[] = {
26862686

26872687
MODULE_DEVICE_TABLE(of, dbri_match);
26882688

2689-
static struct of_platform_driver dbri_sbus_driver = {
2689+
static struct platform_driver dbri_sbus_driver = {
26902690
.driver = {
26912691
.name = "dbri",
26922692
.owner = THIS_MODULE,
@@ -2699,12 +2699,12 @@ static struct of_platform_driver dbri_sbus_driver = {
26992699
/* Probe for the dbri chip and then attach the driver. */
27002700
static int __init dbri_init(void)
27012701
{
2702-
return of_register_platform_driver(&dbri_sbus_driver);
2702+
return platform_driver_register(&dbri_sbus_driver);
27032703
}
27042704

27052705
static void __exit dbri_exit(void)
27062706
{
2707-
of_unregister_platform_driver(&dbri_sbus_driver);
2707+
platform_driver_unregister(&dbri_sbus_driver);
27082708
}
27092709

27102710
module_init(dbri_init);

0 commit comments

Comments
 (0)