diff options
Diffstat (limited to 'drivers/char/hw_random/n2-drv.c')
-rw-r--r-- | drivers/char/hw_random/n2-drv.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/drivers/char/hw_random/n2-drv.c b/drivers/char/hw_random/n2-drv.c index a3f5e381e746..ac6739e085e3 100644 --- a/drivers/char/hw_random/n2-drv.c +++ b/drivers/char/hw_random/n2-drv.c | |||
@@ -619,15 +619,20 @@ 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 const struct of_device_id n2rng_match[]; |
623 | const struct of_device_id *match) | 623 | static int __devinit n2rng_probe(struct platform_device *op) |
624 | { | 624 | { |
625 | int victoria_falls = (match->data != NULL); | 625 | const struct of_device_id *match; |
626 | int victoria_falls; | ||
626 | int err = -ENOMEM; | 627 | int err = -ENOMEM; |
627 | struct n2rng *np; | 628 | struct n2rng *np; |
628 | 629 | ||
629 | n2rng_driver_version(); | 630 | match = of_match_device(n2rng_match, &op->dev); |
631 | if (!match) | ||
632 | return -EINVAL; | ||
633 | victoria_falls = (match->data != NULL); | ||
630 | 634 | ||
635 | n2rng_driver_version(); | ||
631 | np = kzalloc(sizeof(*np), GFP_KERNEL); | 636 | np = kzalloc(sizeof(*np), GFP_KERNEL); |
632 | if (!np) | 637 | if (!np) |
633 | goto out; | 638 | goto out; |
@@ -750,7 +755,7 @@ static const struct of_device_id n2rng_match[] = { | |||
750 | }; | 755 | }; |
751 | MODULE_DEVICE_TABLE(of, n2rng_match); | 756 | MODULE_DEVICE_TABLE(of, n2rng_match); |
752 | 757 | ||
753 | static struct of_platform_driver n2rng_driver = { | 758 | static struct platform_driver n2rng_driver = { |
754 | .driver = { | 759 | .driver = { |
755 | .name = "n2rng", | 760 | .name = "n2rng", |
756 | .owner = THIS_MODULE, | 761 | .owner = THIS_MODULE, |
@@ -762,12 +767,12 @@ static struct of_platform_driver n2rng_driver = { | |||
762 | 767 | ||
763 | static int __init n2rng_init(void) | 768 | static int __init n2rng_init(void) |
764 | { | 769 | { |
765 | return of_register_platform_driver(&n2rng_driver); | 770 | return platform_driver_register(&n2rng_driver); |
766 | } | 771 | } |
767 | 772 | ||
768 | static void __exit n2rng_exit(void) | 773 | static void __exit n2rng_exit(void) |
769 | { | 774 | { |
770 | of_unregister_platform_driver(&n2rng_driver); | 775 | platform_driver_unregister(&n2rng_driver); |
771 | } | 776 | } |
772 | 777 | ||
773 | module_init(n2rng_init); | 778 | module_init(n2rng_init); |