diff options
author | Grant Likely <grant.likely@secretlab.ca> | 2011-02-22 22:01:33 -0500 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2011-02-28 03:36:39 -0500 |
commit | 4ebb24f707187196937607c60810d42f7112d7aa (patch) | |
tree | 89a92b3f8dd55f3c5e0cfa73fa6446b3d490f3a8 /drivers/char/hw_random/n2-drv.c | |
parent | 000061245a6797d542854106463b6b20fbdcb12e (diff) |
dt/sparc: Eliminate users of of_platform_{,un}register_driver
Get rid of old users of of_platform_driver in arch/sparc. Most
of_platform_driver users can be converted to use the platform_bus
directly.
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'drivers/char/hw_random/n2-drv.c')
-rw-r--r-- | drivers/char/hw_random/n2-drv.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/char/hw_random/n2-drv.c b/drivers/char/hw_random/n2-drv.c index a3f5e381e746..43ac61978d8b 100644 --- a/drivers/char/hw_random/n2-drv.c +++ b/drivers/char/hw_random/n2-drv.c | |||
@@ -619,15 +619,17 @@ static void __devinit n2rng_driver_version(void) | |||
619 | pr_info("%s", version); | 619 | pr_info("%s", version); |
620 | } | 620 | } |
621 | 621 | ||
622 | static int __devinit n2rng_probe(struct platform_device *op, | 622 | static int __devinit n2rng_probe(struct platform_device *op) |
623 | const struct of_device_id *match) | ||
624 | { | 623 | { |
625 | int victoria_falls = (match->data != NULL); | 624 | int victoria_falls; |
626 | int err = -ENOMEM; | 625 | int err = -ENOMEM; |
627 | struct n2rng *np; | 626 | struct n2rng *np; |
628 | 627 | ||
629 | n2rng_driver_version(); | 628 | if (!op->dev.of_match) |
629 | return -EINVAL; | ||
630 | victoria_falls = (op->dev.of_match->data != NULL); | ||
630 | 631 | ||
632 | n2rng_driver_version(); | ||
631 | np = kzalloc(sizeof(*np), GFP_KERNEL); | 633 | np = kzalloc(sizeof(*np), GFP_KERNEL); |
632 | if (!np) | 634 | if (!np) |
633 | goto out; | 635 | goto out; |
@@ -750,7 +752,7 @@ static const struct of_device_id n2rng_match[] = { | |||
750 | }; | 752 | }; |
751 | MODULE_DEVICE_TABLE(of, n2rng_match); | 753 | MODULE_DEVICE_TABLE(of, n2rng_match); |
752 | 754 | ||
753 | static struct of_platform_driver n2rng_driver = { | 755 | static struct platform_driver n2rng_driver = { |
754 | .driver = { | 756 | .driver = { |
755 | .name = "n2rng", | 757 | .name = "n2rng", |
756 | .owner = THIS_MODULE, | 758 | .owner = THIS_MODULE, |
@@ -762,12 +764,12 @@ static struct of_platform_driver n2rng_driver = { | |||
762 | 764 | ||
763 | static int __init n2rng_init(void) | 765 | static int __init n2rng_init(void) |
764 | { | 766 | { |
765 | return of_register_platform_driver(&n2rng_driver); | 767 | return platform_driver_register(&n2rng_driver); |
766 | } | 768 | } |
767 | 769 | ||
768 | static void __exit n2rng_exit(void) | 770 | static void __exit n2rng_exit(void) |
769 | { | 771 | { |
770 | of_unregister_platform_driver(&n2rng_driver); | 772 | platform_driver_unregister(&n2rng_driver); |
771 | } | 773 | } |
772 | 774 | ||
773 | module_init(n2rng_init); | 775 | module_init(n2rng_init); |