aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/hw_random/n2-drv.c
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2011-02-22 22:01:33 -0500
committerGrant Likely <grant.likely@secretlab.ca>2011-02-28 03:36:39 -0500
commit4ebb24f707187196937607c60810d42f7112d7aa (patch)
tree89a92b3f8dd55f3c5e0cfa73fa6446b3d490f3a8 /drivers/char/hw_random/n2-drv.c
parent000061245a6797d542854106463b6b20fbdcb12e (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.c16
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
622static int __devinit n2rng_probe(struct platform_device *op, 622static 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};
751MODULE_DEVICE_TABLE(of, n2rng_match); 753MODULE_DEVICE_TABLE(of, n2rng_match);
752 754
753static struct of_platform_driver n2rng_driver = { 755static 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
763static int __init n2rng_init(void) 765static 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
768static void __exit n2rng_exit(void) 770static void __exit n2rng_exit(void)
769{ 771{
770 of_unregister_platform_driver(&n2rng_driver); 772 platform_driver_unregister(&n2rng_driver);
771} 773}
772 774
773module_init(n2rng_init); 775module_init(n2rng_init);