diff options
Diffstat (limited to 'drivers/serial/mpc52xx_uart.c')
-rw-r--r-- | drivers/serial/mpc52xx_uart.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c index 0585ab27ffde..b8727d9bf690 100644 --- a/drivers/serial/mpc52xx_uart.c +++ b/drivers/serial/mpc52xx_uart.c | |||
@@ -45,7 +45,7 @@ | |||
45 | */ | 45 | */ |
46 | 46 | ||
47 | #include <linux/config.h> | 47 | #include <linux/config.h> |
48 | #include <linux/device.h> | 48 | #include <linux/platform_device.h> |
49 | #include <linux/module.h> | 49 | #include <linux/module.h> |
50 | #include <linux/tty.h> | 50 | #include <linux/tty.h> |
51 | #include <linux/serial.h> | 51 | #include <linux/serial.h> |
@@ -717,16 +717,15 @@ static struct uart_driver mpc52xx_uart_driver = { | |||
717 | /* ======================================================================== */ | 717 | /* ======================================================================== */ |
718 | 718 | ||
719 | static int __devinit | 719 | static int __devinit |
720 | mpc52xx_uart_probe(struct device *dev) | 720 | mpc52xx_uart_probe(struct platform_device *dev) |
721 | { | 721 | { |
722 | struct platform_device *pdev = to_platform_device(dev); | 722 | struct resource *res = dev->resource; |
723 | struct resource *res = pdev->resource; | ||
724 | 723 | ||
725 | struct uart_port *port = NULL; | 724 | struct uart_port *port = NULL; |
726 | int i, idx, ret; | 725 | int i, idx, ret; |
727 | 726 | ||
728 | /* Check validity & presence */ | 727 | /* Check validity & presence */ |
729 | idx = pdev->id; | 728 | idx = dev->id; |
730 | if (idx < 0 || idx >= MPC52xx_PSC_MAXNUM) | 729 | if (idx < 0 || idx >= MPC52xx_PSC_MAXNUM) |
731 | return -EINVAL; | 730 | return -EINVAL; |
732 | 731 | ||
@@ -749,7 +748,7 @@ mpc52xx_uart_probe(struct device *dev) | |||
749 | port->ops = &mpc52xx_uart_ops; | 748 | port->ops = &mpc52xx_uart_ops; |
750 | 749 | ||
751 | /* Search for IRQ and mapbase */ | 750 | /* Search for IRQ and mapbase */ |
752 | for (i=0 ; i<pdev->num_resources ; i++, res++) { | 751 | for (i=0 ; i<dev->num_resources ; i++, res++) { |
753 | if (res->flags & IORESOURCE_MEM) | 752 | if (res->flags & IORESOURCE_MEM) |
754 | port->mapbase = res->start; | 753 | port->mapbase = res->start; |
755 | else if (res->flags & IORESOURCE_IRQ) | 754 | else if (res->flags & IORESOURCE_IRQ) |
@@ -761,17 +760,17 @@ mpc52xx_uart_probe(struct device *dev) | |||
761 | /* Add the port to the uart sub-system */ | 760 | /* Add the port to the uart sub-system */ |
762 | ret = uart_add_one_port(&mpc52xx_uart_driver, port); | 761 | ret = uart_add_one_port(&mpc52xx_uart_driver, port); |
763 | if (!ret) | 762 | if (!ret) |
764 | dev_set_drvdata(dev, (void*)port); | 763 | platform_set_drvdata(dev, (void*)port); |
765 | 764 | ||
766 | return ret; | 765 | return ret; |
767 | } | 766 | } |
768 | 767 | ||
769 | static int | 768 | static int |
770 | mpc52xx_uart_remove(struct device *dev) | 769 | mpc52xx_uart_remove(struct platform_device *dev) |
771 | { | 770 | { |
772 | struct uart_port *port = (struct uart_port *) dev_get_drvdata(dev); | 771 | struct uart_port *port = (struct uart_port *) platform_get_drvdata(dev); |
773 | 772 | ||
774 | dev_set_drvdata(dev, NULL); | 773 | platform_set_drvdata(dev, NULL); |
775 | 774 | ||
776 | if (port) | 775 | if (port) |
777 | uart_remove_one_port(&mpc52xx_uart_driver, port); | 776 | uart_remove_one_port(&mpc52xx_uart_driver, port); |
@@ -781,37 +780,38 @@ mpc52xx_uart_remove(struct device *dev) | |||
781 | 780 | ||
782 | #ifdef CONFIG_PM | 781 | #ifdef CONFIG_PM |
783 | static int | 782 | static int |
784 | mpc52xx_uart_suspend(struct device *dev, pm_message_t state, u32 level) | 783 | mpc52xx_uart_suspend(struct platform_device *dev, pm_message_t state) |
785 | { | 784 | { |
786 | struct uart_port *port = (struct uart_port *) dev_get_drvdata(dev); | 785 | struct uart_port *port = (struct uart_port *) platform_get_drvdata(dev); |
787 | 786 | ||
788 | if (sport && level == SUSPEND_DISABLE) | 787 | if (sport) |
789 | uart_suspend_port(&mpc52xx_uart_driver, port); | 788 | uart_suspend_port(&mpc52xx_uart_driver, port); |
790 | 789 | ||
791 | return 0; | 790 | return 0; |
792 | } | 791 | } |
793 | 792 | ||
794 | static int | 793 | static int |
795 | mpc52xx_uart_resume(struct device *dev, u32 level) | 794 | mpc52xx_uart_resume(struct platform_device *dev) |
796 | { | 795 | { |
797 | struct uart_port *port = (struct uart_port *) dev_get_drvdata(dev); | 796 | struct uart_port *port = (struct uart_port *) platform_get_drvdata(dev); |
798 | 797 | ||
799 | if (port && level == RESUME_ENABLE) | 798 | if (port) |
800 | uart_resume_port(&mpc52xx_uart_driver, port); | 799 | uart_resume_port(&mpc52xx_uart_driver, port); |
801 | 800 | ||
802 | return 0; | 801 | return 0; |
803 | } | 802 | } |
804 | #endif | 803 | #endif |
805 | 804 | ||
806 | static struct device_driver mpc52xx_uart_platform_driver = { | 805 | static struct platform_driver mpc52xx_uart_platform_driver = { |
807 | .name = "mpc52xx-psc", | ||
808 | .bus = &platform_bus_type, | ||
809 | .probe = mpc52xx_uart_probe, | 806 | .probe = mpc52xx_uart_probe, |
810 | .remove = mpc52xx_uart_remove, | 807 | .remove = mpc52xx_uart_remove, |
811 | #ifdef CONFIG_PM | 808 | #ifdef CONFIG_PM |
812 | .suspend = mpc52xx_uart_suspend, | 809 | .suspend = mpc52xx_uart_suspend, |
813 | .resume = mpc52xx_uart_resume, | 810 | .resume = mpc52xx_uart_resume, |
814 | #endif | 811 | #endif |
812 | .driver = { | ||
813 | .name = "mpc52xx-psc", | ||
814 | }, | ||
815 | }; | 815 | }; |
816 | 816 | ||
817 | 817 | ||
@@ -828,7 +828,7 @@ mpc52xx_uart_init(void) | |||
828 | 828 | ||
829 | ret = uart_register_driver(&mpc52xx_uart_driver); | 829 | ret = uart_register_driver(&mpc52xx_uart_driver); |
830 | if (ret == 0) { | 830 | if (ret == 0) { |
831 | ret = driver_register(&mpc52xx_uart_platform_driver); | 831 | ret = platform_driver_register(&mpc52xx_uart_platform_driver); |
832 | if (ret) | 832 | if (ret) |
833 | uart_unregister_driver(&mpc52xx_uart_driver); | 833 | uart_unregister_driver(&mpc52xx_uart_driver); |
834 | } | 834 | } |
@@ -839,7 +839,7 @@ mpc52xx_uart_init(void) | |||
839 | static void __exit | 839 | static void __exit |
840 | mpc52xx_uart_exit(void) | 840 | mpc52xx_uart_exit(void) |
841 | { | 841 | { |
842 | driver_unregister(&mpc52xx_uart_platform_driver); | 842 | platform_driver_unregister(&mpc52xx_uart_platform_driver); |
843 | uart_unregister_driver(&mpc52xx_uart_driver); | 843 | uart_unregister_driver(&mpc52xx_uart_driver); |
844 | } | 844 | } |
845 | 845 | ||