diff options
177 files changed, 3345 insertions, 2243 deletions
diff --git a/arch/arm/common/locomo.c b/arch/arm/common/locomo.c index ad55680726ed..557e52c1c869 100644 --- a/arch/arm/common/locomo.c +++ b/arch/arm/common/locomo.c | |||
| @@ -550,9 +550,9 @@ struct locomo_save_data { | |||
| 550 | u16 LCM_SPIMD; | 550 | u16 LCM_SPIMD; |
| 551 | }; | 551 | }; |
| 552 | 552 | ||
| 553 | static int locomo_suspend(struct device *dev, pm_message_t state) | 553 | static int locomo_suspend(struct platform_device *dev, pm_message_t state) |
| 554 | { | 554 | { |
| 555 | struct locomo *lchip = dev_get_drvdata(dev); | 555 | struct locomo *lchip = platform_get_drvdata(dev); |
| 556 | struct locomo_save_data *save; | 556 | struct locomo_save_data *save; |
| 557 | unsigned long flags; | 557 | unsigned long flags; |
| 558 | 558 | ||
| @@ -560,7 +560,7 @@ static int locomo_suspend(struct device *dev, pm_message_t state) | |||
| 560 | if (!save) | 560 | if (!save) |
| 561 | return -ENOMEM; | 561 | return -ENOMEM; |
| 562 | 562 | ||
| 563 | dev->power.saved_state = (void *) save; | 563 | dev->dev.power.saved_state = (void *) save; |
| 564 | 564 | ||
| 565 | spin_lock_irqsave(&lchip->lock, flags); | 565 | spin_lock_irqsave(&lchip->lock, flags); |
| 566 | 566 | ||
| @@ -594,14 +594,14 @@ static int locomo_suspend(struct device *dev, pm_message_t state) | |||
| 594 | return 0; | 594 | return 0; |
| 595 | } | 595 | } |
| 596 | 596 | ||
| 597 | static int locomo_resume(struct device *dev) | 597 | static int locomo_resume(struct platform_device *dev) |
| 598 | { | 598 | { |
| 599 | struct locomo *lchip = dev_get_drvdata(dev); | 599 | struct locomo *lchip = platform_get_drvdata(dev); |
| 600 | struct locomo_save_data *save; | 600 | struct locomo_save_data *save; |
| 601 | unsigned long r; | 601 | unsigned long r; |
| 602 | unsigned long flags; | 602 | unsigned long flags; |
| 603 | 603 | ||
| 604 | save = (struct locomo_save_data *) dev->power.saved_state; | 604 | save = (struct locomo_save_data *) dev->dev.power.saved_state; |
| 605 | if (!save) | 605 | if (!save) |
| 606 | return 0; | 606 | return 0; |
| 607 | 607 | ||
| @@ -760,27 +760,26 @@ static void __locomo_remove(struct locomo *lchip) | |||
| 760 | kfree(lchip); | 760 | kfree(lchip); |
| 761 | } | 761 | } |
| 762 | 762 | ||
| 763 | static int locomo_probe(struct device *dev) | 763 | static int locomo_probe(struct platform_device *dev) |
| 764 | { | 764 | { |
| 765 | struct platform_device *pdev = to_platform_device(dev); | ||
| 766 | struct resource *mem; | 765 | struct resource *mem; |
| 767 | int irq; | 766 | int irq; |
| 768 | 767 | ||
| 769 | mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 768 | mem = platform_get_resource(dev, IORESOURCE_MEM, 0); |
| 770 | if (!mem) | 769 | if (!mem) |
| 771 | return -EINVAL; | 770 | return -EINVAL; |
| 772 | irq = platform_get_irq(pdev, 0); | 771 | irq = platform_get_irq(dev, 0); |
| 773 | 772 | ||
| 774 | return __locomo_probe(dev, mem, irq); | 773 | return __locomo_probe(&dev->dev, mem, irq); |
| 775 | } | 774 | } |
| 776 | 775 | ||
| 777 | static int locomo_remove(struct device *dev) | 776 | static int locomo_remove(struct platform_device *dev) |
| 778 | { | 777 | { |
| 779 | struct locomo *lchip = dev_get_drvdata(dev); | 778 | struct locomo *lchip = platform__get_drvdata(dev); |
| 780 | 779 | ||
| 781 | if (lchip) { | 780 | if (lchip) { |
| 782 | __locomo_remove(lchip); | 781 | __locomo_remove(lchip); |
| 783 | dev_set_drvdata(dev, NULL); | 782 | platform_set_drvdata(dev, NULL); |
| 784 | } | 783 | } |
| 785 | 784 | ||
| 786 | return 0; | 785 | return 0; |
| @@ -792,15 +791,16 @@ static int locomo_remove(struct device *dev) | |||
| 792 | * the per-machine level, and then have this driver pick | 791 | * the per-machine level, and then have this driver pick |
| 793 | * up the registered devices. | 792 | * up the registered devices. |
| 794 | */ | 793 | */ |
| 795 | static struct device_driver locomo_device_driver = { | 794 | static struct platform_driver locomo_device_driver = { |
| 796 | .name = "locomo", | ||
| 797 | .bus = &platform_bus_type, | ||
| 798 | .probe = locomo_probe, | 795 | .probe = locomo_probe, |
| 799 | .remove = locomo_remove, | 796 | .remove = locomo_remove, |
| 800 | #ifdef CONFIG_PM | 797 | #ifdef CONFIG_PM |
| 801 | .suspend = locomo_suspend, | 798 | .suspend = locomo_suspend, |
| 802 | .resume = locomo_resume, | 799 | .resume = locomo_resume, |
| 803 | #endif | 800 | #endif |
| 801 | .driver = { | ||
| 802 | .name = "locomo", | ||
| 803 | }, | ||
| 804 | }; | 804 | }; |
| 805 | 805 | ||
| 806 | /* | 806 | /* |
| @@ -1126,13 +1126,13 @@ static int __init locomo_init(void) | |||
| 1126 | { | 1126 | { |
| 1127 | int ret = bus_register(&locomo_bus_type); | 1127 | int ret = bus_register(&locomo_bus_type); |
| 1128 | if (ret == 0) | 1128 | if (ret == 0) |
| 1129 | driver_register(&locomo_device_driver); | 1129 | platform_driver_register(&locomo_device_driver); |
| 1130 | return ret; | 1130 | return ret; |
| 1131 | } | 1131 | } |
| 1132 | 1132 | ||
| 1133 | static void __exit locomo_exit(void) | 1133 | static void __exit locomo_exit(void) |
| 1134 | { | 1134 | { |
| 1135 | driver_unregister(&locomo_device_driver); | 1135 | platform_driver_unregister(&locomo_device_driver); |
| 1136 | bus_unregister(&locomo_bus_type); | 1136 | bus_unregister(&locomo_bus_type); |
| 1137 | } | 1137 | } |
| 1138 | 1138 | ||
diff --git a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c index 174aa86ee816..7b07acb03f3b 100644 --- a/arch/arm/common/sa1111.c +++ b/arch/arm/common/sa1111.c | |||
| @@ -801,9 +801,9 @@ struct sa1111_save_data { | |||
| 801 | 801 | ||
| 802 | #ifdef CONFIG_PM | 802 | #ifdef CONFIG_PM |
| 803 | 803 | ||
| 804 | static int sa1111_suspend(struct device *dev, pm_message_t state) | 804 | static int sa1111_suspend(struct platform_device *dev, pm_message_t state) |
| 805 | { | 805 | { |
| 806 | struct sa1111 *sachip = dev_get_drvdata(dev); | 806 | struct sa1111 *sachip = platform_get_drvdata(dev); |
| 807 | struct sa1111_save_data *save; | 807 | struct sa1111_save_data *save; |
| 808 | unsigned long flags; | 808 | unsigned long flags; |
| 809 | unsigned int val; | 809 | unsigned int val; |
| @@ -812,7 +812,7 @@ static int sa1111_suspend(struct device *dev, pm_message_t state) | |||
| 812 | save = kmalloc(sizeof(struct sa1111_save_data), GFP_KERNEL); | 812 | save = kmalloc(sizeof(struct sa1111_save_data), GFP_KERNEL); |
| 813 | if (!save) | 813 | if (!save) |
| 814 | return -ENOMEM; | 814 | return -ENOMEM; |
| 815 | dev->power.saved_state = save; | 815 | dev->dev.power.saved_state = save; |
| 816 | 816 | ||
| 817 | spin_lock_irqsave(&sachip->lock, flags); | 817 | spin_lock_irqsave(&sachip->lock, flags); |
| 818 | 818 | ||
| @@ -859,14 +859,14 @@ static int sa1111_suspend(struct device *dev, pm_message_t state) | |||
| 859 | * restored by their respective drivers, and must be called | 859 | * restored by their respective drivers, and must be called |
| 860 | * via LDM after this function. | 860 | * via LDM after this function. |
| 861 | */ | 861 | */ |
| 862 | static int sa1111_resume(struct device *dev) | 862 | static int sa1111_resume(struct platform_device *dev) |
| 863 | { | 863 | { |
| 864 | struct sa1111 *sachip = dev_get_drvdata(dev); | 864 | struct sa1111 *sachip = platform_get_drvdata(dev); |
| 865 | struct sa1111_save_data *save; | 865 | struct sa1111_save_data *save; |
| 866 | unsigned long flags, id; | 866 | unsigned long flags, id; |
| 867 | void __iomem *base; | 867 | void __iomem *base; |
| 868 | 868 | ||
| 869 | save = (struct sa1111_save_data *)dev->power.saved_state; | 869 | save = (struct sa1111_save_data *)dev->dev.power.saved_state; |
| 870 | if (!save) | 870 | if (!save) |
| 871 | return 0; | 871 | return 0; |
| 872 | 872 | ||
| @@ -879,7 +879,7 @@ static int sa1111_resume(struct device *dev) | |||
| 879 | id = sa1111_readl(sachip->base + SA1111_SKID); | 879 | id = sa1111_readl(sachip->base + SA1111_SKID); |
| 880 | if ((id & SKID_ID_MASK) != SKID_SA1111_ID) { | 880 | if ((id & SKID_ID_MASK) != SKID_SA1111_ID) { |
| 881 | __sa1111_remove(sachip); | 881 | __sa1111_remove(sachip); |
| 882 | dev_set_drvdata(dev, NULL); | 882 | platform_set_drvdata(dev, NULL); |
| 883 | kfree(save); | 883 | kfree(save); |
| 884 | return 0; | 884 | return 0; |
| 885 | } | 885 | } |
| @@ -911,7 +911,7 @@ static int sa1111_resume(struct device *dev) | |||
| 911 | 911 | ||
| 912 | spin_unlock_irqrestore(&sachip->lock, flags); | 912 | spin_unlock_irqrestore(&sachip->lock, flags); |
| 913 | 913 | ||
| 914 | dev->power.saved_state = NULL; | 914 | dev->dev.power.saved_state = NULL; |
| 915 | kfree(save); | 915 | kfree(save); |
| 916 | 916 | ||
| 917 | return 0; | 917 | return 0; |
| @@ -922,9 +922,8 @@ static int sa1111_resume(struct device *dev) | |||
| 922 | #define sa1111_resume NULL | 922 | #define sa1111_resume NULL |
| 923 | #endif | 923 | #endif |
| 924 | 924 | ||
| 925 | static int sa1111_probe(struct device *dev) | 925 | static int sa1111_probe(struct platform_device *pdev) |
| 926 | { | 926 | { |
| 927 | struct platform_device *pdev = to_platform_device(dev); | ||
| 928 | struct resource *mem; | 927 | struct resource *mem; |
| 929 | int irq; | 928 | int irq; |
| 930 | 929 | ||
| @@ -933,20 +932,20 @@ static int sa1111_probe(struct device *dev) | |||
| 933 | return -EINVAL; | 932 | return -EINVAL; |
| 934 | irq = platform_get_irq(pdev, 0); | 933 | irq = platform_get_irq(pdev, 0); |
| 935 | 934 | ||
| 936 | return __sa1111_probe(dev, mem, irq); | 935 | return __sa1111_probe(&pdev->dev, mem, irq); |
| 937 | } | 936 | } |
| 938 | 937 | ||
| 939 | static int sa1111_remove(struct device *dev) | 938 | static int sa1111_remove(struct platform_device *pdev) |
| 940 | { | 939 | { |
| 941 | struct sa1111 *sachip = dev_get_drvdata(dev); | 940 | struct sa1111 *sachip = platform_get_drvdata(pdev); |
| 942 | 941 | ||
| 943 | if (sachip) { | 942 | if (sachip) { |
| 944 | __sa1111_remove(sachip); | 943 | __sa1111_remove(sachip); |
| 945 | dev_set_drvdata(dev, NULL); | 944 | platform_set_drvdata(pdev, NULL); |
| 946 | 945 | ||
| 947 | #ifdef CONFIG_PM | 946 | #ifdef CONFIG_PM |
| 948 | kfree(dev->power.saved_state); | 947 | kfree(pdev->dev.power.saved_state); |
| 949 | dev->power.saved_state = NULL; | 948 | pdev->dev.power.saved_state = NULL; |
| 950 | #endif | 949 | #endif |
| 951 | } | 950 | } |
| 952 | 951 | ||
| @@ -962,13 +961,14 @@ static int sa1111_remove(struct device *dev) | |||
| 962 | * We also need to handle the SDRAM configuration for | 961 | * We also need to handle the SDRAM configuration for |
| 963 | * PXA250/SA1110 machine classes. | 962 | * PXA250/SA1110 machine classes. |
| 964 | */ | 963 | */ |
| 965 | static struct device_driver sa1111_device_driver = { | 964 | static struct platform_driver sa1111_device_driver = { |
| 966 | .name = "sa1111", | ||
| 967 | .bus = &platform_bus_type, | ||
| 968 | .probe = sa1111_probe, | 965 | .probe = sa1111_probe, |
| 969 | .remove = sa1111_remove, | 966 | .remove = sa1111_remove, |
| 970 | .suspend = sa1111_suspend, | 967 | .suspend = sa1111_suspend, |
| 971 | .resume = sa1111_resume, | 968 | .resume = sa1111_resume, |
| 969 | .driver = { | ||
| 970 | .name = "sa1111", | ||
| 971 | }, | ||
| 972 | }; | 972 | }; |
| 973 | 973 | ||
| 974 | /* | 974 | /* |
| @@ -1256,13 +1256,13 @@ static int __init sa1111_init(void) | |||
| 1256 | { | 1256 | { |
| 1257 | int ret = bus_register(&sa1111_bus_type); | 1257 | int ret = bus_register(&sa1111_bus_type); |
| 1258 | if (ret == 0) | 1258 | if (ret == 0) |
| 1259 | driver_register(&sa1111_device_driver); | 1259 | platform_driver_register(&sa1111_device_driver); |
| 1260 | return ret; | 1260 | return ret; |
| 1261 | } | 1261 | } |
| 1262 | 1262 | ||
| 1263 | static void __exit sa1111_exit(void) | 1263 | static void __exit sa1111_exit(void) |
| 1264 | { | 1264 | { |
| 1265 | driver_unregister(&sa1111_device_driver); | 1265 | platform_driver_unregister(&sa1111_device_driver); |
| 1266 | bus_unregister(&sa1111_bus_type); | 1266 | bus_unregister(&sa1111_bus_type); |
| 1267 | } | 1267 | } |
| 1268 | 1268 | ||
diff --git a/arch/arm/common/scoop.c b/arch/arm/common/scoop.c index c7fdf390cef9..32924c6714fe 100644 --- a/arch/arm/common/scoop.c +++ b/arch/arm/common/scoop.c | |||
| @@ -98,9 +98,9 @@ static void check_scoop_reg(struct scoop_dev *sdev) | |||
| 98 | } | 98 | } |
| 99 | 99 | ||
| 100 | #ifdef CONFIG_PM | 100 | #ifdef CONFIG_PM |
| 101 | static int scoop_suspend(struct device *dev, pm_message_t state) | 101 | static int scoop_suspend(struct platform_device *dev, pm_message_t state) |
| 102 | { | 102 | { |
| 103 | struct scoop_dev *sdev = dev_get_drvdata(dev); | 103 | struct scoop_dev *sdev = platform_get_drvdata(dev); |
| 104 | 104 | ||
| 105 | check_scoop_reg(sdev); | 105 | check_scoop_reg(sdev); |
| 106 | sdev->scoop_gpwr = SCOOP_REG(sdev->base, SCOOP_GPWR); | 106 | sdev->scoop_gpwr = SCOOP_REG(sdev->base, SCOOP_GPWR); |
| @@ -109,9 +109,9 @@ static int scoop_suspend(struct device *dev, pm_message_t state) | |||
| 109 | return 0; | 109 | return 0; |
| 110 | } | 110 | } |
| 111 | 111 | ||
| 112 | static int scoop_resume(struct device *dev) | 112 | static int scoop_resume(struct platform_device *dev) |
| 113 | { | 113 | { |
| 114 | struct scoop_dev *sdev = dev_get_drvdata(dev); | 114 | struct scoop_dev *sdev = platform_get_drvdata(dev); |
| 115 | 115 | ||
| 116 | check_scoop_reg(sdev); | 116 | check_scoop_reg(sdev); |
| 117 | SCOOP_REG(sdev->base,SCOOP_GPWR) = sdev->scoop_gpwr; | 117 | SCOOP_REG(sdev->base,SCOOP_GPWR) = sdev->scoop_gpwr; |
| @@ -123,11 +123,10 @@ static int scoop_resume(struct device *dev) | |||
| 123 | #define scoop_resume NULL | 123 | #define scoop_resume NULL |
| 124 | #endif | 124 | #endif |
| 125 | 125 | ||
| 126 | int __init scoop_probe(struct device *dev) | 126 | int __init scoop_probe(struct platform_device *pdev) |
| 127 | { | 127 | { |
| 128 | struct scoop_dev *devptr; | 128 | struct scoop_dev *devptr; |
| 129 | struct scoop_config *inf; | 129 | struct scoop_config *inf; |
| 130 | struct platform_device *pdev = to_platform_device(dev); | ||
| 131 | struct resource *mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 130 | struct resource *mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
| 132 | 131 | ||
| 133 | if (!mem) | 132 | if (!mem) |
| @@ -141,7 +140,7 @@ int __init scoop_probe(struct device *dev) | |||
| 141 | memset(devptr, 0, sizeof(struct scoop_dev)); | 140 | memset(devptr, 0, sizeof(struct scoop_dev)); |
| 142 | spin_lock_init(&devptr->scoop_lock); | 141 | spin_lock_init(&devptr->scoop_lock); |
| 143 | 142 | ||
| 144 | inf = dev->platform_data; | 143 | inf = pdev->dev.platform_data; |
| 145 | devptr->base = ioremap(mem->start, mem->end - mem->start + 1); | 144 | devptr->base = ioremap(mem->start, mem->end - mem->start + 1); |
| 146 | 145 | ||
| 147 | if (!devptr->base) { | 146 | if (!devptr->base) { |
| @@ -149,7 +148,7 @@ int __init scoop_probe(struct device *dev) | |||
| 149 | return -ENOMEM; | 148 | return -ENOMEM; |
| 150 | } | 149 | } |
| 151 | 150 | ||
| 152 | dev_set_drvdata(dev, devptr); | 151 | platform_set_drvdata(pdev, devptr); |
| 153 | 152 | ||
| 154 | printk("Sharp Scoop Device found at 0x%08x -> 0x%08x\n",(unsigned int)mem->start,(unsigned int)devptr->base); | 153 | printk("Sharp Scoop Device found at 0x%08x -> 0x%08x\n",(unsigned int)mem->start,(unsigned int)devptr->base); |
| 155 | 154 | ||
| @@ -164,29 +163,30 @@ int __init scoop_probe(struct device *dev) | |||
| 164 | return 0; | 163 | return 0; |
| 165 | } | 164 | } |
| 166 | 165 | ||
| 167 | static int scoop_remove(struct device *dev) | 166 | static int scoop_remove(struct platform_device *pdev) |
| 168 | { | 167 | { |
| 169 | struct scoop_dev *sdev = dev_get_drvdata(dev); | 168 | struct scoop_dev *sdev = platform_get_drvdata(pdev); |
| 170 | if (sdev) { | 169 | if (sdev) { |
| 171 | iounmap(sdev->base); | 170 | iounmap(sdev->base); |
| 172 | kfree(sdev); | 171 | kfree(sdev); |
| 173 | dev_set_drvdata(dev, NULL); | 172 | platform_set_drvdata(pdev, NULL); |
| 174 | } | 173 | } |
| 175 | return 0; | 174 | return 0; |
| 176 | } | 175 | } |
| 177 | 176 | ||
| 178 | static struct device_driver scoop_driver = { | 177 | static struct platform_driver scoop_driver = { |
| 179 | .name = "sharp-scoop", | ||
| 180 | .bus = &platform_bus_type, | ||
| 181 | .probe = scoop_probe, | 178 | .probe = scoop_probe, |
| 182 | .remove = scoop_remove, | 179 | .remove = scoop_remove, |
| 183 | .suspend = scoop_suspend, | 180 | .suspend = scoop_suspend, |
| 184 | .resume = scoop_resume, | 181 | .resume = scoop_resume, |
| 182 | .driver = { | ||
| 183 | .name = "sharp-scoop", | ||
| 184 | }, | ||
| 185 | }; | 185 | }; |
| 186 | 186 | ||
| 187 | int __init scoop_init(void) | 187 | int __init scoop_init(void) |
| 188 | { | 188 | { |
| 189 | return driver_register(&scoop_driver); | 189 | return platform_driver_register(&scoop_driver); |
| 190 | } | 190 | } |
| 191 | 191 | ||
| 192 | subsys_initcall(scoop_init); | 192 | subsys_initcall(scoop_init); |
diff --git a/arch/arm/mach-pxa/corgi_ssp.c b/arch/arm/mach-pxa/corgi_ssp.c index bdf10cfa9440..b371d723635f 100644 --- a/arch/arm/mach-pxa/corgi_ssp.c +++ b/arch/arm/mach-pxa/corgi_ssp.c | |||
| @@ -191,7 +191,7 @@ void __init corgi_ssp_set_machinfo(struct corgissp_machinfo *machinfo) | |||
| 191 | ssp_machinfo = machinfo; | 191 | ssp_machinfo = machinfo; |
| 192 | } | 192 | } |
| 193 | 193 | ||
| 194 | static int __init corgi_ssp_probe(struct device *dev) | 194 | static int __init corgi_ssp_probe(struct platform_device *dev) |
| 195 | { | 195 | { |
| 196 | int ret; | 196 | int ret; |
| 197 | 197 | ||
| @@ -216,13 +216,13 @@ static int __init corgi_ssp_probe(struct device *dev) | |||
| 216 | return ret; | 216 | return ret; |
| 217 | } | 217 | } |
| 218 | 218 | ||
| 219 | static int corgi_ssp_remove(struct device *dev) | 219 | static int corgi_ssp_remove(struct platform_device *dev) |
| 220 | { | 220 | { |
| 221 | ssp_exit(&corgi_ssp_dev); | 221 | ssp_exit(&corgi_ssp_dev); |
| 222 | return 0; | 222 | return 0; |
| 223 | } | 223 | } |
| 224 | 224 | ||
| 225 | static int corgi_ssp_suspend(struct device *dev, pm_message_t state) | 225 | static int corgi_ssp_suspend(struct platform_device *dev, pm_message_t state) |
| 226 | { | 226 | { |
| 227 | ssp_flush(&corgi_ssp_dev); | 227 | ssp_flush(&corgi_ssp_dev); |
| 228 | ssp_save_state(&corgi_ssp_dev,&corgi_ssp_state); | 228 | ssp_save_state(&corgi_ssp_dev,&corgi_ssp_state); |
| @@ -230,7 +230,7 @@ static int corgi_ssp_suspend(struct device *dev, pm_message_t state) | |||
| 230 | return 0; | 230 | return 0; |
| 231 | } | 231 | } |
| 232 | 232 | ||
| 233 | static int corgi_ssp_resume(struct device *dev) | 233 | static int corgi_ssp_resume(struct platform_device *dev) |
| 234 | { | 234 | { |
| 235 | GPSR(ssp_machinfo->cs_lcdcon) = GPIO_bit(ssp_machinfo->cs_lcdcon); /* High - Disable LCD Control/Timing Gen */ | 235 | GPSR(ssp_machinfo->cs_lcdcon) = GPIO_bit(ssp_machinfo->cs_lcdcon); /* High - Disable LCD Control/Timing Gen */ |
| 236 | GPSR(ssp_machinfo->cs_max1111) = GPIO_bit(ssp_machinfo->cs_max1111); /* High - Disable MAX1111*/ | 236 | GPSR(ssp_machinfo->cs_max1111) = GPIO_bit(ssp_machinfo->cs_max1111); /* High - Disable MAX1111*/ |
| @@ -241,18 +241,19 @@ static int corgi_ssp_resume(struct device *dev) | |||
| 241 | return 0; | 241 | return 0; |
| 242 | } | 242 | } |
| 243 | 243 | ||
| 244 | static struct device_driver corgissp_driver = { | 244 | static struct platform_driver corgissp_driver = { |
| 245 | .name = "corgi-ssp", | ||
| 246 | .bus = &platform_bus_type, | ||
| 247 | .probe = corgi_ssp_probe, | 245 | .probe = corgi_ssp_probe, |
| 248 | .remove = corgi_ssp_remove, | 246 | .remove = corgi_ssp_remove, |
| 249 | .suspend = corgi_ssp_suspend, | 247 | .suspend = corgi_ssp_suspend, |
| 250 | .resume = corgi_ssp_resume, | 248 | .resume = corgi_ssp_resume, |
| 249 | .driver = { | ||
| 250 | .name = "corgi-ssp", | ||
| 251 | }, | ||
| 251 | }; | 252 | }; |
| 252 | 253 | ||
| 253 | int __init corgi_ssp_init(void) | 254 | int __init corgi_ssp_init(void) |
| 254 | { | 255 | { |
| 255 | return driver_register(&corgissp_driver); | 256 | return platform_driver_register(&corgissp_driver); |
| 256 | } | 257 | } |
| 257 | 258 | ||
| 258 | arch_initcall(corgi_ssp_init); | 259 | arch_initcall(corgi_ssp_init); |
diff --git a/arch/arm/mach-sa1100/neponset.c b/arch/arm/mach-sa1100/neponset.c index 69f1970646c6..9e02bc3712a0 100644 --- a/arch/arm/mach-sa1100/neponset.c +++ b/arch/arm/mach-sa1100/neponset.c | |||
| @@ -137,7 +137,7 @@ static struct sa1100_port_fns neponset_port_fns __initdata = { | |||
| 137 | .get_mctrl = neponset_get_mctrl, | 137 | .get_mctrl = neponset_get_mctrl, |
| 138 | }; | 138 | }; |
| 139 | 139 | ||
| 140 | static int neponset_probe(struct device *dev) | 140 | static int neponset_probe(struct platform_device *dev) |
| 141 | { | 141 | { |
| 142 | sa1100_register_uart_fns(&neponset_port_fns); | 142 | sa1100_register_uart_fns(&neponset_port_fns); |
| 143 | 143 | ||
| @@ -178,27 +178,27 @@ static int neponset_probe(struct device *dev) | |||
| 178 | /* | 178 | /* |
| 179 | * LDM power management. | 179 | * LDM power management. |
| 180 | */ | 180 | */ |
| 181 | static int neponset_suspend(struct device *dev, pm_message_t state) | 181 | static int neponset_suspend(struct platform_device *dev, pm_message_t state) |
| 182 | { | 182 | { |
| 183 | /* | 183 | /* |
| 184 | * Save state. | 184 | * Save state. |
| 185 | */ | 185 | */ |
| 186 | if (!dev->power.saved_state) | 186 | if (!dev->dev.power.saved_state) |
| 187 | dev->power.saved_state = kmalloc(sizeof(unsigned int), GFP_KERNEL); | 187 | dev->dev.power.saved_state = kmalloc(sizeof(unsigned int), GFP_KERNEL); |
| 188 | if (!dev->power.saved_state) | 188 | if (!dev->dev.power.saved_state) |
| 189 | return -ENOMEM; | 189 | return -ENOMEM; |
| 190 | 190 | ||
| 191 | *(unsigned int *)dev->power.saved_state = NCR_0; | 191 | *(unsigned int *)dev->dev.power.saved_state = NCR_0; |
| 192 | 192 | ||
| 193 | return 0; | 193 | return 0; |
| 194 | } | 194 | } |
| 195 | 195 | ||
| 196 | static int neponset_resume(struct device *dev) | 196 | static int neponset_resume(struct platform_device *dev) |
| 197 | { | 197 | { |
| 198 | if (dev->power.saved_state) { | 198 | if (dev->dev.power.saved_state) { |
| 199 | NCR_0 = *(unsigned int *)dev->power.saved_state; | 199 | NCR_0 = *(unsigned int *)dev->dev.power.saved_state; |
| 200 | kfree(dev->power.saved_state); | 200 | kfree(dev->dev.power.saved_state); |
| 201 | dev->power.saved_state = NULL; | 201 | dev->dev.power.saved_state = NULL; |
| 202 | } | 202 | } |
| 203 | 203 | ||
| 204 | return 0; | 204 | return 0; |
| @@ -209,12 +209,13 @@ static int neponset_resume(struct device *dev) | |||
| 209 | #define neponset_resume NULL | 209 | #define neponset_resume NULL |
| 210 | #endif | 210 | #endif |
| 211 | 211 | ||
| 212 | static struct device_driver neponset_device_driver = { | 212 | static struct platform_driver neponset_device_driver = { |
| 213 | .name = "neponset", | ||
| 214 | .bus = &platform_bus_type, | ||
| 215 | .probe = neponset_probe, | 213 | .probe = neponset_probe, |
| 216 | .suspend = neponset_suspend, | 214 | .suspend = neponset_suspend, |
| 217 | .resume = neponset_resume, | 215 | .resume = neponset_resume, |
| 216 | .driver = { | ||
| 217 | .name = "neponset", | ||
| 218 | }, | ||
| 218 | }; | 219 | }; |
| 219 | 220 | ||
| 220 | static struct resource neponset_resources[] = { | 221 | static struct resource neponset_resources[] = { |
| @@ -293,7 +294,7 @@ static struct platform_device *devices[] __initdata = { | |||
| 293 | 294 | ||
| 294 | static int __init neponset_init(void) | 295 | static int __init neponset_init(void) |
| 295 | { | 296 | { |
| 296 | driver_register(&neponset_device_driver); | 297 | platform_driver_register(&neponset_device_driver); |
| 297 | 298 | ||
| 298 | /* | 299 | /* |
| 299 | * The Neponset is only present on the Assabet machine type. | 300 | * The Neponset is only present on the Assabet machine type. |
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index ed31062029f7..c523029674e6 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig | |||
| @@ -581,17 +581,12 @@ config ARCH_FLATMEM_ENABLE | |||
| 581 | def_bool y | 581 | def_bool y |
| 582 | depends on PPC64 && !NUMA | 582 | depends on PPC64 && !NUMA |
| 583 | 583 | ||
| 584 | config ARCH_DISCONTIGMEM_ENABLE | 584 | config ARCH_SPARSEMEM_ENABLE |
| 585 | def_bool y | ||
| 586 | depends on SMP && PPC_PSERIES | ||
| 587 | |||
| 588 | config ARCH_DISCONTIGMEM_DEFAULT | ||
| 589 | def_bool y | 585 | def_bool y |
| 590 | depends on ARCH_DISCONTIGMEM_ENABLE | ||
| 591 | 586 | ||
| 592 | config ARCH_SPARSEMEM_ENABLE | 587 | config ARCH_SPARSEMEM_DEFAULT |
| 593 | def_bool y | 588 | def_bool y |
| 594 | depends on ARCH_DISCONTIGMEM_ENABLE | 589 | depends on SMP && PPC_PSERIES |
| 595 | 590 | ||
| 596 | source "mm/Kconfig" | 591 | source "mm/Kconfig" |
| 597 | 592 | ||
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile index c04bbd320594..9a74b7ab03a4 100644 --- a/arch/powerpc/kernel/Makefile +++ b/arch/powerpc/kernel/Makefile | |||
| @@ -12,11 +12,13 @@ CFLAGS_btext.o += -fPIC | |||
| 12 | endif | 12 | endif |
| 13 | 13 | ||
| 14 | obj-y := semaphore.o cputable.o ptrace.o syscalls.o \ | 14 | obj-y := semaphore.o cputable.o ptrace.o syscalls.o \ |
| 15 | irq.o signal_32.o pmc.o | 15 | irq.o signal_32.o pmc.o vdso.o |
| 16 | obj-y += vdso32/ | ||
| 16 | obj-$(CONFIG_PPC64) += setup_64.o binfmt_elf32.o sys_ppc32.o \ | 17 | obj-$(CONFIG_PPC64) += setup_64.o binfmt_elf32.o sys_ppc32.o \ |
| 17 | signal_64.o ptrace32.o systbl.o \ | 18 | signal_64.o ptrace32.o systbl.o \ |
| 18 | paca.o ioctl32.o cpu_setup_power4.o \ | 19 | paca.o ioctl32.o cpu_setup_power4.o \ |
| 19 | firmware.o sysfs.o | 20 | firmware.o sysfs.o udbg.o |
| 21 | obj-$(CONFIG_PPC64) += vdso64/ | ||
| 20 | obj-$(CONFIG_ALTIVEC) += vecemu.o vector.o | 22 | obj-$(CONFIG_ALTIVEC) += vecemu.o vector.o |
| 21 | obj-$(CONFIG_POWER4) += idle_power4.o | 23 | obj-$(CONFIG_POWER4) += idle_power4.o |
| 22 | obj-$(CONFIG_PPC_OF) += of_device.o | 24 | obj-$(CONFIG_PPC_OF) += of_device.o |
| @@ -29,6 +31,10 @@ obj-$(CONFIG_RTAS_PROC) += rtas-proc.o | |||
| 29 | obj-$(CONFIG_LPARCFG) += lparcfg.o | 31 | obj-$(CONFIG_LPARCFG) += lparcfg.o |
| 30 | obj-$(CONFIG_IBMVIO) += vio.o | 32 | obj-$(CONFIG_IBMVIO) += vio.o |
| 31 | obj-$(CONFIG_GENERIC_TBSYNC) += smp-tbsync.o | 33 | obj-$(CONFIG_GENERIC_TBSYNC) += smp-tbsync.o |
| 34 | obj-$(CONFIG_PPC_PSERIES) += udbg_16550.o | ||
| 35 | obj-$(CONFIG_PPC_MAPLE) += udbg_16550.o | ||
| 36 | udbgscc-$(CONFIG_PPC64) := udbg_scc.o | ||
| 37 | obj-$(CONFIG_PPC_PMAC) += $(udbgscc-y) | ||
| 32 | 38 | ||
| 33 | ifeq ($(CONFIG_PPC_MERGE),y) | 39 | ifeq ($(CONFIG_PPC_MERGE),y) |
| 34 | 40 | ||
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c index 8793102711a8..4550eb4f4fbd 100644 --- a/arch/powerpc/kernel/asm-offsets.c +++ b/arch/powerpc/kernel/asm-offsets.c | |||
| @@ -37,12 +37,12 @@ | |||
| 37 | #include <asm/cputable.h> | 37 | #include <asm/cputable.h> |
| 38 | #include <asm/thread_info.h> | 38 | #include <asm/thread_info.h> |
| 39 | #include <asm/rtas.h> | 39 | #include <asm/rtas.h> |
| 40 | #include <asm/vdso_datapage.h> | ||
| 40 | #ifdef CONFIG_PPC64 | 41 | #ifdef CONFIG_PPC64 |
| 41 | #include <asm/paca.h> | 42 | #include <asm/paca.h> |
| 42 | #include <asm/lppaca.h> | 43 | #include <asm/lppaca.h> |
| 43 | #include <asm/iseries/hv_lp_event.h> | 44 | #include <asm/iseries/hv_lp_event.h> |
| 44 | #include <asm/cache.h> | 45 | #include <asm/cache.h> |
| 45 | #include <asm/systemcfg.h> | ||
| 46 | #include <asm/compat.h> | 46 | #include <asm/compat.h> |
| 47 | #endif | 47 | #endif |
| 48 | 48 | ||
| @@ -251,25 +251,42 @@ int main(void) | |||
| 251 | 251 | ||
| 252 | DEFINE(TASK_SIZE, TASK_SIZE); | 252 | DEFINE(TASK_SIZE, TASK_SIZE); |
| 253 | DEFINE(NUM_USER_SEGMENTS, TASK_SIZE>>28); | 253 | DEFINE(NUM_USER_SEGMENTS, TASK_SIZE>>28); |
| 254 | #else /* CONFIG_PPC64 */ | 254 | #endif /* ! CONFIG_PPC64 */ |
| 255 | /* systemcfg offsets for use by vdso */ | ||
| 256 | DEFINE(CFG_TB_ORIG_STAMP, offsetof(struct systemcfg, tb_orig_stamp)); | ||
| 257 | DEFINE(CFG_TB_TICKS_PER_SEC, offsetof(struct systemcfg, tb_ticks_per_sec)); | ||
| 258 | DEFINE(CFG_TB_TO_XS, offsetof(struct systemcfg, tb_to_xs)); | ||
| 259 | DEFINE(CFG_STAMP_XSEC, offsetof(struct systemcfg, stamp_xsec)); | ||
| 260 | DEFINE(CFG_TB_UPDATE_COUNT, offsetof(struct systemcfg, tb_update_count)); | ||
| 261 | DEFINE(CFG_TZ_MINUTEWEST, offsetof(struct systemcfg, tz_minuteswest)); | ||
| 262 | DEFINE(CFG_TZ_DSTTIME, offsetof(struct systemcfg, tz_dsttime)); | ||
| 263 | DEFINE(CFG_SYSCALL_MAP32, offsetof(struct systemcfg, syscall_map_32)); | ||
| 264 | DEFINE(CFG_SYSCALL_MAP64, offsetof(struct systemcfg, syscall_map_64)); | ||
| 265 | 255 | ||
| 266 | /* timeval/timezone offsets for use by vdso */ | 256 | /* datapage offsets for use by vdso */ |
| 257 | DEFINE(CFG_TB_ORIG_STAMP, offsetof(struct vdso_data, tb_orig_stamp)); | ||
| 258 | DEFINE(CFG_TB_TICKS_PER_SEC, offsetof(struct vdso_data, tb_ticks_per_sec)); | ||
| 259 | DEFINE(CFG_TB_TO_XS, offsetof(struct vdso_data, tb_to_xs)); | ||
| 260 | DEFINE(CFG_STAMP_XSEC, offsetof(struct vdso_data, stamp_xsec)); | ||
| 261 | DEFINE(CFG_TB_UPDATE_COUNT, offsetof(struct vdso_data, tb_update_count)); | ||
| 262 | DEFINE(CFG_TZ_MINUTEWEST, offsetof(struct vdso_data, tz_minuteswest)); | ||
| 263 | DEFINE(CFG_TZ_DSTTIME, offsetof(struct vdso_data, tz_dsttime)); | ||
| 264 | DEFINE(CFG_SYSCALL_MAP32, offsetof(struct vdso_data, syscall_map_32)); | ||
| 265 | DEFINE(WTOM_CLOCK_SEC, offsetof(struct vdso_data, wtom_clock_sec)); | ||
| 266 | DEFINE(WTOM_CLOCK_NSEC, offsetof(struct vdso_data, wtom_clock_nsec)); | ||
| 267 | #ifdef CONFIG_PPC64 | ||
| 268 | DEFINE(CFG_SYSCALL_MAP64, offsetof(struct vdso_data, syscall_map_64)); | ||
| 267 | DEFINE(TVAL64_TV_SEC, offsetof(struct timeval, tv_sec)); | 269 | DEFINE(TVAL64_TV_SEC, offsetof(struct timeval, tv_sec)); |
| 268 | DEFINE(TVAL64_TV_USEC, offsetof(struct timeval, tv_usec)); | 270 | DEFINE(TVAL64_TV_USEC, offsetof(struct timeval, tv_usec)); |
| 269 | DEFINE(TVAL32_TV_SEC, offsetof(struct compat_timeval, tv_sec)); | 271 | DEFINE(TVAL32_TV_SEC, offsetof(struct compat_timeval, tv_sec)); |
| 270 | DEFINE(TVAL32_TV_USEC, offsetof(struct compat_timeval, tv_usec)); | 272 | DEFINE(TVAL32_TV_USEC, offsetof(struct compat_timeval, tv_usec)); |
| 273 | DEFINE(TSPC32_TV_SEC, offsetof(struct compat_timespec, tv_sec)); | ||
| 274 | DEFINE(TSPC32_TV_NSEC, offsetof(struct compat_timespec, tv_nsec)); | ||
| 275 | #else | ||
| 276 | DEFINE(TVAL32_TV_SEC, offsetof(struct timeval, tv_sec)); | ||
| 277 | DEFINE(TVAL32_TV_USEC, offsetof(struct timeval, tv_usec)); | ||
| 278 | DEFINE(TSPEC32_TV_SEC, offsetof(struct timespec, tv_sec)); | ||
| 279 | DEFINE(TSPEC32_TV_NSEC, offsetof(struct timespec, tv_nsec)); | ||
| 280 | #endif | ||
| 281 | /* timeval/timezone offsets for use by vdso */ | ||
| 271 | DEFINE(TZONE_TZ_MINWEST, offsetof(struct timezone, tz_minuteswest)); | 282 | DEFINE(TZONE_TZ_MINWEST, offsetof(struct timezone, tz_minuteswest)); |
| 272 | DEFINE(TZONE_TZ_DSTTIME, offsetof(struct timezone, tz_dsttime)); | 283 | DEFINE(TZONE_TZ_DSTTIME, offsetof(struct timezone, tz_dsttime)); |
| 273 | #endif /* CONFIG_PPC64 */ | 284 | |
| 285 | /* Other bits used by the vdso */ | ||
| 286 | DEFINE(CLOCK_REALTIME, CLOCK_REALTIME); | ||
| 287 | DEFINE(CLOCK_MONOTONIC, CLOCK_MONOTONIC); | ||
| 288 | DEFINE(NSEC_PER_SEC, NSEC_PER_SEC); | ||
| 289 | DEFINE(CLOCK_REALTIME_RES, TICK_NSEC); | ||
| 290 | |||
| 274 | return 0; | 291 | return 0; |
| 275 | } | 292 | } |
diff --git a/arch/powerpc/kernel/head_32.S b/arch/powerpc/kernel/head_32.S index b102e3a2415e..ccdf94731e30 100644 --- a/arch/powerpc/kernel/head_32.S +++ b/arch/powerpc/kernel/head_32.S | |||
| @@ -1100,6 +1100,7 @@ start_here: | |||
| 1100 | mr r3,r31 | 1100 | mr r3,r31 |
| 1101 | mr r4,r30 | 1101 | mr r4,r30 |
| 1102 | bl machine_init | 1102 | bl machine_init |
| 1103 | bl __save_cpu_setup | ||
| 1103 | bl MMU_init | 1104 | bl MMU_init |
| 1104 | 1105 | ||
| 1105 | #ifdef CONFIG_APUS | 1106 | #ifdef CONFIG_APUS |
diff --git a/arch/powerpc/kernel/lparcfg.c b/arch/powerpc/kernel/lparcfg.c index 5e954fae031f..1b3ba8a440a6 100644 --- a/arch/powerpc/kernel/lparcfg.c +++ b/arch/powerpc/kernel/lparcfg.c | |||
| @@ -35,7 +35,7 @@ | |||
| 35 | #include <asm/time.h> | 35 | #include <asm/time.h> |
| 36 | #include <asm/iseries/it_exp_vpd_panel.h> | 36 | #include <asm/iseries/it_exp_vpd_panel.h> |
| 37 | #include <asm/prom.h> | 37 | #include <asm/prom.h> |
| 38 | #include <asm/systemcfg.h> | 38 | #include <asm/vdso_datapage.h> |
| 39 | 39 | ||
| 40 | #define MODULE_VERS "1.6" | 40 | #define MODULE_VERS "1.6" |
| 41 | #define MODULE_NAME "lparcfg" | 41 | #define MODULE_NAME "lparcfg" |
| @@ -43,7 +43,7 @@ | |||
| 43 | /* #define LPARCFG_DEBUG */ | 43 | /* #define LPARCFG_DEBUG */ |
| 44 | 44 | ||
| 45 | /* find a better place for this function... */ | 45 | /* find a better place for this function... */ |
| 46 | void log_plpar_hcall_return(unsigned long rc, char *tag) | 46 | static void log_plpar_hcall_return(unsigned long rc, char *tag) |
| 47 | { | 47 | { |
| 48 | if (rc == 0) /* success, return */ | 48 | if (rc == 0) /* success, return */ |
| 49 | return; | 49 | return; |
| @@ -213,11 +213,10 @@ static void h_pic(unsigned long *pool_idle_time, unsigned long *num_procs) | |||
| 213 | unsigned long dummy; | 213 | unsigned long dummy; |
| 214 | rc = plpar_hcall(H_PIC, 0, 0, 0, 0, pool_idle_time, num_procs, &dummy); | 214 | rc = plpar_hcall(H_PIC, 0, 0, 0, 0, pool_idle_time, num_procs, &dummy); |
| 215 | 215 | ||
| 216 | log_plpar_hcall_return(rc, "H_PIC"); | 216 | if (rc != H_Authority) |
| 217 | log_plpar_hcall_return(rc, "H_PIC"); | ||
| 217 | } | 218 | } |
| 218 | 219 | ||
| 219 | static unsigned long get_purr(void); | ||
| 220 | |||
| 221 | /* Track sum of all purrs across all processors. This is used to further */ | 220 | /* Track sum of all purrs across all processors. This is used to further */ |
| 222 | /* calculate usage values by different applications */ | 221 | /* calculate usage values by different applications */ |
| 223 | 222 | ||
| @@ -319,8 +318,6 @@ static void parse_system_parameter_string(struct seq_file *m) | |||
| 319 | kfree(local_buffer); | 318 | kfree(local_buffer); |
| 320 | } | 319 | } |
| 321 | 320 | ||
| 322 | static int lparcfg_count_active_processors(void); | ||
| 323 | |||
| 324 | /* Return the number of processors in the system. | 321 | /* Return the number of processors in the system. |
| 325 | * This function reads through the device tree and counts | 322 | * This function reads through the device tree and counts |
| 326 | * the virtual processors, this does not include threads. | 323 | * the virtual processors, this does not include threads. |
| @@ -372,7 +369,7 @@ static int lparcfg_data(struct seq_file *m, void *v) | |||
| 372 | lrdrp = (int *)get_property(rtas_node, "ibm,lrdr-capacity", NULL); | 369 | lrdrp = (int *)get_property(rtas_node, "ibm,lrdr-capacity", NULL); |
| 373 | 370 | ||
| 374 | if (lrdrp == NULL) { | 371 | if (lrdrp == NULL) { |
| 375 | partition_potential_processors = _systemcfg->processorCount; | 372 | partition_potential_processors = vdso_data->processorCount; |
| 376 | } else { | 373 | } else { |
| 377 | partition_potential_processors = *(lrdrp + 4); | 374 | partition_potential_processors = *(lrdrp + 4); |
| 378 | } | 375 | } |
| @@ -548,7 +545,7 @@ static ssize_t lparcfg_write(struct file *file, const char __user * buf, | |||
| 548 | retval = -EIO; | 545 | retval = -EIO; |
| 549 | } | 546 | } |
| 550 | 547 | ||
| 551 | out: | 548 | out: |
| 552 | kfree(kbuf); | 549 | kfree(kbuf); |
| 553 | return retval; | 550 | return retval; |
| 554 | } | 551 | } |
| @@ -561,10 +558,10 @@ static int lparcfg_open(struct inode *inode, struct file *file) | |||
| 561 | } | 558 | } |
| 562 | 559 | ||
| 563 | struct file_operations lparcfg_fops = { | 560 | struct file_operations lparcfg_fops = { |
| 564 | .owner = THIS_MODULE, | 561 | .owner = THIS_MODULE, |
| 565 | .read = seq_read, | 562 | .read = seq_read, |
| 566 | .open = lparcfg_open, | 563 | .open = lparcfg_open, |
| 567 | .release = single_release, | 564 | .release = single_release, |
| 568 | }; | 565 | }; |
| 569 | 566 | ||
| 570 | int __init lparcfg_init(void) | 567 | int __init lparcfg_init(void) |
diff --git a/arch/powerpc/kernel/paca.c b/arch/powerpc/kernel/paca.c index 3cf2517c5f91..a7b68f911eb1 100644 --- a/arch/powerpc/kernel/paca.c +++ b/arch/powerpc/kernel/paca.c | |||
| @@ -15,17 +15,10 @@ | |||
| 15 | #include <asm/processor.h> | 15 | #include <asm/processor.h> |
| 16 | #include <asm/ptrace.h> | 16 | #include <asm/ptrace.h> |
| 17 | #include <asm/page.h> | 17 | #include <asm/page.h> |
| 18 | #include <asm/systemcfg.h> | ||
| 19 | #include <asm/lppaca.h> | 18 | #include <asm/lppaca.h> |
| 20 | #include <asm/iseries/it_lp_queue.h> | 19 | #include <asm/iseries/it_lp_queue.h> |
| 21 | #include <asm/paca.h> | 20 | #include <asm/paca.h> |
| 22 | 21 | ||
| 23 | static union { | ||
| 24 | struct systemcfg data; | ||
| 25 | u8 page[PAGE_SIZE]; | ||
| 26 | } systemcfg_store __attribute__((__section__(".data.page.aligned"))); | ||
| 27 | struct systemcfg *_systemcfg = &systemcfg_store.data; | ||
| 28 | |||
| 29 | 22 | ||
| 30 | /* This symbol is provided by the linker - let it fill in the paca | 23 | /* This symbol is provided by the linker - let it fill in the paca |
| 31 | * field correctly */ | 24 | * field correctly */ |
diff --git a/arch/powerpc/kernel/proc_ppc64.c b/arch/powerpc/kernel/proc_ppc64.c index a1c19502fe8b..7ba42a405f41 100644 --- a/arch/powerpc/kernel/proc_ppc64.c +++ b/arch/powerpc/kernel/proc_ppc64.c | |||
| @@ -23,7 +23,7 @@ | |||
| 23 | #include <linux/slab.h> | 23 | #include <linux/slab.h> |
| 24 | #include <linux/kernel.h> | 24 | #include <linux/kernel.h> |
| 25 | 25 | ||
| 26 | #include <asm/systemcfg.h> | 26 | #include <asm/vdso_datapage.h> |
| 27 | #include <asm/rtas.h> | 27 | #include <asm/rtas.h> |
| 28 | #include <asm/uaccess.h> | 28 | #include <asm/uaccess.h> |
| 29 | #include <asm/prom.h> | 29 | #include <asm/prom.h> |
| @@ -72,7 +72,7 @@ static int __init proc_ppc64_init(void) | |||
| 72 | if (!pde) | 72 | if (!pde) |
| 73 | return 1; | 73 | return 1; |
| 74 | pde->nlink = 1; | 74 | pde->nlink = 1; |
| 75 | pde->data = _systemcfg; | 75 | pde->data = vdso_data; |
| 76 | pde->size = PAGE_SIZE; | 76 | pde->size = PAGE_SIZE; |
| 77 | pde->proc_fops = &page_map_fops; | 77 | pde->proc_fops = &page_map_fops; |
| 78 | 78 | ||
diff --git a/arch/powerpc/kernel/rtas-proc.c b/arch/powerpc/kernel/rtas-proc.c index ae1a36449ccd..7a95b8a28354 100644 --- a/arch/powerpc/kernel/rtas-proc.c +++ b/arch/powerpc/kernel/rtas-proc.c | |||
| @@ -32,7 +32,6 @@ | |||
| 32 | #include <asm/rtas.h> | 32 | #include <asm/rtas.h> |
| 33 | #include <asm/machdep.h> /* for ppc_md */ | 33 | #include <asm/machdep.h> /* for ppc_md */ |
| 34 | #include <asm/time.h> | 34 | #include <asm/time.h> |
| 35 | #include <asm/systemcfg.h> | ||
| 36 | 35 | ||
| 37 | /* Token for Sensors */ | 36 | /* Token for Sensors */ |
| 38 | #define KEY_SWITCH 0x0001 | 37 | #define KEY_SWITCH 0x0001 |
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c index bae4bff138f1..33e7f2c7f194 100644 --- a/arch/powerpc/kernel/setup-common.c +++ b/arch/powerpc/kernel/setup-common.c | |||
| @@ -33,7 +33,7 @@ | |||
| 33 | #include <asm/io.h> | 33 | #include <asm/io.h> |
| 34 | #include <asm/prom.h> | 34 | #include <asm/prom.h> |
| 35 | #include <asm/processor.h> | 35 | #include <asm/processor.h> |
| 36 | #include <asm/systemcfg.h> | 36 | #include <asm/vdso_datapage.h> |
| 37 | #include <asm/pgtable.h> | 37 | #include <asm/pgtable.h> |
| 38 | #include <asm/smp.h> | 38 | #include <asm/smp.h> |
| 39 | #include <asm/elf.h> | 39 | #include <asm/elf.h> |
| @@ -444,10 +444,8 @@ void __init check_for_initrd(void) | |||
| 444 | if (initrd_start >= KERNELBASE && initrd_end >= KERNELBASE && | 444 | if (initrd_start >= KERNELBASE && initrd_end >= KERNELBASE && |
| 445 | initrd_end > initrd_start) | 445 | initrd_end > initrd_start) |
| 446 | ROOT_DEV = Root_RAM0; | 446 | ROOT_DEV = Root_RAM0; |
| 447 | else { | 447 | else |
| 448 | printk("Bogus initrd %08lx %08lx\n", initrd_start, initrd_end); | ||
| 449 | initrd_start = initrd_end = 0; | 448 | initrd_start = initrd_end = 0; |
| 450 | } | ||
| 451 | 449 | ||
| 452 | if (initrd_start) | 450 | if (initrd_start) |
| 453 | printk("Found initrd at 0x%lx:0x%lx\n", initrd_start, initrd_end); | 451 | printk("Found initrd at 0x%lx:0x%lx\n", initrd_start, initrd_end); |
| @@ -566,7 +564,7 @@ void __init smp_setup_cpu_maps(void) | |||
| 566 | cpu_set(cpu ^ 0x1, cpu_sibling_map[cpu]); | 564 | cpu_set(cpu ^ 0x1, cpu_sibling_map[cpu]); |
| 567 | } | 565 | } |
| 568 | 566 | ||
| 569 | _systemcfg->processorCount = num_present_cpus(); | 567 | vdso_data->processorCount = num_present_cpus(); |
| 570 | #endif /* CONFIG_PPC64 */ | 568 | #endif /* CONFIG_PPC64 */ |
| 571 | } | 569 | } |
| 572 | #endif /* CONFIG_SMP */ | 570 | #endif /* CONFIG_SMP */ |
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c index 6791668213e7..fdbd9f9122f2 100644 --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c | |||
| @@ -57,7 +57,6 @@ | |||
| 57 | #include <asm/lmb.h> | 57 | #include <asm/lmb.h> |
| 58 | #include <asm/iseries/it_lp_naca.h> | 58 | #include <asm/iseries/it_lp_naca.h> |
| 59 | #include <asm/firmware.h> | 59 | #include <asm/firmware.h> |
| 60 | #include <asm/systemcfg.h> | ||
| 61 | #include <asm/xmon.h> | 60 | #include <asm/xmon.h> |
| 62 | #include <asm/udbg.h> | 61 | #include <asm/udbg.h> |
| 63 | 62 | ||
| @@ -375,9 +374,8 @@ static void __init initialize_cache_info(void) | |||
| 375 | DBG("Argh, can't find dcache properties ! " | 374 | DBG("Argh, can't find dcache properties ! " |
| 376 | "sizep: %p, lsizep: %p\n", sizep, lsizep); | 375 | "sizep: %p, lsizep: %p\n", sizep, lsizep); |
| 377 | 376 | ||
| 378 | _systemcfg->dcache_size = ppc64_caches.dsize = size; | 377 | ppc64_caches.dsize = size; |
| 379 | _systemcfg->dcache_line_size = | 378 | ppc64_caches.dline_size = lsize; |
| 380 | ppc64_caches.dline_size = lsize; | ||
| 381 | ppc64_caches.log_dline_size = __ilog2(lsize); | 379 | ppc64_caches.log_dline_size = __ilog2(lsize); |
| 382 | ppc64_caches.dlines_per_page = PAGE_SIZE / lsize; | 380 | ppc64_caches.dlines_per_page = PAGE_SIZE / lsize; |
| 383 | 381 | ||
| @@ -393,22 +391,13 @@ static void __init initialize_cache_info(void) | |||
| 393 | DBG("Argh, can't find icache properties ! " | 391 | DBG("Argh, can't find icache properties ! " |
| 394 | "sizep: %p, lsizep: %p\n", sizep, lsizep); | 392 | "sizep: %p, lsizep: %p\n", sizep, lsizep); |
| 395 | 393 | ||
| 396 | _systemcfg->icache_size = ppc64_caches.isize = size; | 394 | ppc64_caches.isize = size; |
| 397 | _systemcfg->icache_line_size = | 395 | ppc64_caches.iline_size = lsize; |
| 398 | ppc64_caches.iline_size = lsize; | ||
| 399 | ppc64_caches.log_iline_size = __ilog2(lsize); | 396 | ppc64_caches.log_iline_size = __ilog2(lsize); |
| 400 | ppc64_caches.ilines_per_page = PAGE_SIZE / lsize; | 397 | ppc64_caches.ilines_per_page = PAGE_SIZE / lsize; |
| 401 | } | 398 | } |
| 402 | } | 399 | } |
| 403 | 400 | ||
| 404 | /* Add an eye catcher and the systemcfg layout version number */ | ||
| 405 | strcpy(_systemcfg->eye_catcher, "SYSTEMCFG:PPC64"); | ||
| 406 | _systemcfg->version.major = SYSTEMCFG_MAJOR; | ||
| 407 | _systemcfg->version.minor = SYSTEMCFG_MINOR; | ||
| 408 | _systemcfg->processor = mfspr(SPRN_PVR); | ||
| 409 | _systemcfg->platform = _machine; | ||
| 410 | _systemcfg->physicalMemorySize = lmb_phys_mem_size(); | ||
| 411 | |||
| 412 | DBG(" <- initialize_cache_info()\n"); | 401 | DBG(" <- initialize_cache_info()\n"); |
| 413 | } | 402 | } |
| 414 | 403 | ||
| @@ -495,15 +484,14 @@ void __init setup_system(void) | |||
| 495 | 484 | ||
| 496 | printk("-----------------------------------------------------\n"); | 485 | printk("-----------------------------------------------------\n"); |
| 497 | printk("ppc64_pft_size = 0x%lx\n", ppc64_pft_size); | 486 | printk("ppc64_pft_size = 0x%lx\n", ppc64_pft_size); |
| 498 | printk("ppc64_interrupt_controller = 0x%ld\n", ppc64_interrupt_controller); | 487 | printk("ppc64_interrupt_controller = 0x%ld\n", |
| 499 | printk("systemcfg = 0x%p\n", _systemcfg); | 488 | ppc64_interrupt_controller); |
| 500 | printk("systemcfg->platform = 0x%x\n", _systemcfg->platform); | 489 | printk("platform = 0x%x\n", _machine); |
| 501 | printk("systemcfg->processorCount = 0x%lx\n", _systemcfg->processorCount); | 490 | printk("physicalMemorySize = 0x%lx\n", lmb_phys_mem_size()); |
| 502 | printk("systemcfg->physicalMemorySize = 0x%lx\n", _systemcfg->physicalMemorySize); | ||
| 503 | printk("ppc64_caches.dcache_line_size = 0x%x\n", | 491 | printk("ppc64_caches.dcache_line_size = 0x%x\n", |
| 504 | ppc64_caches.dline_size); | 492 | ppc64_caches.dline_size); |
| 505 | printk("ppc64_caches.icache_line_size = 0x%x\n", | 493 | printk("ppc64_caches.icache_line_size = 0x%x\n", |
| 506 | ppc64_caches.iline_size); | 494 | ppc64_caches.iline_size); |
| 507 | printk("htab_address = 0x%p\n", htab_address); | 495 | printk("htab_address = 0x%p\n", htab_address); |
| 508 | printk("htab_hash_mask = 0x%lx\n", htab_hash_mask); | 496 | printk("htab_hash_mask = 0x%lx\n", htab_hash_mask); |
| 509 | printk("-----------------------------------------------------\n"); | 497 | printk("-----------------------------------------------------\n"); |
| @@ -568,33 +556,6 @@ static void __init emergency_stack_init(void) | |||
| 568 | } | 556 | } |
| 569 | 557 | ||
| 570 | /* | 558 | /* |
| 571 | * Called from setup_arch to initialize the bitmap of available | ||
| 572 | * syscalls in the systemcfg page | ||
| 573 | */ | ||
| 574 | void __init setup_syscall_map(void) | ||
| 575 | { | ||
| 576 | unsigned int i, count64 = 0, count32 = 0; | ||
| 577 | extern unsigned long *sys_call_table; | ||
| 578 | extern unsigned long sys_ni_syscall; | ||
| 579 | |||
| 580 | |||
| 581 | for (i = 0; i < __NR_syscalls; i++) { | ||
| 582 | if (sys_call_table[i*2] != sys_ni_syscall) { | ||
| 583 | count64++; | ||
| 584 | _systemcfg->syscall_map_64[i >> 5] |= | ||
| 585 | 0x80000000UL >> (i & 0x1f); | ||
| 586 | } | ||
| 587 | if (sys_call_table[i*2+1] != sys_ni_syscall) { | ||
| 588 | count32++; | ||
| 589 | _systemcfg->syscall_map_32[i >> 5] |= | ||
| 590 | 0x80000000UL >> (i & 0x1f); | ||
| 591 | } | ||
| 592 | } | ||
| 593 | printk(KERN_INFO "Syscall map setup, %d 32-bit and %d 64-bit syscalls\n", | ||
| 594 | count32, count64); | ||
| 595 | } | ||
| 596 | |||
| 597 | /* | ||
| 598 | * Called into from start_kernel, after lock_kernel has been called. | 559 | * Called into from start_kernel, after lock_kernel has been called. |
| 599 | * Initializes bootmem, which is unsed to manage page allocation until | 560 | * Initializes bootmem, which is unsed to manage page allocation until |
| 600 | * mem_init is called. | 561 | * mem_init is called. |
| @@ -635,9 +596,6 @@ void __init setup_arch(char **cmdline_p) | |||
| 635 | do_init_bootmem(); | 596 | do_init_bootmem(); |
| 636 | sparse_init(); | 597 | sparse_init(); |
| 637 | 598 | ||
| 638 | /* initialize the syscall map in systemcfg */ | ||
| 639 | setup_syscall_map(); | ||
| 640 | |||
| 641 | #ifdef CONFIG_DUMMY_CONSOLE | 599 | #ifdef CONFIG_DUMMY_CONSOLE |
| 642 | conswitchp = &dummy_con; | 600 | conswitchp = &dummy_con; |
| 643 | #endif | 601 | #endif |
diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c index a7c4515f320f..8bdf95b7e420 100644 --- a/arch/powerpc/kernel/signal_32.c +++ b/arch/powerpc/kernel/signal_32.c | |||
| @@ -43,10 +43,10 @@ | |||
| 43 | #include <asm/uaccess.h> | 43 | #include <asm/uaccess.h> |
| 44 | #include <asm/cacheflush.h> | 44 | #include <asm/cacheflush.h> |
| 45 | #include <asm/sigcontext.h> | 45 | #include <asm/sigcontext.h> |
| 46 | #include <asm/vdso.h> | ||
| 46 | #ifdef CONFIG_PPC64 | 47 | #ifdef CONFIG_PPC64 |
| 47 | #include "ppc32.h" | 48 | #include "ppc32.h" |
| 48 | #include <asm/unistd.h> | 49 | #include <asm/unistd.h> |
| 49 | #include <asm/vdso.h> | ||
| 50 | #else | 50 | #else |
| 51 | #include <asm/ucontext.h> | 51 | #include <asm/ucontext.h> |
| 52 | #include <asm/pgtable.h> | 52 | #include <asm/pgtable.h> |
| @@ -809,14 +809,11 @@ static int handle_rt_signal(unsigned long sig, struct k_sigaction *ka, | |||
| 809 | 809 | ||
| 810 | /* Save user registers on the stack */ | 810 | /* Save user registers on the stack */ |
| 811 | frame = &rt_sf->uc.uc_mcontext; | 811 | frame = &rt_sf->uc.uc_mcontext; |
| 812 | #ifdef CONFIG_PPC64 | ||
| 813 | if (vdso32_rt_sigtramp && current->thread.vdso_base) { | 812 | if (vdso32_rt_sigtramp && current->thread.vdso_base) { |
| 814 | if (save_user_regs(regs, frame, 0)) | 813 | if (save_user_regs(regs, frame, 0)) |
| 815 | goto badframe; | 814 | goto badframe; |
| 816 | regs->link = current->thread.vdso_base + vdso32_rt_sigtramp; | 815 | regs->link = current->thread.vdso_base + vdso32_rt_sigtramp; |
| 817 | } else | 816 | } else { |
| 818 | #endif | ||
| 819 | { | ||
| 820 | if (save_user_regs(regs, frame, __NR_rt_sigreturn)) | 817 | if (save_user_regs(regs, frame, __NR_rt_sigreturn)) |
| 821 | goto badframe; | 818 | goto badframe; |
| 822 | regs->link = (unsigned long) frame->tramp; | 819 | regs->link = (unsigned long) frame->tramp; |
| @@ -1090,14 +1087,11 @@ static int handle_signal(unsigned long sig, struct k_sigaction *ka, | |||
| 1090 | || __put_user(sig, &sc->signal)) | 1087 | || __put_user(sig, &sc->signal)) |
| 1091 | goto badframe; | 1088 | goto badframe; |
| 1092 | 1089 | ||
| 1093 | #ifdef CONFIG_PPC64 | ||
| 1094 | if (vdso32_sigtramp && current->thread.vdso_base) { | 1090 | if (vdso32_sigtramp && current->thread.vdso_base) { |
| 1095 | if (save_user_regs(regs, &frame->mctx, 0)) | 1091 | if (save_user_regs(regs, &frame->mctx, 0)) |
| 1096 | goto badframe; | 1092 | goto badframe; |
| 1097 | regs->link = current->thread.vdso_base + vdso32_sigtramp; | 1093 | regs->link = current->thread.vdso_base + vdso32_sigtramp; |
| 1098 | } else | 1094 | } else { |
| 1099 | #endif | ||
| 1100 | { | ||
| 1101 | if (save_user_regs(regs, &frame->mctx, __NR_sigreturn)) | 1095 | if (save_user_regs(regs, &frame->mctx, __NR_sigreturn)) |
| 1102 | goto badframe; | 1096 | goto badframe; |
| 1103 | regs->link = (unsigned long) frame->mctx.tramp; | 1097 | regs->link = (unsigned long) frame->mctx.tramp; |
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c index e28a139c29d0..62dfc5b8d765 100644 --- a/arch/powerpc/kernel/smp.c +++ b/arch/powerpc/kernel/smp.c | |||
| @@ -44,7 +44,7 @@ | |||
| 44 | #include <asm/cputable.h> | 44 | #include <asm/cputable.h> |
| 45 | #include <asm/system.h> | 45 | #include <asm/system.h> |
| 46 | #include <asm/mpic.h> | 46 | #include <asm/mpic.h> |
| 47 | #include <asm/systemcfg.h> | 47 | #include <asm/vdso_datapage.h> |
| 48 | #ifdef CONFIG_PPC64 | 48 | #ifdef CONFIG_PPC64 |
| 49 | #include <asm/paca.h> | 49 | #include <asm/paca.h> |
| 50 | #endif | 50 | #endif |
| @@ -371,7 +371,7 @@ int generic_cpu_disable(void) | |||
| 371 | 371 | ||
| 372 | cpu_clear(cpu, cpu_online_map); | 372 | cpu_clear(cpu, cpu_online_map); |
| 373 | #ifdef CONFIG_PPC64 | 373 | #ifdef CONFIG_PPC64 |
| 374 | _systemcfg->processorCount--; | 374 | vdso_data->processorCount--; |
| 375 | fixup_irqs(cpu_online_map); | 375 | fixup_irqs(cpu_online_map); |
| 376 | #endif | 376 | #endif |
| 377 | return 0; | 377 | return 0; |
diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c index 850af198fb5f..0f0c3a9ae2e5 100644 --- a/arch/powerpc/kernel/sysfs.c +++ b/arch/powerpc/kernel/sysfs.c | |||
| @@ -16,7 +16,6 @@ | |||
| 16 | #include <asm/firmware.h> | 16 | #include <asm/firmware.h> |
| 17 | #include <asm/hvcall.h> | 17 | #include <asm/hvcall.h> |
| 18 | #include <asm/prom.h> | 18 | #include <asm/prom.h> |
| 19 | #include <asm/systemcfg.h> | ||
| 20 | #include <asm/paca.h> | 19 | #include <asm/paca.h> |
| 21 | #include <asm/lppaca.h> | 20 | #include <asm/lppaca.h> |
| 22 | #include <asm/machdep.h> | 21 | #include <asm/machdep.h> |
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c index 260b6ecd26a9..070b4b458aaf 100644 --- a/arch/powerpc/kernel/time.c +++ b/arch/powerpc/kernel/time.c | |||
| @@ -62,8 +62,8 @@ | |||
| 62 | #include <asm/irq.h> | 62 | #include <asm/irq.h> |
| 63 | #include <asm/div64.h> | 63 | #include <asm/div64.h> |
| 64 | #include <asm/smp.h> | 64 | #include <asm/smp.h> |
| 65 | #include <asm/vdso_datapage.h> | ||
| 65 | #ifdef CONFIG_PPC64 | 66 | #ifdef CONFIG_PPC64 |
| 66 | #include <asm/systemcfg.h> | ||
| 67 | #include <asm/firmware.h> | 67 | #include <asm/firmware.h> |
| 68 | #endif | 68 | #endif |
| 69 | #ifdef CONFIG_PPC_ISERIES | 69 | #ifdef CONFIG_PPC_ISERIES |
| @@ -261,7 +261,6 @@ static inline void update_gtod(u64 new_tb_stamp, u64 new_stamp_xsec, | |||
| 261 | do_gtod.varp = temp_varp; | 261 | do_gtod.varp = temp_varp; |
| 262 | do_gtod.var_idx = temp_idx; | 262 | do_gtod.var_idx = temp_idx; |
| 263 | 263 | ||
| 264 | #ifdef CONFIG_PPC64 | ||
| 265 | /* | 264 | /* |
| 266 | * tb_update_count is used to allow the userspace gettimeofday code | 265 | * tb_update_count is used to allow the userspace gettimeofday code |
| 267 | * to assure itself that it sees a consistent view of the tb_to_xs and | 266 | * to assure itself that it sees a consistent view of the tb_to_xs and |
| @@ -271,14 +270,15 @@ static inline void update_gtod(u64 new_tb_stamp, u64 new_stamp_xsec, | |||
| 271 | * tb_to_xs and stamp_xsec values are consistent. If not, then it | 270 | * tb_to_xs and stamp_xsec values are consistent. If not, then it |
| 272 | * loops back and reads them again until this criteria is met. | 271 | * loops back and reads them again until this criteria is met. |
| 273 | */ | 272 | */ |
| 274 | ++(_systemcfg->tb_update_count); | 273 | ++(vdso_data->tb_update_count); |
| 275 | smp_wmb(); | 274 | smp_wmb(); |
| 276 | _systemcfg->tb_orig_stamp = new_tb_stamp; | 275 | vdso_data->tb_orig_stamp = new_tb_stamp; |
| 277 | _systemcfg->stamp_xsec = new_stamp_xsec; | 276 | vdso_data->stamp_xsec = new_stamp_xsec; |
| 278 | _systemcfg->tb_to_xs = new_tb_to_xs; | 277 | vdso_data->tb_to_xs = new_tb_to_xs; |
| 278 | vdso_data->wtom_clock_sec = wall_to_monotonic.tv_sec; | ||
| 279 | vdso_data->wtom_clock_nsec = wall_to_monotonic.tv_nsec; | ||
| 279 | smp_wmb(); | 280 | smp_wmb(); |
| 280 | ++(_systemcfg->tb_update_count); | 281 | ++(vdso_data->tb_update_count); |
| 281 | #endif | ||
| 282 | } | 282 | } |
| 283 | 283 | ||
| 284 | /* | 284 | /* |
| @@ -357,9 +357,8 @@ static void iSeries_tb_recal(void) | |||
| 357 | do_gtod.tb_ticks_per_sec = tb_ticks_per_sec; | 357 | do_gtod.tb_ticks_per_sec = tb_ticks_per_sec; |
| 358 | tb_to_xs = divres.result_low; | 358 | tb_to_xs = divres.result_low; |
| 359 | do_gtod.varp->tb_to_xs = tb_to_xs; | 359 | do_gtod.varp->tb_to_xs = tb_to_xs; |
| 360 | _systemcfg->tb_ticks_per_sec = | 360 | vdso_data->tb_ticks_per_sec = tb_ticks_per_sec; |
| 361 | tb_ticks_per_sec; | 361 | vdso_data->tb_to_xs = tb_to_xs; |
| 362 | _systemcfg->tb_to_xs = tb_to_xs; | ||
| 363 | } | 362 | } |
| 364 | else { | 363 | else { |
| 365 | printk( "Titan recalibrate: FAILED (difference > 4 percent)\n" | 364 | printk( "Titan recalibrate: FAILED (difference > 4 percent)\n" |
| @@ -561,10 +560,8 @@ int do_settimeofday(struct timespec *tv) | |||
| 561 | new_xsec += (u64)new_sec * XSEC_PER_SEC - tb_delta_xs; | 560 | new_xsec += (u64)new_sec * XSEC_PER_SEC - tb_delta_xs; |
| 562 | update_gtod(tb_last_jiffy, new_xsec, do_gtod.varp->tb_to_xs); | 561 | update_gtod(tb_last_jiffy, new_xsec, do_gtod.varp->tb_to_xs); |
| 563 | 562 | ||
| 564 | #ifdef CONFIG_PPC64 | 563 | vdso_data->tz_minuteswest = sys_tz.tz_minuteswest; |
| 565 | _systemcfg->tz_minuteswest = sys_tz.tz_minuteswest; | 564 | vdso_data->tz_dsttime = sys_tz.tz_dsttime; |
| 566 | _systemcfg->tz_dsttime = sys_tz.tz_dsttime; | ||
| 567 | #endif | ||
| 568 | 565 | ||
| 569 | write_sequnlock_irqrestore(&xtime_lock, flags); | 566 | write_sequnlock_irqrestore(&xtime_lock, flags); |
| 570 | clock_was_set(); | 567 | clock_was_set(); |
| @@ -713,13 +710,12 @@ void __init time_init(void) | |||
| 713 | do_gtod.tb_ticks_per_sec = tb_ticks_per_sec; | 710 | do_gtod.tb_ticks_per_sec = tb_ticks_per_sec; |
| 714 | do_gtod.varp->tb_to_xs = tb_to_xs; | 711 | do_gtod.varp->tb_to_xs = tb_to_xs; |
| 715 | do_gtod.tb_to_us = tb_to_us; | 712 | do_gtod.tb_to_us = tb_to_us; |
| 716 | #ifdef CONFIG_PPC64 | 713 | |
| 717 | _systemcfg->tb_orig_stamp = tb_last_jiffy; | 714 | vdso_data->tb_orig_stamp = tb_last_jiffy; |
| 718 | _systemcfg->tb_update_count = 0; | 715 | vdso_data->tb_update_count = 0; |
| 719 | _systemcfg->tb_ticks_per_sec = tb_ticks_per_sec; | 716 | vdso_data->tb_ticks_per_sec = tb_ticks_per_sec; |
| 720 | _systemcfg->stamp_xsec = xtime.tv_sec * XSEC_PER_SEC; | 717 | vdso_data->stamp_xsec = xtime.tv_sec * XSEC_PER_SEC; |
| 721 | _systemcfg->tb_to_xs = tb_to_xs; | 718 | vdso_data->tb_to_xs = tb_to_xs; |
| 722 | #endif | ||
| 723 | 719 | ||
| 724 | time_freq = 0; | 720 | time_freq = 0; |
| 725 | 721 | ||
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c index 2020bb7648fb..1511454c4690 100644 --- a/arch/powerpc/kernel/traps.c +++ b/arch/powerpc/kernel/traps.c | |||
| @@ -49,7 +49,6 @@ | |||
| 49 | #ifdef CONFIG_PPC64 | 49 | #ifdef CONFIG_PPC64 |
| 50 | #include <asm/firmware.h> | 50 | #include <asm/firmware.h> |
| 51 | #include <asm/processor.h> | 51 | #include <asm/processor.h> |
| 52 | #include <asm/systemcfg.h> | ||
| 53 | #endif | 52 | #endif |
| 54 | 53 | ||
| 55 | #ifdef CONFIG_PPC64 /* XXX */ | 54 | #ifdef CONFIG_PPC64 /* XXX */ |
diff --git a/arch/ppc64/kernel/udbg.c b/arch/powerpc/kernel/udbg.c index 0d878e72fc44..0d878e72fc44 100644 --- a/arch/ppc64/kernel/udbg.c +++ b/arch/powerpc/kernel/udbg.c | |||
diff --git a/arch/ppc64/kernel/udbg_16550.c b/arch/powerpc/kernel/udbg_16550.c index 9313574ab935..9313574ab935 100644 --- a/arch/ppc64/kernel/udbg_16550.c +++ b/arch/powerpc/kernel/udbg_16550.c | |||
diff --git a/arch/ppc64/kernel/udbg_scc.c b/arch/powerpc/kernel/udbg_scc.c index 820c53551507..820c53551507 100644 --- a/arch/ppc64/kernel/udbg_scc.c +++ b/arch/powerpc/kernel/udbg_scc.c | |||
diff --git a/arch/powerpc/kernel/vdso.c b/arch/powerpc/kernel/vdso.c new file mode 100644 index 000000000000..0d4d8bec0df4 --- /dev/null +++ b/arch/powerpc/kernel/vdso.c | |||
| @@ -0,0 +1,746 @@ | |||
| 1 | /* | ||
| 2 | * linux/arch/ppc64/kernel/vdso.c | ||
| 3 | * | ||
| 4 | * Copyright (C) 2004 Benjamin Herrenschmidt, IBM Corp. | ||
| 5 | * <benh@kernel.crashing.org> | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or | ||
| 8 | * modify it under the terms of the GNU General Public License | ||
| 9 | * as published by the Free Software Foundation; either version | ||
| 10 | * 2 of the License, or (at your option) any later version. | ||
| 11 | */ | ||
| 12 | |||
| 13 | #include <linux/config.h> | ||
| 14 | #include <linux/module.h> | ||
| 15 | #include <linux/errno.h> | ||
| 16 | #include <linux/sched.h> | ||
| 17 | #include <linux/kernel.h> | ||
| 18 | #include <linux/mm.h> | ||
| 19 | #include <linux/smp.h> | ||
| 20 | #include <linux/smp_lock.h> | ||
| 21 | #include <linux/stddef.h> | ||
| 22 | #include <linux/unistd.h> | ||
| 23 | #include <linux/slab.h> | ||
| 24 | #include <linux/user.h> | ||
| 25 | #include <linux/elf.h> | ||
| 26 | #include <linux/security.h> | ||
| 27 | #include <linux/bootmem.h> | ||
| 28 | |||
| 29 | #include <asm/pgtable.h> | ||
| 30 | #include <asm/system.h> | ||
| 31 | #include <asm/processor.h> | ||
| 32 | #include <asm/mmu.h> | ||
| 33 | #include <asm/mmu_context.h> | ||
| 34 | #include <asm/lmb.h> | ||
| 35 | #include <asm/machdep.h> | ||
| 36 | #include <asm/cputable.h> | ||
| 37 | #include <asm/sections.h> | ||
| 38 | #include <asm/vdso.h> | ||
| 39 | #include <asm/vdso_datapage.h> | ||
| 40 | |||
| 41 | #undef DEBUG | ||
| 42 | |||
| 43 | #ifdef DEBUG | ||
| 44 | #define DBG(fmt...) printk(fmt) | ||
| 45 | #else | ||
| 46 | #define DBG(fmt...) | ||
| 47 | #endif | ||
| 48 | |||
| 49 | /* Max supported size for symbol names */ | ||
| 50 | #define MAX_SYMNAME 64 | ||
| 51 | |||
| 52 | extern char vdso32_start, vdso32_end; | ||
| 53 | static void *vdso32_kbase = &vdso32_start; | ||
| 54 | unsigned int vdso32_pages; | ||
| 55 | unsigned long vdso32_sigtramp; | ||
| 56 | unsigned long vdso32_rt_sigtramp; | ||
| 57 | |||
| 58 | #ifdef CONFIG_PPC64 | ||
| 59 | extern char vdso64_start, vdso64_end; | ||
| 60 | static void *vdso64_kbase = &vdso64_start; | ||
| 61 | unsigned int vdso64_pages; | ||
| 62 | unsigned long vdso64_rt_sigtramp; | ||
| 63 | #endif /* CONFIG_PPC64 */ | ||
| 64 | |||
| 65 | /* | ||
| 66 | * The vdso data page (aka. systemcfg for old ppc64 fans) is here. | ||
| 67 | * Once the early boot kernel code no longer needs to muck around | ||
| 68 | * with it, it will become dynamically allocated | ||
| 69 | */ | ||
| 70 | static union { | ||
| 71 | struct vdso_data data; | ||
| 72 | u8 page[PAGE_SIZE]; | ||
| 73 | } vdso_data_store __attribute__((__section__(".data.page_aligned"))); | ||
| 74 | struct vdso_data *vdso_data = &vdso_data_store.data; | ||
| 75 | |||
| 76 | /* Format of the patch table */ | ||
| 77 | struct vdso_patch_def | ||
| 78 | { | ||
| 79 | unsigned long ftr_mask, ftr_value; | ||
| 80 | const char *gen_name; | ||
| 81 | const char *fix_name; | ||
| 82 | }; | ||
| 83 | |||
| 84 | /* Table of functions to patch based on the CPU type/revision | ||
| 85 | * | ||
| 86 | * Currently, we only change sync_dicache to do nothing on processors | ||
| 87 | * with a coherent icache | ||
| 88 | */ | ||
| 89 | static struct vdso_patch_def vdso_patches[] = { | ||
| 90 | { | ||
| 91 | CPU_FTR_COHERENT_ICACHE, CPU_FTR_COHERENT_ICACHE, | ||
| 92 | "__kernel_sync_dicache", "__kernel_sync_dicache_p5" | ||
| 93 | }, | ||
| 94 | { | ||
| 95 | CPU_FTR_USE_TB, 0, | ||
| 96 | "__kernel_gettimeofday", NULL | ||
| 97 | }, | ||
| 98 | }; | ||
| 99 | |||
| 100 | /* | ||
| 101 | * Some infos carried around for each of them during parsing at | ||
| 102 | * boot time. | ||
| 103 | */ | ||
| 104 | struct lib32_elfinfo | ||
| 105 | { | ||
| 106 | Elf32_Ehdr *hdr; /* ptr to ELF */ | ||
| 107 | Elf32_Sym *dynsym; /* ptr to .dynsym section */ | ||
| 108 | unsigned long dynsymsize; /* size of .dynsym section */ | ||
| 109 | char *dynstr; /* ptr to .dynstr section */ | ||
| 110 | unsigned long text; /* offset of .text section in .so */ | ||
| 111 | }; | ||
| 112 | |||
| 113 | struct lib64_elfinfo | ||
| 114 | { | ||
| 115 | Elf64_Ehdr *hdr; | ||
| 116 | Elf64_Sym *dynsym; | ||
| 117 | unsigned long dynsymsize; | ||
| 118 | char *dynstr; | ||
| 119 | unsigned long text; | ||
| 120 | }; | ||
| 121 | |||
| 122 | |||
| 123 | #ifdef __DEBUG | ||
| 124 | static void dump_one_vdso_page(struct page *pg, struct page *upg) | ||
| 125 | { | ||
| 126 | printk("kpg: %p (c:%d,f:%08lx)", __va(page_to_pfn(pg) << PAGE_SHIFT), | ||
| 127 | page_count(pg), | ||
| 128 | pg->flags); | ||
| 129 | if (upg/* && pg != upg*/) { | ||
| 130 | printk(" upg: %p (c:%d,f:%08lx)", __va(page_to_pfn(upg) | ||
| 131 | << PAGE_SHIFT), | ||
| 132 | page_count(upg), | ||
| 133 | upg->flags); | ||
| 134 | } | ||
| 135 | printk("\n"); | ||
| 136 | } | ||
| 137 | |||
| 138 | static void dump_vdso_pages(struct vm_area_struct * vma) | ||
| 139 | { | ||
| 140 | int i; | ||
| 141 | |||
| 142 | if (!vma || test_thread_flag(TIF_32BIT)) { | ||
| 143 | printk("vDSO32 @ %016lx:\n", (unsigned long)vdso32_kbase); | ||
| 144 | for (i=0; i<vdso32_pages; i++) { | ||
| 145 | struct page *pg = virt_to_page(vdso32_kbase + | ||
| 146 | i*PAGE_SIZE); | ||
| 147 | struct page *upg = (vma && vma->vm_mm) ? | ||
| 148 | follow_page(vma->vm_mm, vma->vm_start + | ||
| 149 | i*PAGE_SIZE, 0) | ||
| 150 | : NULL; | ||
| 151 | dump_one_vdso_page(pg, upg); | ||
| 152 | } | ||
| 153 | } | ||
| 154 | if (!vma || !test_thread_flag(TIF_32BIT)) { | ||
| 155 | printk("vDSO64 @ %016lx:\n", (unsigned long)vdso64_kbase); | ||
| 156 | for (i=0; i<vdso64_pages; i++) { | ||
| 157 | struct page *pg = virt_to_page(vdso64_kbase + | ||
| 158 | i*PAGE_SIZE); | ||
| 159 | struct page *upg = (vma && vma->vm_mm) ? | ||
| 160 | follow_page(vma->vm_mm, vma->vm_start + | ||
| 161 | i*PAGE_SIZE, 0) | ||
| 162 | : NULL; | ||
| 163 | dump_one_vdso_page(pg, upg); | ||
| 164 | } | ||
| 165 | } | ||
| 166 | } | ||
| 167 | #endif /* DEBUG */ | ||
| 168 | |||
| 169 | /* | ||
| 170 | * Keep a dummy vma_close for now, it will prevent VMA merging. | ||
| 171 | */ | ||
| 172 | static void vdso_vma_close(struct vm_area_struct * vma) | ||
| 173 | { | ||
| 174 | } | ||
| 175 | |||
| 176 | /* | ||
| 177 | * Our nopage() function, maps in the actual vDSO kernel pages, they will | ||
| 178 | * be mapped read-only by do_no_page(), and eventually COW'ed, either | ||
| 179 | * right away for an initial write access, or by do_wp_page(). | ||
| 180 | */ | ||
| 181 | static struct page * vdso_vma_nopage(struct vm_area_struct * vma, | ||
| 182 | unsigned long address, int *type) | ||
| 183 | { | ||
| 184 | unsigned long offset = address - vma->vm_start; | ||
| 185 | struct page *pg; | ||
| 186 | #ifdef CONFIG_PPC64 | ||
| 187 | void *vbase = test_thread_flag(TIF_32BIT) ? | ||
| 188 | vdso32_kbase : vdso64_kbase; | ||
| 189 | #else | ||
| 190 | void *vbase = vdso32_kbase; | ||
| 191 | #endif | ||
| 192 | |||
| 193 | DBG("vdso_vma_nopage(current: %s, address: %016lx, off: %lx)\n", | ||
| 194 | current->comm, address, offset); | ||
| 195 | |||
| 196 | if (address < vma->vm_start || address > vma->vm_end) | ||
| 197 | return NOPAGE_SIGBUS; | ||
| 198 | |||
| 199 | /* | ||
| 200 | * Last page is systemcfg. | ||
| 201 | */ | ||
| 202 | if ((vma->vm_end - address) <= PAGE_SIZE) | ||
| 203 | pg = virt_to_page(vdso_data); | ||
| 204 | else | ||
| 205 | pg = virt_to_page(vbase + offset); | ||
| 206 | |||
| 207 | get_page(pg); | ||
| 208 | DBG(" ->page count: %d\n", page_count(pg)); | ||
| 209 | |||
| 210 | return pg; | ||
| 211 | } | ||
| 212 | |||
| 213 | static struct vm_operations_struct vdso_vmops = { | ||
| 214 | .close = vdso_vma_close, | ||
| 215 | .nopage = vdso_vma_nopage, | ||
| 216 | }; | ||
| 217 | |||
| 218 | /* | ||
| 219 | * This is called from binfmt_elf, we create the special vma for the | ||
| 220 | * vDSO and insert it into the mm struct tree | ||
| 221 | */ | ||
| 222 | int arch_setup_additional_pages(struct linux_binprm *bprm, | ||
| 223 | int executable_stack) | ||
| 224 | { | ||
| 225 | struct mm_struct *mm = current->mm; | ||
| 226 | struct vm_area_struct *vma; | ||
| 227 | unsigned long vdso_pages; | ||
| 228 | unsigned long vdso_base; | ||
| 229 | |||
| 230 | #ifdef CONFIG_PPC64 | ||
| 231 | if (test_thread_flag(TIF_32BIT)) { | ||
| 232 | vdso_pages = vdso32_pages; | ||
| 233 | vdso_base = VDSO32_MBASE; | ||
| 234 | } else { | ||
| 235 | vdso_pages = vdso64_pages; | ||
| 236 | vdso_base = VDSO64_MBASE; | ||
| 237 | } | ||
| 238 | #else | ||
| 239 | vdso_pages = vdso32_pages; | ||
| 240 | vdso_base = VDSO32_MBASE; | ||
| 241 | #endif | ||
| 242 | |||
| 243 | current->thread.vdso_base = 0; | ||
| 244 | |||
| 245 | /* vDSO has a problem and was disabled, just don't "enable" it for the | ||
| 246 | * process | ||
| 247 | */ | ||
| 248 | if (vdso_pages == 0) | ||
| 249 | return 0; | ||
| 250 | |||
| 251 | vma = kmem_cache_alloc(vm_area_cachep, SLAB_KERNEL); | ||
| 252 | if (vma == NULL) | ||
| 253 | return -ENOMEM; | ||
| 254 | |||
| 255 | memset(vma, 0, sizeof(*vma)); | ||
| 256 | |||
| 257 | /* Add a page to the vdso size for the data page */ | ||
| 258 | vdso_pages ++; | ||
| 259 | |||
| 260 | /* | ||
| 261 | * pick a base address for the vDSO in process space. We try to put it | ||
| 262 | * at vdso_base which is the "natural" base for it, but we might fail | ||
| 263 | * and end up putting it elsewhere. | ||
| 264 | */ | ||
| 265 | vdso_base = get_unmapped_area(NULL, vdso_base, | ||
| 266 | vdso_pages << PAGE_SHIFT, 0, 0); | ||
| 267 | if (vdso_base & ~PAGE_MASK) { | ||
| 268 | kmem_cache_free(vm_area_cachep, vma); | ||
| 269 | return (int)vdso_base; | ||
| 270 | } | ||
| 271 | |||
| 272 | current->thread.vdso_base = vdso_base; | ||
| 273 | |||
| 274 | vma->vm_mm = mm; | ||
| 275 | vma->vm_start = current->thread.vdso_base; | ||
| 276 | vma->vm_end = vma->vm_start + (vdso_pages << PAGE_SHIFT); | ||
| 277 | |||
| 278 | /* | ||
| 279 | * our vma flags don't have VM_WRITE so by default, the process isn't | ||
| 280 | * allowed to write those pages. | ||
| 281 | * gdb can break that with ptrace interface, and thus trigger COW on | ||
| 282 | * those pages but it's then your responsibility to never do that on | ||
| 283 | * the "data" page of the vDSO or you'll stop getting kernel updates | ||
| 284 | * and your nice userland gettimeofday will be totally dead. | ||
| 285 | * It's fine to use that for setting breakpoints in the vDSO code | ||
| 286 | * pages though | ||
| 287 | */ | ||
| 288 | vma->vm_flags = VM_READ | VM_EXEC | VM_MAYREAD | VM_MAYWRITE | | ||
| 289 | VM_MAYEXEC | VM_RESERVED; | ||
| 290 | vma->vm_flags |= mm->def_flags; | ||
| 291 | vma->vm_page_prot = protection_map[vma->vm_flags & 0x7]; | ||
| 292 | vma->vm_ops = &vdso_vmops; | ||
| 293 | |||
| 294 | down_write(&mm->mmap_sem); | ||
| 295 | if (insert_vm_struct(mm, vma)) { | ||
| 296 | up_write(&mm->mmap_sem); | ||
| 297 | kmem_cache_free(vm_area_cachep, vma); | ||
| 298 | return -ENOMEM; | ||
| 299 | } | ||
| 300 | mm->total_vm += (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; | ||
| 301 | up_write(&mm->mmap_sem); | ||
| 302 | |||
| 303 | return 0; | ||
| 304 | } | ||
| 305 | |||
| 306 | static void * __init find_section32(Elf32_Ehdr *ehdr, const char *secname, | ||
| 307 | unsigned long *size) | ||
| 308 | { | ||
| 309 | Elf32_Shdr *sechdrs; | ||
| 310 | unsigned int i; | ||
| 311 | char *secnames; | ||
| 312 | |||
| 313 | /* Grab section headers and strings so we can tell who is who */ | ||
| 314 | sechdrs = (void *)ehdr + ehdr->e_shoff; | ||
| 315 | secnames = (void *)ehdr + sechdrs[ehdr->e_shstrndx].sh_offset; | ||
| 316 | |||
| 317 | /* Find the section they want */ | ||
| 318 | for (i = 1; i < ehdr->e_shnum; i++) { | ||
| 319 | if (strcmp(secnames+sechdrs[i].sh_name, secname) == 0) { | ||
| 320 | if (size) | ||
| 321 | *size = sechdrs[i].sh_size; | ||
| 322 | return (void *)ehdr + sechdrs[i].sh_offset; | ||
| 323 | } | ||
| 324 | } | ||
| 325 | *size = 0; | ||
| 326 | return NULL; | ||
| 327 | } | ||
| 328 | |||
| 329 | static Elf32_Sym * __init find_symbol32(struct lib32_elfinfo *lib, | ||
| 330 | const char *symname) | ||
| 331 | { | ||
| 332 | unsigned int i; | ||
| 333 | char name[MAX_SYMNAME], *c; | ||
| 334 | |||
| 335 | for (i = 0; i < (lib->dynsymsize / sizeof(Elf32_Sym)); i++) { | ||
| 336 | if (lib->dynsym[i].st_name == 0) | ||
| 337 | continue; | ||
| 338 | strlcpy(name, lib->dynstr + lib->dynsym[i].st_name, | ||
| 339 | MAX_SYMNAME); | ||
| 340 | c = strchr(name, '@'); | ||
| 341 | if (c) | ||
| 342 | *c = 0; | ||
| 343 | if (strcmp(symname, name) == 0) | ||
| 344 | return &lib->dynsym[i]; | ||
| 345 | } | ||
| 346 | return NULL; | ||
| 347 | } | ||
| 348 | |||
| 349 | /* Note that we assume the section is .text and the symbol is relative to | ||
| 350 | * the library base | ||
| 351 | */ | ||
| 352 | static unsigned long __init find_function32(struct lib32_elfinfo *lib, | ||
| 353 | const char *symname) | ||
| 354 | { | ||
| 355 | Elf32_Sym *sym = find_symbol32(lib, symname); | ||
| 356 | |||
| 357 | if (sym == NULL) { | ||
| 358 | printk(KERN_WARNING "vDSO32: function %s not found !\n", | ||
| 359 | symname); | ||
| 360 | return 0; | ||
| 361 | } | ||
| 362 | return sym->st_value - VDSO32_LBASE; | ||
| 363 | } | ||
| 364 | |||
| 365 | static int vdso_do_func_patch32(struct lib32_elfinfo *v32, | ||
| 366 | struct lib64_elfinfo *v64, | ||
| 367 | const char *orig, const char *fix) | ||
| 368 | { | ||
| 369 | Elf32_Sym *sym32_gen, *sym32_fix; | ||
| 370 | |||
| 371 | sym32_gen = find_symbol32(v32, orig); | ||
| 372 | if (sym32_gen == NULL) { | ||
| 373 | printk(KERN_ERR "vDSO32: Can't find symbol %s !\n", orig); | ||
| 374 | return -1; | ||
| 375 | } | ||
| 376 | if (fix == NULL) { | ||
| 377 | sym32_gen->st_name = 0; | ||
| 378 | return 0; | ||
| 379 | } | ||
| 380 | sym32_fix = find_symbol32(v32, fix); | ||
| 381 | if (sym32_fix == NULL) { | ||
| 382 | printk(KERN_ERR "vDSO32: Can't find symbol %s !\n", fix); | ||
| 383 | return -1; | ||
| 384 | } | ||
| 385 | sym32_gen->st_value = sym32_fix->st_value; | ||
| 386 | sym32_gen->st_size = sym32_fix->st_size; | ||
| 387 | sym32_gen->st_info = sym32_fix->st_info; | ||
| 388 | sym32_gen->st_other = sym32_fix->st_other; | ||
| 389 | sym32_gen->st_shndx = sym32_fix->st_shndx; | ||
| 390 | |||
| 391 | return 0; | ||
| 392 | } | ||
| 393 | |||
| 394 | |||
| 395 | #ifdef CONFIG_PPC64 | ||
| 396 | |||
| 397 | static void * __init find_section64(Elf64_Ehdr *ehdr, const char *secname, | ||
| 398 | unsigned long *size) | ||
| 399 | { | ||
| 400 | Elf64_Shdr *sechdrs; | ||
| 401 | unsigned int i; | ||
| 402 | char *secnames; | ||
| 403 | |||
| 404 | /* Grab section headers and strings so we can tell who is who */ | ||
| 405 | sechdrs = (void *)ehdr + ehdr->e_shoff; | ||
| 406 | secnames = (void *)ehdr + sechdrs[ehdr->e_shstrndx].sh_offset; | ||
| 407 | |||
| 408 | /* Find the section they want */ | ||
| 409 | for (i = 1; i < ehdr->e_shnum; i++) { | ||
| 410 | if (strcmp(secnames+sechdrs[i].sh_name, secname) == 0) { | ||
| 411 | if (size) | ||
| 412 | *size = sechdrs[i].sh_size; | ||
| 413 | return (void *)ehdr + sechdrs[i].sh_offset; | ||
| 414 | } | ||
| 415 | } | ||
| 416 | if (size) | ||
| 417 | *size = 0; | ||
| 418 | return NULL; | ||
| 419 | } | ||
| 420 | |||
| 421 | static Elf64_Sym * __init find_symbol64(struct lib64_elfinfo *lib, | ||
| 422 | const char *symname) | ||
| 423 | { | ||
| 424 | unsigned int i; | ||
| 425 | char name[MAX_SYMNAME], *c; | ||
| 426 | |||
| 427 | for (i = 0; i < (lib->dynsymsize / sizeof(Elf64_Sym)); i++) { | ||
| 428 | if (lib->dynsym[i].st_name == 0) | ||
| 429 | continue; | ||
| 430 | strlcpy(name, lib->dynstr + lib->dynsym[i].st_name, | ||
| 431 | MAX_SYMNAME); | ||
| 432 | c = strchr(name, '@'); | ||
| 433 | if (c) | ||
| 434 | *c = 0; | ||
| 435 | if (strcmp(symname, name) == 0) | ||
| 436 | return &lib->dynsym[i]; | ||
| 437 | } | ||
| 438 | return NULL; | ||
| 439 | } | ||
| 440 | |||
| 441 | /* Note that we assume the section is .text and the symbol is relative to | ||
| 442 | * the library base | ||
| 443 | */ | ||
| 444 | static unsigned long __init find_function64(struct lib64_elfinfo *lib, | ||
| 445 | const char *symname) | ||
| 446 | { | ||
| 447 | Elf64_Sym *sym = find_symbol64(lib, symname); | ||
| 448 | |||
| 449 | if (sym == NULL) { | ||
| 450 | printk(KERN_WARNING "vDSO64: function %s not found !\n", | ||
| 451 | symname); | ||
| 452 | return 0; | ||
| 453 | } | ||
| 454 | #ifdef VDS64_HAS_DESCRIPTORS | ||
| 455 | return *((u64 *)(vdso64_kbase + sym->st_value - VDSO64_LBASE)) - | ||
| 456 | VDSO64_LBASE; | ||
| 457 | #else | ||
| 458 | return sym->st_value - VDSO64_LBASE; | ||
| 459 | #endif | ||
| 460 | } | ||
| 461 | |||
| 462 | static int vdso_do_func_patch64(struct lib32_elfinfo *v32, | ||
| 463 | struct lib64_elfinfo *v64, | ||
| 464 | const char *orig, const char *fix) | ||
| 465 | { | ||
| 466 | Elf64_Sym *sym64_gen, *sym64_fix; | ||
| 467 | |||
| 468 | sym64_gen = find_symbol64(v64, orig); | ||
| 469 | if (sym64_gen == NULL) { | ||
| 470 | printk(KERN_ERR "vDSO64: Can't find symbol %s !\n", orig); | ||
| 471 | return -1; | ||
| 472 | } | ||
| 473 | if (fix == NULL) { | ||
| 474 | sym64_gen->st_name = 0; | ||
| 475 | return 0; | ||
| 476 | } | ||
| 477 | sym64_fix = find_symbol64(v64, fix); | ||
| 478 | if (sym64_fix == NULL) { | ||
| 479 | printk(KERN_ERR "vDSO64: Can't find symbol %s !\n", fix); | ||
| 480 | return -1; | ||
| 481 | } | ||
| 482 | sym64_gen->st_value = sym64_fix->st_value; | ||
| 483 | sym64_gen->st_size = sym64_fix->st_size; | ||
| 484 | sym64_gen->st_info = sym64_fix->st_info; | ||
| 485 | sym64_gen->st_other = sym64_fix->st_other; | ||
| 486 | sym64_gen->st_shndx = sym64_fix->st_shndx; | ||
| 487 | |||
| 488 | return 0; | ||
| 489 | } | ||
| 490 | |||
| 491 | #endif /* CONFIG_PPC64 */ | ||
| 492 | |||
| 493 | |||
| 494 | static __init int vdso_do_find_sections(struct lib32_elfinfo *v32, | ||
| 495 | struct lib64_elfinfo *v64) | ||
| 496 | { | ||
| 497 | void *sect; | ||
| 498 | |||
| 499 | /* | ||
| 500 | * Locate symbol tables & text section | ||
| 501 | */ | ||
| 502 | |||
| 503 | v32->dynsym = find_section32(v32->hdr, ".dynsym", &v32->dynsymsize); | ||
| 504 | v32->dynstr = find_section32(v32->hdr, ".dynstr", NULL); | ||
| 505 | if (v32->dynsym == NULL || v32->dynstr == NULL) { | ||
| 506 | printk(KERN_ERR "vDSO32: required symbol section not found\n"); | ||
| 507 | return -1; | ||
| 508 | } | ||
| 509 | sect = find_section32(v32->hdr, ".text", NULL); | ||
| 510 | if (sect == NULL) { | ||
| 511 | printk(KERN_ERR "vDSO32: the .text section was not found\n"); | ||
| 512 | return -1; | ||
| 513 | } | ||
| 514 | v32->text = sect - vdso32_kbase; | ||
| 515 | |||
| 516 | #ifdef CONFIG_PPC64 | ||
| 517 | v64->dynsym = find_section64(v64->hdr, ".dynsym", &v64->dynsymsize); | ||
| 518 | v64->dynstr = find_section64(v64->hdr, ".dynstr", NULL); | ||
| 519 | if (v64->dynsym == NULL || v64->dynstr == NULL) { | ||
| 520 | printk(KERN_ERR "vDSO64: required symbol section not found\n"); | ||
| 521 | return -1; | ||
| 522 | } | ||
| 523 | sect = find_section64(v64->hdr, ".text", NULL); | ||
| 524 | if (sect == NULL) { | ||
| 525 | printk(KERN_ERR "vDSO64: the .text section was not found\n"); | ||
| 526 | return -1; | ||
| 527 | } | ||
| 528 | v64->text = sect - vdso64_kbase; | ||
| 529 | #endif /* CONFIG_PPC64 */ | ||
| 530 | |||
| 531 | return 0; | ||
| 532 | } | ||
| 533 | |||
| 534 | static __init void vdso_setup_trampolines(struct lib32_elfinfo *v32, | ||
| 535 | struct lib64_elfinfo *v64) | ||
| 536 | { | ||
| 537 | /* | ||
| 538 | * Find signal trampolines | ||
| 539 | */ | ||
| 540 | |||
| 541 | #ifdef CONFIG_PPC64 | ||
| 542 | vdso64_rt_sigtramp = find_function64(v64, "__kernel_sigtramp_rt64"); | ||
| 543 | #endif | ||
| 544 | vdso32_sigtramp = find_function32(v32, "__kernel_sigtramp32"); | ||
| 545 | vdso32_rt_sigtramp = find_function32(v32, "__kernel_sigtramp_rt32"); | ||
| 546 | } | ||
| 547 | |||
| 548 | static __init int vdso_fixup_datapage(struct lib32_elfinfo *v32, | ||
| 549 | struct lib64_elfinfo *v64) | ||
| 550 | { | ||
| 551 | Elf32_Sym *sym32; | ||
| 552 | #ifdef CONFIG_PPC64 | ||
| 553 | Elf64_Sym *sym64; | ||
| 554 | |||
| 555 | sym64 = find_symbol64(v64, "__kernel_datapage_offset"); | ||
| 556 | if (sym64 == NULL) { | ||
| 557 | printk(KERN_ERR "vDSO64: Can't find symbol " | ||
| 558 | "__kernel_datapage_offset !\n"); | ||
| 559 | return -1; | ||
| 560 | } | ||
| 561 | *((int *)(vdso64_kbase + sym64->st_value - VDSO64_LBASE)) = | ||
| 562 | (vdso64_pages << PAGE_SHIFT) - | ||
| 563 | (sym64->st_value - VDSO64_LBASE); | ||
| 564 | #endif /* CONFIG_PPC64 */ | ||
| 565 | |||
| 566 | sym32 = find_symbol32(v32, "__kernel_datapage_offset"); | ||
| 567 | if (sym32 == NULL) { | ||
| 568 | printk(KERN_ERR "vDSO32: Can't find symbol " | ||
| 569 | "__kernel_datapage_offset !\n"); | ||
| 570 | return -1; | ||
| 571 | } | ||
| 572 | *((int *)(vdso32_kbase + (sym32->st_value - VDSO32_LBASE))) = | ||
| 573 | (vdso32_pages << PAGE_SHIFT) - | ||
| 574 | (sym32->st_value - VDSO32_LBASE); | ||
| 575 | |||
| 576 | return 0; | ||
| 577 | } | ||
| 578 | |||
| 579 | static __init int vdso_fixup_alt_funcs(struct lib32_elfinfo *v32, | ||
| 580 | struct lib64_elfinfo *v64) | ||
| 581 | { | ||
| 582 | int i; | ||
| 583 | |||
| 584 | for (i = 0; i < ARRAY_SIZE(vdso_patches); i++) { | ||
| 585 | struct vdso_patch_def *patch = &vdso_patches[i]; | ||
| 586 | int match = (cur_cpu_spec->cpu_features & patch->ftr_mask) | ||
| 587 | == patch->ftr_value; | ||
| 588 | if (!match) | ||
| 589 | continue; | ||
| 590 | |||
| 591 | DBG("replacing %s with %s...\n", patch->gen_name, | ||
| 592 | patch->fix_name ? "NONE" : patch->fix_name); | ||
| 593 | |||
| 594 | /* | ||
| 595 | * Patch the 32 bits and 64 bits symbols. Note that we do not | ||
| 596 | * patch the "." symbol on 64 bits. | ||
| 597 | * It would be easy to do, but doesn't seem to be necessary, | ||
| 598 | * patching the OPD symbol is enough. | ||
| 599 | */ | ||
| 600 | vdso_do_func_patch32(v32, v64, patch->gen_name, | ||
| 601 | patch->fix_name); | ||
| 602 | #ifdef CONFIG_PPC64 | ||
| 603 | vdso_do_func_patch64(v32, v64, patch->gen_name, | ||
| 604 | patch->fix_name); | ||
| 605 | #endif /* CONFIG_PPC64 */ | ||
| 606 | } | ||
| 607 | |||
| 608 | return 0; | ||
| 609 | } | ||
| 610 | |||
| 611 | |||
| 612 | static __init int vdso_setup(void) | ||
| 613 | { | ||
| 614 | struct lib32_elfinfo v32; | ||
| 615 | struct lib64_elfinfo v64; | ||
| 616 | |||
| 617 | v32.hdr = vdso32_kbase; | ||
| 618 | #ifdef CONFIG_PPC64 | ||
| 619 | v64.hdr = vdso64_kbase; | ||
| 620 | #endif | ||
| 621 | if (vdso_do_find_sections(&v32, &v64)) | ||
| 622 | return -1; | ||
| 623 | |||
| 624 | if (vdso_fixup_datapage(&v32, &v64)) | ||
| 625 | return -1; | ||
| 626 | |||
| 627 | if (vdso_fixup_alt_funcs(&v32, &v64)) | ||
| 628 | return -1; | ||
| 629 | |||
| 630 | vdso_setup_trampolines(&v32, &v64); | ||
| 631 | |||
| 632 | return 0; | ||
| 633 | } | ||
| 634 | |||
| 635 | /* | ||
| 636 | * Called from setup_arch to initialize the bitmap of available | ||
| 637 | * syscalls in the systemcfg page | ||
| 638 | */ | ||
| 639 | static void __init vdso_setup_syscall_map(void) | ||
| 640 | { | ||
| 641 | unsigned int i; | ||
| 642 | extern unsigned long *sys_call_table; | ||
| 643 | extern unsigned long sys_ni_syscall; | ||
| 644 | |||
| 645 | |||
| 646 | for (i = 0; i < __NR_syscalls; i++) { | ||
| 647 | #ifdef CONFIG_PPC64 | ||
| 648 | if (sys_call_table[i*2] != sys_ni_syscall) | ||
| 649 | vdso_data->syscall_map_64[i >> 5] |= | ||
| 650 | 0x80000000UL >> (i & 0x1f); | ||
| 651 | if (sys_call_table[i*2+1] != sys_ni_syscall) | ||
| 652 | vdso_data->syscall_map_32[i >> 5] |= | ||
| 653 | 0x80000000UL >> (i & 0x1f); | ||
| 654 | #else /* CONFIG_PPC64 */ | ||
| 655 | if (sys_call_table[i] != sys_ni_syscall) | ||
| 656 | vdso_data->syscall_map_32[i >> 5] |= | ||
| 657 | 0x80000000UL >> (i & 0x1f); | ||
| 658 | #endif /* CONFIG_PPC64 */ | ||
| 659 | } | ||
| 660 | } | ||
| 661 | |||
| 662 | |||
| 663 | void __init vdso_init(void) | ||
| 664 | { | ||
| 665 | int i; | ||
| 666 | |||
| 667 | #ifdef CONFIG_PPC64 | ||
| 668 | /* | ||
| 669 | * Fill up the "systemcfg" stuff for backward compatiblity | ||
| 670 | */ | ||
| 671 | strcpy(vdso_data->eye_catcher, "SYSTEMCFG:PPC64"); | ||
| 672 | vdso_data->version.major = SYSTEMCFG_MAJOR; | ||
| 673 | vdso_data->version.minor = SYSTEMCFG_MINOR; | ||
| 674 | vdso_data->processor = mfspr(SPRN_PVR); | ||
| 675 | vdso_data->platform = _machine; | ||
| 676 | vdso_data->physicalMemorySize = lmb_phys_mem_size(); | ||
| 677 | vdso_data->dcache_size = ppc64_caches.dsize; | ||
| 678 | vdso_data->dcache_line_size = ppc64_caches.dline_size; | ||
| 679 | vdso_data->icache_size = ppc64_caches.isize; | ||
| 680 | vdso_data->icache_line_size = ppc64_caches.iline_size; | ||
| 681 | |||
| 682 | /* | ||
| 683 | * Calculate the size of the 64 bits vDSO | ||
| 684 | */ | ||
| 685 | vdso64_pages = (&vdso64_end - &vdso64_start) >> PAGE_SHIFT; | ||
| 686 | DBG("vdso64_kbase: %p, 0x%x pages\n", vdso64_kbase, vdso64_pages); | ||
| 687 | #endif /* CONFIG_PPC64 */ | ||
| 688 | |||
| 689 | |||
| 690 | /* | ||
| 691 | * Calculate the size of the 32 bits vDSO | ||
| 692 | */ | ||
| 693 | vdso32_pages = (&vdso32_end - &vdso32_start) >> PAGE_SHIFT; | ||
| 694 | DBG("vdso32_kbase: %p, 0x%x pages\n", vdso32_kbase, vdso32_pages); | ||
| 695 | |||
| 696 | |||
| 697 | /* | ||
| 698 | * Setup the syscall map in the vDOS | ||
| 699 | */ | ||
| 700 | vdso_setup_syscall_map(); | ||
| 701 | /* | ||
| 702 | * Initialize the vDSO images in memory, that is do necessary | ||
| 703 | * fixups of vDSO symbols, locate trampolines, etc... | ||
| 704 | */ | ||
| 705 | if (vdso_setup()) { | ||
| 706 | printk(KERN_ERR "vDSO setup failure, not enabled !\n"); | ||
| 707 | vdso32_pages = 0; | ||
| 708 | #ifdef CONFIG_PPC64 | ||
| 709 | vdso64_pages = 0; | ||
| 710 | #endif | ||
| 711 | return; | ||
| 712 | } | ||
| 713 | |||
| 714 | /* Make sure pages are in the correct state */ | ||
| 715 | for (i = 0; i < vdso32_pages; i++) { | ||
| 716 | struct page *pg = virt_to_page(vdso32_kbase + i*PAGE_SIZE); | ||
| 717 | ClearPageReserved(pg); | ||
| 718 | get_page(pg); | ||
| 719 | |||
| 720 | } | ||
| 721 | #ifdef CONFIG_PPC64 | ||
| 722 | for (i = 0; i < vdso64_pages; i++) { | ||
| 723 | struct page *pg = virt_to_page(vdso64_kbase + i*PAGE_SIZE); | ||
| 724 | ClearPageReserved(pg); | ||
| 725 | get_page(pg); | ||
| 726 | } | ||
| 727 | #endif /* CONFIG_PPC64 */ | ||
| 728 | |||
| 729 | get_page(virt_to_page(vdso_data)); | ||
| 730 | } | ||
| 731 | |||
| 732 | int in_gate_area_no_task(unsigned long addr) | ||
| 733 | { | ||
| 734 | return 0; | ||
| 735 | } | ||
| 736 | |||
| 737 | int in_gate_area(struct task_struct *task, unsigned long addr) | ||
| 738 | { | ||
| 739 | return 0; | ||
| 740 | } | ||
| 741 | |||
| 742 | struct vm_area_struct *get_gate_vma(struct task_struct *tsk) | ||
| 743 | { | ||
| 744 | return NULL; | ||
| 745 | } | ||
| 746 | |||
diff --git a/arch/ppc64/kernel/vdso32/Makefile b/arch/powerpc/kernel/vdso32/Makefile index 0b1b0df973eb..8a3bed5f143a 100644 --- a/arch/ppc64/kernel/vdso32/Makefile +++ b/arch/powerpc/kernel/vdso32/Makefile | |||
| @@ -5,6 +5,10 @@ obj-vdso32 = sigtramp.o gettimeofday.o datapage.o cacheflush.o note.o | |||
| 5 | 5 | ||
| 6 | # Build rules | 6 | # Build rules |
| 7 | 7 | ||
| 8 | ifeq ($(CONFIG_PPC32),y) | ||
| 9 | CROSS32CC := $(CC) | ||
| 10 | endif | ||
| 11 | |||
| 8 | targets := $(obj-vdso32) vdso32.so | 12 | targets := $(obj-vdso32) vdso32.so |
| 9 | obj-vdso32 := $(addprefix $(obj)/, $(obj-vdso32)) | 13 | obj-vdso32 := $(addprefix $(obj)/, $(obj-vdso32)) |
| 10 | 14 | ||
| @@ -15,7 +19,7 @@ EXTRA_AFLAGS := -D__VDSO32__ -s | |||
| 15 | 19 | ||
| 16 | obj-y += vdso32_wrapper.o | 20 | obj-y += vdso32_wrapper.o |
| 17 | extra-y += vdso32.lds | 21 | extra-y += vdso32.lds |
| 18 | CPPFLAGS_vdso32.lds += -P -C -U$(ARCH) | 22 | CPPFLAGS_vdso32.lds += -P -C -Upowerpc |
| 19 | 23 | ||
| 20 | # Force dependency (incbin is bad) | 24 | # Force dependency (incbin is bad) |
| 21 | $(obj)/vdso32_wrapper.o : $(obj)/vdso32.so | 25 | $(obj)/vdso32_wrapper.o : $(obj)/vdso32.so |
diff --git a/arch/ppc64/kernel/vdso32/cacheflush.S b/arch/powerpc/kernel/vdso32/cacheflush.S index c8db993574ee..c8db993574ee 100644 --- a/arch/ppc64/kernel/vdso32/cacheflush.S +++ b/arch/powerpc/kernel/vdso32/cacheflush.S | |||
diff --git a/arch/ppc64/kernel/vdso32/datapage.S b/arch/powerpc/kernel/vdso32/datapage.S index 4f4eb0be3992..a08c26e87835 100644 --- a/arch/ppc64/kernel/vdso32/datapage.S +++ b/arch/powerpc/kernel/vdso32/datapage.S | |||
| @@ -66,3 +66,19 @@ V_FUNCTION_BEGIN(__kernel_get_syscall_map) | |||
| 66 | blr | 66 | blr |
| 67 | .cfi_endproc | 67 | .cfi_endproc |
| 68 | V_FUNCTION_END(__kernel_get_syscall_map) | 68 | V_FUNCTION_END(__kernel_get_syscall_map) |
| 69 | |||
| 70 | /* | ||
| 71 | * void unsigned long long __kernel_get_tbfreq(void); | ||
| 72 | * | ||
| 73 | * returns the timebase frequency in HZ | ||
| 74 | */ | ||
| 75 | V_FUNCTION_BEGIN(__kernel_get_tbfreq) | ||
| 76 | .cfi_startproc | ||
| 77 | mflr r12 | ||
| 78 | .cfi_register lr,r12 | ||
| 79 | bl __get_datapage@local | ||
| 80 | lwz r3,CFG_TB_TICKS_PER_SEC(r3) | ||
| 81 | lwz r4,(CFG_TB_TICKS_PER_SEC + 4)(r3) | ||
| 82 | mtlr r12 | ||
| 83 | .cfi_endproc | ||
| 84 | V_FUNCTION_END(__kernel_get_tbfreq) | ||
diff --git a/arch/powerpc/kernel/vdso32/gettimeofday.S b/arch/powerpc/kernel/vdso32/gettimeofday.S new file mode 100644 index 000000000000..aeb5fc9b87b3 --- /dev/null +++ b/arch/powerpc/kernel/vdso32/gettimeofday.S | |||
| @@ -0,0 +1,315 @@ | |||
| 1 | /* | ||
| 2 | * Userland implementation of gettimeofday() for 32 bits processes in a | ||
| 3 | * ppc64 kernel for use in the vDSO | ||
| 4 | * | ||
| 5 | * Copyright (C) 2004 Benjamin Herrenschmuidt (benh@kernel.crashing.org, | ||
| 6 | * IBM Corp. | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or | ||
| 9 | * modify it under the terms of the GNU General Public License | ||
| 10 | * as published by the Free Software Foundation; either version | ||
| 11 | * 2 of the License, or (at your option) any later version. | ||
| 12 | */ | ||
| 13 | #include <linux/config.h> | ||
| 14 | #include <asm/processor.h> | ||
| 15 | #include <asm/ppc_asm.h> | ||
| 16 | #include <asm/vdso.h> | ||
| 17 | #include <asm/asm-offsets.h> | ||
| 18 | #include <asm/unistd.h> | ||
| 19 | |||
| 20 | .text | ||
| 21 | /* | ||
| 22 | * Exact prototype of gettimeofday | ||
| 23 | * | ||
| 24 | * int __kernel_gettimeofday(struct timeval *tv, struct timezone *tz); | ||
| 25 | * | ||
| 26 | */ | ||
| 27 | V_FUNCTION_BEGIN(__kernel_gettimeofday) | ||
| 28 | .cfi_startproc | ||
| 29 | mflr r12 | ||
| 30 | .cfi_register lr,r12 | ||
| 31 | |||
| 32 | mr r10,r3 /* r10 saves tv */ | ||
| 33 | mr r11,r4 /* r11 saves tz */ | ||
| 34 | bl __get_datapage@local /* get data page */ | ||
| 35 | mr r9, r3 /* datapage ptr in r9 */ | ||
| 36 | bl __do_get_xsec@local /* get xsec from tb & kernel */ | ||
| 37 | bne- 2f /* out of line -> do syscall */ | ||
| 38 | |||
| 39 | /* seconds are xsec >> 20 */ | ||
| 40 | rlwinm r5,r4,12,20,31 | ||
| 41 | rlwimi r5,r3,12,0,19 | ||
| 42 | stw r5,TVAL32_TV_SEC(r10) | ||
| 43 | |||
| 44 | /* get remaining xsec and convert to usec. we scale | ||
| 45 | * up remaining xsec by 12 bits and get the top 32 bits | ||
| 46 | * of the multiplication | ||
| 47 | */ | ||
| 48 | rlwinm r5,r4,12,0,19 | ||
| 49 | lis r6,1000000@h | ||
| 50 | ori r6,r6,1000000@l | ||
| 51 | mulhwu r5,r5,r6 | ||
| 52 | stw r5,TVAL32_TV_USEC(r10) | ||
| 53 | |||
| 54 | cmpli cr0,r11,0 /* check if tz is NULL */ | ||
| 55 | beq 1f | ||
| 56 | lwz r4,CFG_TZ_MINUTEWEST(r9)/* fill tz */ | ||
| 57 | lwz r5,CFG_TZ_DSTTIME(r9) | ||
| 58 | stw r4,TZONE_TZ_MINWEST(r11) | ||
| 59 | stw r5,TZONE_TZ_DSTTIME(r11) | ||
| 60 | |||
| 61 | 1: mtlr r12 | ||
| 62 | li r3,0 | ||
| 63 | blr | ||
| 64 | |||
| 65 | 2: | ||
| 66 | mtlr r12 | ||
| 67 | mr r3,r10 | ||
| 68 | mr r4,r11 | ||
| 69 | li r0,__NR_gettimeofday | ||
| 70 | sc | ||
| 71 | blr | ||
| 72 | .cfi_endproc | ||
| 73 | V_FUNCTION_END(__kernel_gettimeofday) | ||
| 74 | |||
| 75 | /* | ||
| 76 | * Exact prototype of clock_gettime() | ||
| 77 | * | ||
| 78 | * int __kernel_clock_gettime(clockid_t clock_id, struct timespec *tp); | ||
| 79 | * | ||
| 80 | */ | ||
| 81 | V_FUNCTION_BEGIN(__kernel_clock_gettime) | ||
| 82 | .cfi_startproc | ||
| 83 | /* Check for supported clock IDs */ | ||
| 84 | cmpli cr0,r3,CLOCK_REALTIME | ||
| 85 | cmpli cr1,r3,CLOCK_MONOTONIC | ||
| 86 | cror cr0,cr0,cr1 | ||
| 87 | bne cr0,99f | ||
| 88 | |||
| 89 | mflr r12 /* r12 saves lr */ | ||
| 90 | .cfi_register lr,r12 | ||
| 91 | mr r10,r3 /* r10 saves id */ | ||
| 92 | mr r11,r4 /* r11 saves tp */ | ||
| 93 | bl __get_datapage@local /* get data page */ | ||
| 94 | mr r9, r3 /* datapage ptr in r9 */ | ||
| 95 | beq cr1,50f /* if monotonic -> jump there */ | ||
| 96 | |||
| 97 | /* | ||
| 98 | * CLOCK_REALTIME | ||
| 99 | */ | ||
| 100 | |||
| 101 | bl __do_get_xsec@local /* get xsec from tb & kernel */ | ||
| 102 | bne- 98f /* out of line -> do syscall */ | ||
| 103 | |||
| 104 | /* seconds are xsec >> 20 */ | ||
| 105 | rlwinm r5,r4,12,20,31 | ||
| 106 | rlwimi r5,r3,12,0,19 | ||
| 107 | stw r5,TSPC32_TV_SEC(r11) | ||
| 108 | |||
| 109 | /* get remaining xsec and convert to nsec. we scale | ||
| 110 | * up remaining xsec by 12 bits and get the top 32 bits | ||
| 111 | * of the multiplication, then we multiply by 1000 | ||
| 112 | */ | ||
| 113 | rlwinm r5,r4,12,0,19 | ||
| 114 | lis r6,1000000@h | ||
| 115 | ori r6,r6,1000000@l | ||
| 116 | mulhwu r5,r5,r6 | ||
| 117 | mulli r5,r5,1000 | ||
| 118 | stw r5,TSPC32_TV_NSEC(r11) | ||
| 119 | mtlr r12 | ||
| 120 | li r3,0 | ||
| 121 | blr | ||
| 122 | |||
| 123 | /* | ||
| 124 | * CLOCK_MONOTONIC | ||
| 125 | */ | ||
| 126 | |||
| 127 | 50: bl __do_get_xsec@local /* get xsec from tb & kernel */ | ||
| 128 | bne- 98f /* out of line -> do syscall */ | ||
| 129 | |||
| 130 | /* seconds are xsec >> 20 */ | ||
| 131 | rlwinm r6,r4,12,20,31 | ||
| 132 | rlwimi r6,r3,12,0,19 | ||
| 133 | |||
| 134 | /* get remaining xsec and convert to nsec. we scale | ||
| 135 | * up remaining xsec by 12 bits and get the top 32 bits | ||
| 136 | * of the multiplication, then we multiply by 1000 | ||
| 137 | */ | ||
| 138 | rlwinm r7,r4,12,0,19 | ||
| 139 | lis r5,1000000@h | ||
| 140 | ori r5,r5,1000000@l | ||
| 141 | mulhwu r7,r7,r5 | ||
| 142 | mulli r7,r7,1000 | ||
| 143 | |||
| 144 | /* now we must fixup using wall to monotonic. We need to snapshot | ||
| 145 | * that value and do the counter trick again. Fortunately, we still | ||
| 146 | * have the counter value in r8 that was returned by __do_get_xsec. | ||
| 147 | * At this point, r6,r7 contain our sec/nsec values, r3,r4 and r5 | ||
| 148 | * can be used | ||
| 149 | */ | ||
| 150 | |||
| 151 | lwz r3,WTOM_CLOCK_SEC(r9) | ||
| 152 | lwz r4,WTOM_CLOCK_NSEC(r9) | ||
| 153 | |||
| 154 | /* We now have our result in r3,r4. We create a fake dependency | ||
| 155 | * on that result and re-check the counter | ||
| 156 | */ | ||
| 157 | or r5,r4,r3 | ||
| 158 | xor r0,r5,r5 | ||
| 159 | add r9,r9,r0 | ||
| 160 | #ifdef CONFIG_PPC64 | ||
| 161 | lwz r0,(CFG_TB_UPDATE_COUNT+4)(r9) | ||
| 162 | #else | ||
| 163 | lwz r0,(CFG_TB_UPDATE_COUNT)(r9) | ||
| 164 | #endif | ||
| 165 | cmpl cr0,r8,r0 /* check if updated */ | ||
| 166 | bne- 50b | ||
| 167 | |||
| 168 | /* Calculate and store result. Note that this mimmics the C code, | ||
| 169 | * which may cause funny results if nsec goes negative... is that | ||
| 170 | * possible at all ? | ||
| 171 | */ | ||
| 172 | add r3,r3,r6 | ||
| 173 | add r4,r4,r7 | ||
| 174 | lis r5,NSEC_PER_SEC@h | ||
| 175 | ori r5,r5,NSEC_PER_SEC@l | ||
| 176 | cmpli cr0,r4,r5 | ||
| 177 | blt 1f | ||
| 178 | subf r4,r5,r4 | ||
| 179 | addi r3,r3,1 | ||
| 180 | 1: stw r3,TSPC32_TV_SEC(r11) | ||
| 181 | stw r4,TSPC32_TV_NSEC(r11) | ||
| 182 | |||
| 183 | mtlr r12 | ||
| 184 | li r3,0 | ||
| 185 | blr | ||
| 186 | |||
| 187 | /* | ||
| 188 | * syscall fallback | ||
| 189 | */ | ||
| 190 | 98: | ||
| 191 | mtlr r12 | ||
| 192 | mr r3,r10 | ||
| 193 | mr r4,r11 | ||
| 194 | 99: | ||
| 195 | li r0,__NR_clock_gettime | ||
| 196 | sc | ||
| 197 | blr | ||
| 198 | .cfi_endproc | ||
| 199 | V_FUNCTION_END(__kernel_clock_gettime) | ||
| 200 | |||
| 201 | |||
| 202 | /* | ||
| 203 | * Exact prototype of clock_getres() | ||
| 204 | * | ||
| 205 | * int __kernel_clock_getres(clockid_t clock_id, struct timespec *res); | ||
| 206 | * | ||
| 207 | */ | ||
| 208 | V_FUNCTION_BEGIN(__kernel_clock_getres) | ||
| 209 | .cfi_startproc | ||
| 210 | /* Check for supported clock IDs */ | ||
| 211 | cmpwi cr0,r3,CLOCK_REALTIME | ||
| 212 | cmpwi cr1,r3,CLOCK_MONOTONIC | ||
| 213 | cror cr0,cr0,cr1 | ||
| 214 | bne cr0,99f | ||
| 215 | |||
| 216 | li r3,0 | ||
| 217 | cmpli cr0,r4,0 | ||
| 218 | beqlr | ||
| 219 | lis r5,CLOCK_REALTIME_RES@h | ||
| 220 | ori r5,r5,CLOCK_REALTIME_RES@l | ||
| 221 | stw r3,TSPC32_TV_SEC(r4) | ||
| 222 | stw r5,TSPC32_TV_NSEC(r4) | ||
| 223 | blr | ||
| 224 | |||
| 225 | /* | ||
| 226 | * syscall fallback | ||
| 227 | */ | ||
| 228 | 99: | ||
| 229 | li r0,__NR_clock_getres | ||
| 230 | sc | ||
| 231 | blr | ||
| 232 | .cfi_endproc | ||
| 233 | V_FUNCTION_END(__kernel_clock_getres) | ||
| 234 | |||
| 235 | |||
| 236 | /* | ||
| 237 | * This is the core of gettimeofday() & friends, it returns the xsec | ||
| 238 | * value in r3 & r4 and expects the datapage ptr (non clobbered) | ||
| 239 | * in r9. clobbers r0,r4,r5,r6,r7,r8. | ||
| 240 | * When returning, r8 contains the counter value that can be reused | ||
| 241 | * by the monotonic clock implementation | ||
| 242 | */ | ||
| 243 | __do_get_xsec: | ||
| 244 | .cfi_startproc | ||
| 245 | /* Check for update count & load values. We use the low | ||
| 246 | * order 32 bits of the update count | ||
| 247 | */ | ||
| 248 | #ifdef CONFIG_PPC64 | ||
| 249 | 1: lwz r8,(CFG_TB_UPDATE_COUNT+4)(r9) | ||
| 250 | #else | ||
| 251 | 1: lwz r8,(CFG_TB_UPDATE_COUNT)(r9) | ||
| 252 | #endif | ||
| 253 | andi. r0,r8,1 /* pending update ? loop */ | ||
| 254 | bne- 1b | ||
| 255 | xor r0,r8,r8 /* create dependency */ | ||
| 256 | add r9,r9,r0 | ||
| 257 | |||
| 258 | /* Load orig stamp (offset to TB) */ | ||
| 259 | lwz r5,CFG_TB_ORIG_STAMP(r9) | ||
| 260 | lwz r6,(CFG_TB_ORIG_STAMP+4)(r9) | ||
| 261 | |||
| 262 | /* Get a stable TB value */ | ||
| 263 | 2: mftbu r3 | ||
| 264 | mftbl r4 | ||
| 265 | mftbu r0 | ||
| 266 | cmpl cr0,r3,r0 | ||
| 267 | bne- 2b | ||
| 268 | |||
| 269 | /* Substract tb orig stamp. If the high part is non-zero, we jump to | ||
| 270 | * the slow path which call the syscall. | ||
| 271 | * If it's ok, then we have our 32 bits tb_ticks value in r7 | ||
| 272 | */ | ||
| 273 | subfc r7,r6,r4 | ||
| 274 | subfe. r0,r5,r3 | ||
| 275 | bne- 3f | ||
| 276 | |||
| 277 | /* Load scale factor & do multiplication */ | ||
| 278 | lwz r5,CFG_TB_TO_XS(r9) /* load values */ | ||
| 279 | lwz r6,(CFG_TB_TO_XS+4)(r9) | ||
| 280 | mulhwu r4,r7,r5 | ||
| 281 | mulhwu r6,r7,r6 | ||
| 282 | mullw r0,r7,r5 | ||
| 283 | addc r6,r6,r0 | ||
| 284 | |||
| 285 | /* At this point, we have the scaled xsec value in r4 + XER:CA | ||
| 286 | * we load & add the stamp since epoch | ||
| 287 | */ | ||
| 288 | lwz r5,CFG_STAMP_XSEC(r9) | ||
| 289 | lwz r6,(CFG_STAMP_XSEC+4)(r9) | ||
| 290 | adde r4,r4,r6 | ||
| 291 | addze r3,r5 | ||
| 292 | |||
| 293 | /* We now have our result in r3,r4. We create a fake dependency | ||
| 294 | * on that result and re-check the counter | ||
| 295 | */ | ||
| 296 | or r6,r4,r3 | ||
| 297 | xor r0,r6,r6 | ||
| 298 | add r9,r9,r0 | ||
| 299 | #ifdef CONFIG_PPC64 | ||
| 300 | lwz r0,(CFG_TB_UPDATE_COUNT+4)(r9) | ||
| 301 | #else | ||
| 302 | lwz r0,(CFG_TB_UPDATE_COUNT)(r9) | ||
| 303 | #endif | ||
| 304 | cmpl cr0,r8,r0 /* check if updated */ | ||
| 305 | bne- 1b | ||
| 306 | |||
| 307 | /* Warning ! The caller expects CR:EQ to be set to indicate a | ||
| 308 | * successful calculation (so it won't fallback to the syscall | ||
| 309 | * method). We have overriden that CR bit in the counter check, | ||
| 310 | * but fortunately, the loop exit condition _is_ CR:EQ set, so | ||
| 311 | * we can exit safely here. If you change this code, be careful | ||
| 312 | * of that side effect. | ||
| 313 | */ | ||
| 314 | 3: blr | ||
| 315 | .cfi_endproc | ||
diff --git a/arch/ppc64/kernel/vdso32/note.S b/arch/powerpc/kernel/vdso32/note.S index d4b5be4f3d5f..d4b5be4f3d5f 100644 --- a/arch/ppc64/kernel/vdso32/note.S +++ b/arch/powerpc/kernel/vdso32/note.S | |||
diff --git a/arch/ppc64/kernel/vdso32/sigtramp.S b/arch/powerpc/kernel/vdso32/sigtramp.S index e04642781917..e04642781917 100644 --- a/arch/ppc64/kernel/vdso32/sigtramp.S +++ b/arch/powerpc/kernel/vdso32/sigtramp.S | |||
diff --git a/arch/ppc64/kernel/vdso32/vdso32.lds.S b/arch/powerpc/kernel/vdso32/vdso32.lds.S index 6f87a916a394..f4bad720cb0a 100644 --- a/arch/ppc64/kernel/vdso32/vdso32.lds.S +++ b/arch/powerpc/kernel/vdso32/vdso32.lds.S | |||
| @@ -102,9 +102,12 @@ VERSION | |||
| 102 | { | 102 | { |
| 103 | VDSO_VERSION_STRING { | 103 | VDSO_VERSION_STRING { |
| 104 | global: | 104 | global: |
| 105 | __kernel_datapage_offset; /* Has to be there for the kernel to find it */ | 105 | __kernel_datapage_offset; /* Has to be there for the kernel to find */ |
| 106 | __kernel_get_syscall_map; | 106 | __kernel_get_syscall_map; |
| 107 | __kernel_gettimeofday; | 107 | __kernel_gettimeofday; |
| 108 | __kernel_clock_gettime; | ||
| 109 | __kernel_clock_getres; | ||
| 110 | __kernel_get_tbfreq; | ||
| 108 | __kernel_sync_dicache; | 111 | __kernel_sync_dicache; |
| 109 | __kernel_sync_dicache_p5; | 112 | __kernel_sync_dicache_p5; |
| 110 | __kernel_sigtramp32; | 113 | __kernel_sigtramp32; |
diff --git a/arch/ppc64/kernel/vdso32/vdso32_wrapper.S b/arch/powerpc/kernel/vdso32/vdso32_wrapper.S index 76ca28e09d29..556f0caa5d84 100644 --- a/arch/ppc64/kernel/vdso32/vdso32_wrapper.S +++ b/arch/powerpc/kernel/vdso32/vdso32_wrapper.S | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | .globl vdso32_start, vdso32_end | 6 | .globl vdso32_start, vdso32_end |
| 7 | .balign PAGE_SIZE | 7 | .balign PAGE_SIZE |
| 8 | vdso32_start: | 8 | vdso32_start: |
| 9 | .incbin "arch/ppc64/kernel/vdso32/vdso32.so" | 9 | .incbin "arch/powerpc/kernel/vdso32/vdso32.so" |
| 10 | .balign PAGE_SIZE | 10 | .balign PAGE_SIZE |
| 11 | vdso32_end: | 11 | vdso32_end: |
| 12 | 12 | ||
diff --git a/arch/ppc64/kernel/vdso64/Makefile b/arch/powerpc/kernel/vdso64/Makefile index ab39988452cc..ab39988452cc 100644 --- a/arch/ppc64/kernel/vdso64/Makefile +++ b/arch/powerpc/kernel/vdso64/Makefile | |||
diff --git a/arch/ppc64/kernel/vdso64/cacheflush.S b/arch/powerpc/kernel/vdso64/cacheflush.S index d4a0ad28d534..d4a0ad28d534 100644 --- a/arch/ppc64/kernel/vdso64/cacheflush.S +++ b/arch/powerpc/kernel/vdso64/cacheflush.S | |||
diff --git a/arch/ppc64/kernel/vdso64/datapage.S b/arch/powerpc/kernel/vdso64/datapage.S index ed6e599ae824..e67eda0f8cda 100644 --- a/arch/ppc64/kernel/vdso64/datapage.S +++ b/arch/powerpc/kernel/vdso64/datapage.S | |||
| @@ -66,3 +66,19 @@ V_FUNCTION_BEGIN(__kernel_get_syscall_map) | |||
| 66 | blr | 66 | blr |
| 67 | .cfi_endproc | 67 | .cfi_endproc |
| 68 | V_FUNCTION_END(__kernel_get_syscall_map) | 68 | V_FUNCTION_END(__kernel_get_syscall_map) |
| 69 | |||
| 70 | |||
| 71 | /* | ||
| 72 | * void unsigned long __kernel_get_tbfreq(void); | ||
| 73 | * | ||
| 74 | * returns the timebase frequency in HZ | ||
| 75 | */ | ||
| 76 | V_FUNCTION_BEGIN(__kernel_get_tbfreq) | ||
| 77 | .cfi_startproc | ||
| 78 | mflr r12 | ||
| 79 | .cfi_register lr,r12 | ||
| 80 | bl V_LOCAL_FUNC(__get_datapage) | ||
| 81 | ld r3,CFG_TB_TICKS_PER_SEC(r3) | ||
| 82 | mtlr r12 | ||
| 83 | .cfi_endproc | ||
| 84 | V_FUNCTION_END(__kernel_get_tbfreq) | ||
diff --git a/arch/powerpc/kernel/vdso64/gettimeofday.S b/arch/powerpc/kernel/vdso64/gettimeofday.S new file mode 100644 index 000000000000..d371c02a8c0e --- /dev/null +++ b/arch/powerpc/kernel/vdso64/gettimeofday.S | |||
| @@ -0,0 +1,242 @@ | |||
| 1 | /* | ||
| 2 | * Userland implementation of gettimeofday() for 64 bits processes in a | ||
| 3 | * ppc64 kernel for use in the vDSO | ||
| 4 | * | ||
| 5 | * Copyright (C) 2004 Benjamin Herrenschmuidt (benh@kernel.crashing.org), | ||
| 6 | * IBM Corp. | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or | ||
| 9 | * modify it under the terms of the GNU General Public License | ||
| 10 | * as published by the Free Software Foundation; either version | ||
| 11 | * 2 of the License, or (at your option) any later version. | ||
| 12 | */ | ||
| 13 | #include <linux/config.h> | ||
| 14 | #include <asm/processor.h> | ||
| 15 | #include <asm/ppc_asm.h> | ||
| 16 | #include <asm/vdso.h> | ||
| 17 | #include <asm/asm-offsets.h> | ||
| 18 | #include <asm/unistd.h> | ||
| 19 | |||
| 20 | .text | ||
| 21 | /* | ||
| 22 | * Exact prototype of gettimeofday | ||
| 23 | * | ||
| 24 | * int __kernel_gettimeofday(struct timeval *tv, struct timezone *tz); | ||
| 25 | * | ||
| 26 | */ | ||
| 27 | V_FUNCTION_BEGIN(__kernel_gettimeofday) | ||
| 28 | .cfi_startproc | ||
| 29 | mflr r12 | ||
| 30 | .cfi_register lr,r12 | ||
| 31 | |||
| 32 | mr r11,r3 /* r11 holds tv */ | ||
| 33 | mr r10,r4 /* r10 holds tz */ | ||
| 34 | bl V_LOCAL_FUNC(__get_datapage) /* get data page */ | ||
| 35 | bl V_LOCAL_FUNC(__do_get_xsec) /* get xsec from tb & kernel */ | ||
| 36 | lis r7,15 /* r7 = 1000000 = USEC_PER_SEC */ | ||
| 37 | ori r7,r7,16960 | ||
| 38 | rldicl r5,r4,44,20 /* r5 = sec = xsec / XSEC_PER_SEC */ | ||
| 39 | rldicr r6,r5,20,43 /* r6 = sec * XSEC_PER_SEC */ | ||
| 40 | std r5,TVAL64_TV_SEC(r11) /* store sec in tv */ | ||
| 41 | subf r0,r6,r4 /* r0 = xsec = (xsec - r6) */ | ||
| 42 | mulld r0,r0,r7 /* usec = (xsec * USEC_PER_SEC) / | ||
| 43 | * XSEC_PER_SEC | ||
| 44 | */ | ||
| 45 | rldicl r0,r0,44,20 | ||
| 46 | cmpldi cr0,r10,0 /* check if tz is NULL */ | ||
| 47 | std r0,TVAL64_TV_USEC(r11) /* store usec in tv */ | ||
| 48 | beq 1f | ||
| 49 | lwz r4,CFG_TZ_MINUTEWEST(r3)/* fill tz */ | ||
| 50 | lwz r5,CFG_TZ_DSTTIME(r3) | ||
| 51 | stw r4,TZONE_TZ_MINWEST(r10) | ||
| 52 | stw r5,TZONE_TZ_DSTTIME(r10) | ||
| 53 | 1: mtlr r12 | ||
| 54 | li r3,0 /* always success */ | ||
| 55 | blr | ||
| 56 | .cfi_endproc | ||
| 57 | V_FUNCTION_END(__kernel_gettimeofday) | ||
| 58 | |||
| 59 | |||
| 60 | /* | ||
| 61 | * Exact prototype of clock_gettime() | ||
| 62 | * | ||
| 63 | * int __kernel_clock_gettime(clockid_t clock_id, struct timespec *tp); | ||
| 64 | * | ||
| 65 | */ | ||
| 66 | V_FUNCTION_BEGIN(__kernel_clock_gettime) | ||
| 67 | .cfi_startproc | ||
| 68 | /* Check for supported clock IDs */ | ||
| 69 | cmpwi cr0,r3,CLOCK_REALTIME | ||
| 70 | cmpwi cr1,r3,CLOCK_MONOTONIC | ||
| 71 | cror cr0,cr0,cr1 | ||
| 72 | bne cr0,99f | ||
| 73 | |||
| 74 | mflr r12 /* r12 saves lr */ | ||
| 75 | .cfi_register lr,r12 | ||
| 76 | mr r10,r3 /* r10 saves id */ | ||
| 77 | mr r11,r4 /* r11 saves tp */ | ||
| 78 | bl V_LOCAL_FUNC(__get_datapage) /* get data page */ | ||
| 79 | beq cr1,50f /* if monotonic -> jump there */ | ||
| 80 | |||
| 81 | /* | ||
| 82 | * CLOCK_REALTIME | ||
| 83 | */ | ||
| 84 | |||
| 85 | bl V_LOCAL_FUNC(__do_get_xsec) /* get xsec from tb & kernel */ | ||
| 86 | |||
| 87 | lis r7,0x3b9a /* r7 = 1000000000 = NSEC_PER_SEC */ | ||
| 88 | ori r7,r7,0xca00 | ||
| 89 | rldicl r5,r4,44,20 /* r5 = sec = xsec / XSEC_PER_SEC */ | ||
| 90 | rldicr r6,r5,20,43 /* r6 = sec * XSEC_PER_SEC */ | ||
| 91 | std r5,TSPC64_TV_SEC(r11) /* store sec in tv */ | ||
| 92 | subf r0,r6,r4 /* r0 = xsec = (xsec - r6) */ | ||
| 93 | mulld r0,r0,r7 /* nsec = (xsec * NSEC_PER_SEC) / | ||
| 94 | * XSEC_PER_SEC | ||
| 95 | */ | ||
| 96 | rldicl r0,r0,44,20 | ||
| 97 | std r0,TSPC64_TV_NSEC(r11) /* store nsec in tp */ | ||
| 98 | |||
| 99 | mtlr r12 | ||
| 100 | li r3,0 | ||
| 101 | blr | ||
| 102 | |||
| 103 | /* | ||
| 104 | * CLOCK_MONOTONIC | ||
| 105 | */ | ||
| 106 | |||
| 107 | 50: bl V_LOCAL_FUNC(__do_get_xsec) /* get xsec from tb & kernel */ | ||
| 108 | |||
| 109 | lis r7,0x3b9a /* r7 = 1000000000 = NSEC_PER_SEC */ | ||
| 110 | ori r7,r7,0xca00 | ||
| 111 | rldicl r5,r4,44,20 /* r5 = sec = xsec / XSEC_PER_SEC */ | ||
| 112 | rldicr r6,r5,20,43 /* r6 = sec * XSEC_PER_SEC */ | ||
| 113 | subf r0,r6,r4 /* r0 = xsec = (xsec - r6) */ | ||
| 114 | mulld r0,r0,r7 /* nsec = (xsec * NSEC_PER_SEC) / | ||
| 115 | * XSEC_PER_SEC | ||
| 116 | */ | ||
| 117 | rldicl r6,r0,44,20 | ||
| 118 | |||
| 119 | /* now we must fixup using wall to monotonic. We need to snapshot | ||
| 120 | * that value and do the counter trick again. Fortunately, we still | ||
| 121 | * have the counter value in r8 that was returned by __do_get_xsec. | ||
| 122 | * At this point, r5,r6 contain our sec/nsec values. | ||
| 123 | * can be used | ||
| 124 | */ | ||
| 125 | |||
| 126 | lwz r4,WTOM_CLOCK_SEC(r9) | ||
| 127 | lwz r7,WTOM_CLOCK_NSEC(r9) | ||
| 128 | |||
| 129 | /* We now have our result in r4,r7. We create a fake dependency | ||
| 130 | * on that result and re-check the counter | ||
| 131 | */ | ||
| 132 | or r9,r4,r7 | ||
| 133 | xor r0,r9,r9 | ||
| 134 | add r3,r3,r0 | ||
| 135 | ld r0,CFG_TB_UPDATE_COUNT(r3) | ||
| 136 | cmpld cr0,r0,r8 /* check if updated */ | ||
| 137 | bne- 50b | ||
| 138 | |||
| 139 | /* Calculate and store result. Note that this mimmics the C code, | ||
| 140 | * which may cause funny results if nsec goes negative... is that | ||
| 141 | * possible at all ? | ||
| 142 | */ | ||
| 143 | add r4,r4,r5 | ||
| 144 | add r7,r7,r6 | ||
| 145 | lis r9,NSEC_PER_SEC@h | ||
| 146 | ori r9,r9,NSEC_PER_SEC@l | ||
| 147 | cmpli cr0,r7,r9 | ||
| 148 | blt 1f | ||
| 149 | subf r7,r9,r7 | ||
| 150 | addi r4,r4,1 | ||
| 151 | 1: std r4,TSPC64_TV_SEC(r11) | ||
| 152 | std r7,TSPC64_TV_NSEC(r11) | ||
| 153 | |||
| 154 | mtlr r12 | ||
| 155 | li r3,0 | ||
| 156 | blr | ||
| 157 | |||
| 158 | /* | ||
| 159 | * syscall fallback | ||
| 160 | */ | ||
| 161 | 98: | ||
| 162 | mtlr r12 | ||
| 163 | mr r3,r10 | ||
| 164 | mr r4,r11 | ||
| 165 | 99: | ||
| 166 | li r0,__NR_clock_gettime | ||
| 167 | sc | ||
| 168 | blr | ||
| 169 | .cfi_endproc | ||
| 170 | V_FUNCTION_END(__kernel_clock_gettime) | ||
| 171 | |||
| 172 | |||
| 173 | /* | ||
| 174 | * Exact prototype of clock_getres() | ||
| 175 | * | ||
| 176 | * int __kernel_clock_getres(clockid_t clock_id, struct timespec *res); | ||
| 177 | * | ||
| 178 | */ | ||
| 179 | V_FUNCTION_BEGIN(__kernel_clock_getres) | ||
| 180 | .cfi_startproc | ||
| 181 | /* Check for supported clock IDs */ | ||
| 182 | cmpwi cr0,r3,CLOCK_REALTIME | ||
| 183 | cmpwi cr1,r3,CLOCK_MONOTONIC | ||
| 184 | cror cr0,cr0,cr1 | ||
| 185 | bne cr0,99f | ||
| 186 | |||
| 187 | li r3,0 | ||
| 188 | cmpli cr0,r4,0 | ||
| 189 | beqlr | ||
| 190 | lis r5,CLOCK_REALTIME_RES@h | ||
| 191 | ori r5,r5,CLOCK_REALTIME_RES@l | ||
| 192 | std r3,TSPC64_TV_SEC(r4) | ||
| 193 | std r5,TSPC64_TV_NSEC(r4) | ||
| 194 | blr | ||
| 195 | |||
| 196 | /* | ||
| 197 | * syscall fallback | ||
| 198 | */ | ||
| 199 | 99: | ||
| 200 | li r0,__NR_clock_getres | ||
| 201 | sc | ||
| 202 | blr | ||
| 203 | .cfi_endproc | ||
| 204 | V_FUNCTION_END(__kernel_clock_getres) | ||
| 205 | |||
| 206 | |||
| 207 | /* | ||
| 208 | * This is the core of gettimeofday(), it returns the xsec | ||
| 209 | * value in r4 and expects the datapage ptr (non clobbered) | ||
| 210 | * in r3. clobbers r0,r4,r5,r6,r7,r8 | ||
| 211 | * When returning, r8 contains the counter value that can be reused | ||
| 212 | */ | ||
| 213 | V_FUNCTION_BEGIN(__do_get_xsec) | ||
| 214 | .cfi_startproc | ||
| 215 | /* check for update count & load values */ | ||
| 216 | 1: ld r8,CFG_TB_UPDATE_COUNT(r3) | ||
| 217 | andi. r0,r4,1 /* pending update ? loop */ | ||
| 218 | bne- 1b | ||
| 219 | xor r0,r4,r4 /* create dependency */ | ||
| 220 | add r3,r3,r0 | ||
| 221 | |||
| 222 | /* Get TB & offset it */ | ||
| 223 | mftb r7 | ||
| 224 | ld r9,CFG_TB_ORIG_STAMP(r3) | ||
| 225 | subf r7,r9,r7 | ||
| 226 | |||
| 227 | /* Scale result */ | ||
| 228 | ld r5,CFG_TB_TO_XS(r3) | ||
| 229 | mulhdu r7,r7,r5 | ||
| 230 | |||
| 231 | /* Add stamp since epoch */ | ||
| 232 | ld r6,CFG_STAMP_XSEC(r3) | ||
| 233 | add r4,r6,r7 | ||
| 234 | |||
| 235 | xor r0,r4,r4 | ||
| 236 | add r3,r3,r0 | ||
| 237 | ld r0,CFG_TB_UPDATE_COUNT(r3) | ||
| 238 | cmpld cr0,r0,r8 /* check if updated */ | ||
| 239 | bne- 1b | ||
| 240 | blr | ||
| 241 | .cfi_endproc | ||
| 242 | V_FUNCTION_END(__do_get_xsec) | ||
diff --git a/arch/ppc64/kernel/vdso64/note.S b/arch/powerpc/kernel/vdso64/note.S index dc2a509f7e8a..dc2a509f7e8a 100644 --- a/arch/ppc64/kernel/vdso64/note.S +++ b/arch/powerpc/kernel/vdso64/note.S | |||
diff --git a/arch/ppc64/kernel/vdso64/sigtramp.S b/arch/powerpc/kernel/vdso64/sigtramp.S index 31b604ab56de..31b604ab56de 100644 --- a/arch/ppc64/kernel/vdso64/sigtramp.S +++ b/arch/powerpc/kernel/vdso64/sigtramp.S | |||
diff --git a/arch/ppc64/kernel/vdso64/vdso64.lds.S b/arch/powerpc/kernel/vdso64/vdso64.lds.S index 9cb28181da80..4bdf224464ab 100644 --- a/arch/ppc64/kernel/vdso64/vdso64.lds.S +++ b/arch/powerpc/kernel/vdso64/vdso64.lds.S | |||
| @@ -102,9 +102,12 @@ VERSION | |||
| 102 | { | 102 | { |
| 103 | VDSO_VERSION_STRING { | 103 | VDSO_VERSION_STRING { |
| 104 | global: | 104 | global: |
| 105 | __kernel_datapage_offset; /* Has to be there for the kernel to find it */ | 105 | __kernel_datapage_offset; /* Has to be there for the kernel to find */ |
| 106 | __kernel_get_syscall_map; | 106 | __kernel_get_syscall_map; |
| 107 | __kernel_gettimeofday; | 107 | __kernel_gettimeofday; |
| 108 | __kernel_clock_gettime; | ||
| 109 | __kernel_clock_getres; | ||
| 110 | __kernel_get_tbfreq; | ||
| 108 | __kernel_sync_dicache; | 111 | __kernel_sync_dicache; |
| 109 | __kernel_sync_dicache_p5; | 112 | __kernel_sync_dicache_p5; |
| 110 | __kernel_sigtramp_rt64; | 113 | __kernel_sigtramp_rt64; |
diff --git a/arch/ppc64/kernel/vdso64/vdso64_wrapper.S b/arch/powerpc/kernel/vdso64/vdso64_wrapper.S index 771c2741c492..0529cb9e3b97 100644 --- a/arch/ppc64/kernel/vdso64/vdso64_wrapper.S +++ b/arch/powerpc/kernel/vdso64/vdso64_wrapper.S | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | .globl vdso64_start, vdso64_end | 6 | .globl vdso64_start, vdso64_end |
| 7 | .balign PAGE_SIZE | 7 | .balign PAGE_SIZE |
| 8 | vdso64_start: | 8 | vdso64_start: |
| 9 | .incbin "arch/ppc64/kernel/vdso64/vdso64.so" | 9 | .incbin "arch/powerpc/kernel/vdso64/vdso64.so" |
| 10 | .balign PAGE_SIZE | 10 | .balign PAGE_SIZE |
| 11 | vdso64_end: | 11 | vdso64_end: |
| 12 | 12 | ||
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c index 1dd3cc69a490..e2c95fcb8055 100644 --- a/arch/powerpc/mm/mem.c +++ b/arch/powerpc/mm/mem.c | |||
| @@ -46,9 +46,7 @@ | |||
| 46 | #include <asm/prom.h> | 46 | #include <asm/prom.h> |
| 47 | #include <asm/lmb.h> | 47 | #include <asm/lmb.h> |
| 48 | #include <asm/sections.h> | 48 | #include <asm/sections.h> |
| 49 | #ifdef CONFIG_PPC64 | ||
| 50 | #include <asm/vdso.h> | 49 | #include <asm/vdso.h> |
| 51 | #endif | ||
| 52 | 50 | ||
| 53 | #include "mmu_decl.h" | 51 | #include "mmu_decl.h" |
| 54 | 52 | ||
| @@ -397,10 +395,8 @@ void __init mem_init(void) | |||
| 397 | 395 | ||
| 398 | mem_init_done = 1; | 396 | mem_init_done = 1; |
| 399 | 397 | ||
| 400 | #ifdef CONFIG_PPC64 | ||
| 401 | /* Initialize the vDSO */ | 398 | /* Initialize the vDSO */ |
| 402 | vdso_init(); | 399 | vdso_init(); |
| 403 | #endif | ||
| 404 | } | 400 | } |
| 405 | 401 | ||
| 406 | /* | 402 | /* |
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index da09ba03c424..bd2cf1336885 100644 --- a/arch/powerpc/mm/numa.c +++ b/arch/powerpc/mm/numa.c | |||
| @@ -17,9 +17,8 @@ | |||
| 17 | #include <linux/nodemask.h> | 17 | #include <linux/nodemask.h> |
| 18 | #include <linux/cpu.h> | 18 | #include <linux/cpu.h> |
| 19 | #include <linux/notifier.h> | 19 | #include <linux/notifier.h> |
| 20 | #include <asm/sparsemem.h> | ||
| 20 | #include <asm/lmb.h> | 21 | #include <asm/lmb.h> |
| 21 | #include <asm/machdep.h> | ||
| 22 | #include <asm/abs_addr.h> | ||
| 23 | #include <asm/system.h> | 22 | #include <asm/system.h> |
| 24 | #include <asm/smp.h> | 23 | #include <asm/smp.h> |
| 25 | 24 | ||
| @@ -28,45 +27,113 @@ static int numa_enabled = 1; | |||
| 28 | static int numa_debug; | 27 | static int numa_debug; |
| 29 | #define dbg(args...) if (numa_debug) { printk(KERN_INFO args); } | 28 | #define dbg(args...) if (numa_debug) { printk(KERN_INFO args); } |
| 30 | 29 | ||
| 31 | #ifdef DEBUG_NUMA | 30 | int numa_cpu_lookup_table[NR_CPUS]; |
| 32 | #define ARRAY_INITIALISER -1 | ||
| 33 | #else | ||
| 34 | #define ARRAY_INITIALISER 0 | ||
| 35 | #endif | ||
| 36 | |||
| 37 | int numa_cpu_lookup_table[NR_CPUS] = { [ 0 ... (NR_CPUS - 1)] = | ||
| 38 | ARRAY_INITIALISER}; | ||
| 39 | char *numa_memory_lookup_table; | ||
| 40 | cpumask_t numa_cpumask_lookup_table[MAX_NUMNODES]; | 31 | cpumask_t numa_cpumask_lookup_table[MAX_NUMNODES]; |
| 41 | int nr_cpus_in_node[MAX_NUMNODES] = { [0 ... (MAX_NUMNODES -1)] = 0}; | ||
| 42 | |||
| 43 | struct pglist_data *node_data[MAX_NUMNODES]; | 32 | struct pglist_data *node_data[MAX_NUMNODES]; |
| 44 | bootmem_data_t __initdata plat_node_bdata[MAX_NUMNODES]; | 33 | |
| 34 | EXPORT_SYMBOL(numa_cpu_lookup_table); | ||
| 35 | EXPORT_SYMBOL(numa_cpumask_lookup_table); | ||
| 36 | EXPORT_SYMBOL(node_data); | ||
| 37 | |||
| 38 | static bootmem_data_t __initdata plat_node_bdata[MAX_NUMNODES]; | ||
| 45 | static int min_common_depth; | 39 | static int min_common_depth; |
| 46 | 40 | ||
| 47 | /* | 41 | /* |
| 48 | * We need somewhere to store start/span for each node until we have | 42 | * We need somewhere to store start/end/node for each region until we have |
| 49 | * allocated the real node_data structures. | 43 | * allocated the real node_data structures. |
| 50 | */ | 44 | */ |
| 45 | #define MAX_REGIONS (MAX_LMB_REGIONS*2) | ||
| 51 | static struct { | 46 | static struct { |
| 52 | unsigned long node_start_pfn; | 47 | unsigned long start_pfn; |
| 53 | unsigned long node_end_pfn; | 48 | unsigned long end_pfn; |
| 54 | unsigned long node_present_pages; | 49 | int nid; |
| 55 | } init_node_data[MAX_NUMNODES] __initdata; | 50 | } init_node_data[MAX_REGIONS] __initdata; |
| 56 | 51 | ||
| 57 | EXPORT_SYMBOL(node_data); | 52 | int __init early_pfn_to_nid(unsigned long pfn) |
| 58 | EXPORT_SYMBOL(numa_cpu_lookup_table); | 53 | { |
| 59 | EXPORT_SYMBOL(numa_memory_lookup_table); | 54 | unsigned int i; |
| 60 | EXPORT_SYMBOL(numa_cpumask_lookup_table); | 55 | |
| 61 | EXPORT_SYMBOL(nr_cpus_in_node); | 56 | for (i = 0; init_node_data[i].end_pfn; i++) { |
| 57 | unsigned long start_pfn = init_node_data[i].start_pfn; | ||
| 58 | unsigned long end_pfn = init_node_data[i].end_pfn; | ||
| 59 | |||
| 60 | if ((start_pfn <= pfn) && (pfn < end_pfn)) | ||
| 61 | return init_node_data[i].nid; | ||
| 62 | } | ||
| 63 | |||
| 64 | return -1; | ||
| 65 | } | ||
| 66 | |||
| 67 | void __init add_region(unsigned int nid, unsigned long start_pfn, | ||
| 68 | unsigned long pages) | ||
| 69 | { | ||
| 70 | unsigned int i; | ||
| 71 | |||
| 72 | dbg("add_region nid %d start_pfn 0x%lx pages 0x%lx\n", | ||
| 73 | nid, start_pfn, pages); | ||
| 74 | |||
| 75 | for (i = 0; init_node_data[i].end_pfn; i++) { | ||
| 76 | if (init_node_data[i].nid != nid) | ||
| 77 | continue; | ||
| 78 | if (init_node_data[i].end_pfn == start_pfn) { | ||
| 79 | init_node_data[i].end_pfn += pages; | ||
| 80 | return; | ||
| 81 | } | ||
| 82 | if (init_node_data[i].start_pfn == (start_pfn + pages)) { | ||
| 83 | init_node_data[i].start_pfn -= pages; | ||
| 84 | return; | ||
| 85 | } | ||
| 86 | } | ||
| 87 | |||
| 88 | /* | ||
| 89 | * Leave last entry NULL so we dont iterate off the end (we use | ||
| 90 | * entry.end_pfn to terminate the walk). | ||
| 91 | */ | ||
| 92 | if (i >= (MAX_REGIONS - 1)) { | ||
| 93 | printk(KERN_ERR "WARNING: too many memory regions in " | ||
| 94 | "numa code, truncating\n"); | ||
| 95 | return; | ||
| 96 | } | ||
| 97 | |||
| 98 | init_node_data[i].start_pfn = start_pfn; | ||
| 99 | init_node_data[i].end_pfn = start_pfn + pages; | ||
| 100 | init_node_data[i].nid = nid; | ||
| 101 | } | ||
| 102 | |||
| 103 | /* We assume init_node_data has no overlapping regions */ | ||
| 104 | void __init get_region(unsigned int nid, unsigned long *start_pfn, | ||
| 105 | unsigned long *end_pfn, unsigned long *pages_present) | ||
| 106 | { | ||
| 107 | unsigned int i; | ||
| 108 | |||
| 109 | *start_pfn = -1UL; | ||
| 110 | *end_pfn = *pages_present = 0; | ||
| 111 | |||
| 112 | for (i = 0; init_node_data[i].end_pfn; i++) { | ||
| 113 | if (init_node_data[i].nid != nid) | ||
| 114 | continue; | ||
| 115 | |||
| 116 | *pages_present += init_node_data[i].end_pfn - | ||
| 117 | init_node_data[i].start_pfn; | ||
| 118 | |||
| 119 | if (init_node_data[i].start_pfn < *start_pfn) | ||
| 120 | *start_pfn = init_node_data[i].start_pfn; | ||
| 121 | |||
| 122 | if (init_node_data[i].end_pfn > *end_pfn) | ||
| 123 | *end_pfn = init_node_data[i].end_pfn; | ||
| 124 | } | ||
| 125 | |||
| 126 | /* We didnt find a matching region, return start/end as 0 */ | ||
| 127 | if (*start_pfn == -1UL) | ||
| 128 | start_pfn = 0; | ||
| 129 | } | ||
| 62 | 130 | ||
| 63 | static inline void map_cpu_to_node(int cpu, int node) | 131 | static inline void map_cpu_to_node(int cpu, int node) |
| 64 | { | 132 | { |
| 65 | numa_cpu_lookup_table[cpu] = node; | 133 | numa_cpu_lookup_table[cpu] = node; |
| 66 | if (!(cpu_isset(cpu, numa_cpumask_lookup_table[node]))) { | 134 | |
| 135 | if (!(cpu_isset(cpu, numa_cpumask_lookup_table[node]))) | ||
| 67 | cpu_set(cpu, numa_cpumask_lookup_table[node]); | 136 | cpu_set(cpu, numa_cpumask_lookup_table[node]); |
| 68 | nr_cpus_in_node[node]++; | ||
| 69 | } | ||
| 70 | } | 137 | } |
| 71 | 138 | ||
| 72 | #ifdef CONFIG_HOTPLUG_CPU | 139 | #ifdef CONFIG_HOTPLUG_CPU |
| @@ -78,7 +145,6 @@ static void unmap_cpu_from_node(unsigned long cpu) | |||
| 78 | 145 | ||
| 79 | if (cpu_isset(cpu, numa_cpumask_lookup_table[node])) { | 146 | if (cpu_isset(cpu, numa_cpumask_lookup_table[node])) { |
| 80 | cpu_clear(cpu, numa_cpumask_lookup_table[node]); | 147 | cpu_clear(cpu, numa_cpumask_lookup_table[node]); |
| 81 | nr_cpus_in_node[node]--; | ||
| 82 | } else { | 148 | } else { |
| 83 | printk(KERN_ERR "WARNING: cpu %lu not found in node %d\n", | 149 | printk(KERN_ERR "WARNING: cpu %lu not found in node %d\n", |
| 84 | cpu, node); | 150 | cpu, node); |
| @@ -86,7 +152,7 @@ static void unmap_cpu_from_node(unsigned long cpu) | |||
| 86 | } | 152 | } |
| 87 | #endif /* CONFIG_HOTPLUG_CPU */ | 153 | #endif /* CONFIG_HOTPLUG_CPU */ |
| 88 | 154 | ||
| 89 | static struct device_node * __devinit find_cpu_node(unsigned int cpu) | 155 | static struct device_node *find_cpu_node(unsigned int cpu) |
| 90 | { | 156 | { |
| 91 | unsigned int hw_cpuid = get_hard_smp_processor_id(cpu); | 157 | unsigned int hw_cpuid = get_hard_smp_processor_id(cpu); |
| 92 | struct device_node *cpu_node = NULL; | 158 | struct device_node *cpu_node = NULL; |
| @@ -213,7 +279,7 @@ static int __init get_mem_size_cells(void) | |||
| 213 | return rc; | 279 | return rc; |
| 214 | } | 280 | } |
| 215 | 281 | ||
| 216 | static unsigned long read_n_cells(int n, unsigned int **buf) | 282 | static unsigned long __init read_n_cells(int n, unsigned int **buf) |
| 217 | { | 283 | { |
| 218 | unsigned long result = 0; | 284 | unsigned long result = 0; |
| 219 | 285 | ||
| @@ -295,7 +361,8 @@ static int cpu_numa_callback(struct notifier_block *nfb, | |||
| 295 | * or zero. If the returned value of size is 0 the region should be | 361 | * or zero. If the returned value of size is 0 the region should be |
| 296 | * discarded as it lies wholy above the memory limit. | 362 | * discarded as it lies wholy above the memory limit. |
| 297 | */ | 363 | */ |
| 298 | static unsigned long __init numa_enforce_memory_limit(unsigned long start, unsigned long size) | 364 | static unsigned long __init numa_enforce_memory_limit(unsigned long start, |
| 365 | unsigned long size) | ||
| 299 | { | 366 | { |
| 300 | /* | 367 | /* |
| 301 | * We use lmb_end_of_DRAM() in here instead of memory_limit because | 368 | * We use lmb_end_of_DRAM() in here instead of memory_limit because |
| @@ -320,8 +387,7 @@ static int __init parse_numa_properties(void) | |||
| 320 | struct device_node *cpu = NULL; | 387 | struct device_node *cpu = NULL; |
| 321 | struct device_node *memory = NULL; | 388 | struct device_node *memory = NULL; |
| 322 | int addr_cells, size_cells; | 389 | int addr_cells, size_cells; |
| 323 | int max_domain = 0; | 390 | int max_domain; |
| 324 | long entries = lmb_end_of_DRAM() >> MEMORY_INCREMENT_SHIFT; | ||
| 325 | unsigned long i; | 391 | unsigned long i; |
| 326 | 392 | ||
| 327 | if (numa_enabled == 0) { | 393 | if (numa_enabled == 0) { |
| @@ -329,13 +395,6 @@ static int __init parse_numa_properties(void) | |||
| 329 | return -1; | 395 | return -1; |
| 330 | } | 396 | } |
| 331 | 397 | ||
| 332 | numa_memory_lookup_table = | ||
| 333 | (char *)abs_to_virt(lmb_alloc(entries * sizeof(char), 1)); | ||
| 334 | memset(numa_memory_lookup_table, 0, entries * sizeof(char)); | ||
| 335 | |||
| 336 | for (i = 0; i < entries ; i++) | ||
| 337 | numa_memory_lookup_table[i] = ARRAY_INITIALISER; | ||
| 338 | |||
| 339 | min_common_depth = find_min_common_depth(); | 398 | min_common_depth = find_min_common_depth(); |
| 340 | 399 | ||
| 341 | dbg("NUMA associativity depth for CPU/Memory: %d\n", min_common_depth); | 400 | dbg("NUMA associativity depth for CPU/Memory: %d\n", min_common_depth); |
| @@ -387,9 +446,6 @@ new_range: | |||
| 387 | start = read_n_cells(addr_cells, &memcell_buf); | 446 | start = read_n_cells(addr_cells, &memcell_buf); |
| 388 | size = read_n_cells(size_cells, &memcell_buf); | 447 | size = read_n_cells(size_cells, &memcell_buf); |
| 389 | 448 | ||
| 390 | start = _ALIGN_DOWN(start, MEMORY_INCREMENT); | ||
| 391 | size = _ALIGN_UP(size, MEMORY_INCREMENT); | ||
| 392 | |||
| 393 | numa_domain = of_node_numa_domain(memory); | 449 | numa_domain = of_node_numa_domain(memory); |
| 394 | 450 | ||
| 395 | if (numa_domain >= MAX_NUMNODES) { | 451 | if (numa_domain >= MAX_NUMNODES) { |
| @@ -403,44 +459,15 @@ new_range: | |||
| 403 | if (max_domain < numa_domain) | 459 | if (max_domain < numa_domain) |
| 404 | max_domain = numa_domain; | 460 | max_domain = numa_domain; |
| 405 | 461 | ||
| 406 | if (! (size = numa_enforce_memory_limit(start, size))) { | 462 | if (!(size = numa_enforce_memory_limit(start, size))) { |
| 407 | if (--ranges) | 463 | if (--ranges) |
| 408 | goto new_range; | 464 | goto new_range; |
| 409 | else | 465 | else |
| 410 | continue; | 466 | continue; |
| 411 | } | 467 | } |
| 412 | 468 | ||
| 413 | /* | 469 | add_region(numa_domain, start >> PAGE_SHIFT, |
| 414 | * Initialize new node struct, or add to an existing one. | 470 | size >> PAGE_SHIFT); |
| 415 | */ | ||
| 416 | if (init_node_data[numa_domain].node_end_pfn) { | ||
| 417 | if ((start / PAGE_SIZE) < | ||
| 418 | init_node_data[numa_domain].node_start_pfn) | ||
| 419 | init_node_data[numa_domain].node_start_pfn = | ||
| 420 | start / PAGE_SIZE; | ||
| 421 | if (((start / PAGE_SIZE) + (size / PAGE_SIZE)) > | ||
| 422 | init_node_data[numa_domain].node_end_pfn) | ||
| 423 | init_node_data[numa_domain].node_end_pfn = | ||
| 424 | (start / PAGE_SIZE) + | ||
| 425 | (size / PAGE_SIZE); | ||
| 426 | |||
| 427 | init_node_data[numa_domain].node_present_pages += | ||
| 428 | size / PAGE_SIZE; | ||
| 429 | } else { | ||
| 430 | node_set_online(numa_domain); | ||
| 431 | |||
| 432 | init_node_data[numa_domain].node_start_pfn = | ||
| 433 | start / PAGE_SIZE; | ||
| 434 | init_node_data[numa_domain].node_end_pfn = | ||
| 435 | init_node_data[numa_domain].node_start_pfn + | ||
| 436 | size / PAGE_SIZE; | ||
| 437 | init_node_data[numa_domain].node_present_pages = | ||
| 438 | size / PAGE_SIZE; | ||
| 439 | } | ||
| 440 | |||
| 441 | for (i = start ; i < (start+size); i += MEMORY_INCREMENT) | ||
| 442 | numa_memory_lookup_table[i >> MEMORY_INCREMENT_SHIFT] = | ||
| 443 | numa_domain; | ||
| 444 | 471 | ||
| 445 | if (--ranges) | 472 | if (--ranges) |
| 446 | goto new_range; | 473 | goto new_range; |
| @@ -456,32 +483,15 @@ static void __init setup_nonnuma(void) | |||
| 456 | { | 483 | { |
| 457 | unsigned long top_of_ram = lmb_end_of_DRAM(); | 484 | unsigned long top_of_ram = lmb_end_of_DRAM(); |
| 458 | unsigned long total_ram = lmb_phys_mem_size(); | 485 | unsigned long total_ram = lmb_phys_mem_size(); |
| 459 | unsigned long i; | ||
| 460 | 486 | ||
| 461 | printk(KERN_INFO "Top of RAM: 0x%lx, Total RAM: 0x%lx\n", | 487 | printk(KERN_INFO "Top of RAM: 0x%lx, Total RAM: 0x%lx\n", |
| 462 | top_of_ram, total_ram); | 488 | top_of_ram, total_ram); |
| 463 | printk(KERN_INFO "Memory hole size: %ldMB\n", | 489 | printk(KERN_INFO "Memory hole size: %ldMB\n", |
| 464 | (top_of_ram - total_ram) >> 20); | 490 | (top_of_ram - total_ram) >> 20); |
| 465 | 491 | ||
| 466 | if (!numa_memory_lookup_table) { | ||
| 467 | long entries = top_of_ram >> MEMORY_INCREMENT_SHIFT; | ||
| 468 | numa_memory_lookup_table = | ||
| 469 | (char *)abs_to_virt(lmb_alloc(entries * sizeof(char), 1)); | ||
| 470 | memset(numa_memory_lookup_table, 0, entries * sizeof(char)); | ||
| 471 | for (i = 0; i < entries ; i++) | ||
| 472 | numa_memory_lookup_table[i] = ARRAY_INITIALISER; | ||
| 473 | } | ||
| 474 | |||
| 475 | map_cpu_to_node(boot_cpuid, 0); | 492 | map_cpu_to_node(boot_cpuid, 0); |
| 476 | 493 | add_region(0, 0, lmb_end_of_DRAM() >> PAGE_SHIFT); | |
| 477 | node_set_online(0); | 494 | node_set_online(0); |
| 478 | |||
| 479 | init_node_data[0].node_start_pfn = 0; | ||
| 480 | init_node_data[0].node_end_pfn = lmb_end_of_DRAM() / PAGE_SIZE; | ||
| 481 | init_node_data[0].node_present_pages = total_ram / PAGE_SIZE; | ||
| 482 | |||
| 483 | for (i = 0 ; i < top_of_ram; i += MEMORY_INCREMENT) | ||
| 484 | numa_memory_lookup_table[i >> MEMORY_INCREMENT_SHIFT] = 0; | ||
| 485 | } | 495 | } |
| 486 | 496 | ||
| 487 | static void __init dump_numa_topology(void) | 497 | static void __init dump_numa_topology(void) |
| @@ -499,8 +509,9 @@ static void __init dump_numa_topology(void) | |||
| 499 | 509 | ||
| 500 | count = 0; | 510 | count = 0; |
| 501 | 511 | ||
| 502 | for (i = 0; i < lmb_end_of_DRAM(); i += MEMORY_INCREMENT) { | 512 | for (i = 0; i < lmb_end_of_DRAM(); |
| 503 | if (numa_memory_lookup_table[i >> MEMORY_INCREMENT_SHIFT] == node) { | 513 | i += (1 << SECTION_SIZE_BITS)) { |
| 514 | if (early_pfn_to_nid(i >> PAGE_SHIFT) == node) { | ||
| 504 | if (count == 0) | 515 | if (count == 0) |
| 505 | printk(" 0x%lx", i); | 516 | printk(" 0x%lx", i); |
| 506 | ++count; | 517 | ++count; |
| @@ -525,10 +536,12 @@ static void __init dump_numa_topology(void) | |||
| 525 | * | 536 | * |
| 526 | * Returns the physical address of the memory. | 537 | * Returns the physical address of the memory. |
| 527 | */ | 538 | */ |
| 528 | static unsigned long careful_allocation(int nid, unsigned long size, | 539 | static void __init *careful_allocation(int nid, unsigned long size, |
| 529 | unsigned long align, unsigned long end) | 540 | unsigned long align, |
| 541 | unsigned long end_pfn) | ||
| 530 | { | 542 | { |
| 531 | unsigned long ret = lmb_alloc_base(size, align, end); | 543 | int new_nid; |
| 544 | unsigned long ret = lmb_alloc_base(size, align, end_pfn << PAGE_SHIFT); | ||
| 532 | 545 | ||
| 533 | /* retry over all memory */ | 546 | /* retry over all memory */ |
| 534 | if (!ret) | 547 | if (!ret) |
| @@ -542,28 +555,27 @@ static unsigned long careful_allocation(int nid, unsigned long size, | |||
| 542 | * If the memory came from a previously allocated node, we must | 555 | * If the memory came from a previously allocated node, we must |
| 543 | * retry with the bootmem allocator. | 556 | * retry with the bootmem allocator. |
| 544 | */ | 557 | */ |
| 545 | if (pa_to_nid(ret) < nid) { | 558 | new_nid = early_pfn_to_nid(ret >> PAGE_SHIFT); |
| 546 | nid = pa_to_nid(ret); | 559 | if (new_nid < nid) { |
| 547 | ret = (unsigned long)__alloc_bootmem_node(NODE_DATA(nid), | 560 | ret = (unsigned long)__alloc_bootmem_node(NODE_DATA(new_nid), |
| 548 | size, align, 0); | 561 | size, align, 0); |
| 549 | 562 | ||
| 550 | if (!ret) | 563 | if (!ret) |
| 551 | panic("numa.c: cannot allocate %lu bytes on node %d", | 564 | panic("numa.c: cannot allocate %lu bytes on node %d", |
| 552 | size, nid); | 565 | size, new_nid); |
| 553 | 566 | ||
| 554 | ret = virt_to_abs(ret); | 567 | ret = __pa(ret); |
| 555 | 568 | ||
| 556 | dbg("alloc_bootmem %lx %lx\n", ret, size); | 569 | dbg("alloc_bootmem %lx %lx\n", ret, size); |
| 557 | } | 570 | } |
| 558 | 571 | ||
| 559 | return ret; | 572 | return (void *)ret; |
| 560 | } | 573 | } |
| 561 | 574 | ||
| 562 | void __init do_init_bootmem(void) | 575 | void __init do_init_bootmem(void) |
| 563 | { | 576 | { |
| 564 | int nid; | 577 | int nid; |
| 565 | int addr_cells, size_cells; | 578 | unsigned int i; |
| 566 | struct device_node *memory = NULL; | ||
| 567 | static struct notifier_block ppc64_numa_nb = { | 579 | static struct notifier_block ppc64_numa_nb = { |
| 568 | .notifier_call = cpu_numa_callback, | 580 | .notifier_call = cpu_numa_callback, |
| 569 | .priority = 1 /* Must run before sched domains notifier. */ | 581 | .priority = 1 /* Must run before sched domains notifier. */ |
| @@ -581,99 +593,66 @@ void __init do_init_bootmem(void) | |||
| 581 | register_cpu_notifier(&ppc64_numa_nb); | 593 | register_cpu_notifier(&ppc64_numa_nb); |
| 582 | 594 | ||
| 583 | for_each_online_node(nid) { | 595 | for_each_online_node(nid) { |
| 584 | unsigned long start_paddr, end_paddr; | 596 | unsigned long start_pfn, end_pfn, pages_present; |
| 585 | int i; | ||
| 586 | unsigned long bootmem_paddr; | 597 | unsigned long bootmem_paddr; |
| 587 | unsigned long bootmap_pages; | 598 | unsigned long bootmap_pages; |
| 588 | 599 | ||
| 589 | start_paddr = init_node_data[nid].node_start_pfn * PAGE_SIZE; | 600 | get_region(nid, &start_pfn, &end_pfn, &pages_present); |
| 590 | end_paddr = init_node_data[nid].node_end_pfn * PAGE_SIZE; | ||
| 591 | 601 | ||
| 592 | /* Allocate the node structure node local if possible */ | 602 | /* Allocate the node structure node local if possible */ |
| 593 | NODE_DATA(nid) = (struct pglist_data *)careful_allocation(nid, | 603 | NODE_DATA(nid) = careful_allocation(nid, |
| 594 | sizeof(struct pglist_data), | 604 | sizeof(struct pglist_data), |
| 595 | SMP_CACHE_BYTES, end_paddr); | 605 | SMP_CACHE_BYTES, end_pfn); |
| 596 | NODE_DATA(nid) = abs_to_virt(NODE_DATA(nid)); | 606 | NODE_DATA(nid) = __va(NODE_DATA(nid)); |
| 597 | memset(NODE_DATA(nid), 0, sizeof(struct pglist_data)); | 607 | memset(NODE_DATA(nid), 0, sizeof(struct pglist_data)); |
| 598 | 608 | ||
| 599 | dbg("node %d\n", nid); | 609 | dbg("node %d\n", nid); |
| 600 | dbg("NODE_DATA() = %p\n", NODE_DATA(nid)); | 610 | dbg("NODE_DATA() = %p\n", NODE_DATA(nid)); |
| 601 | 611 | ||
| 602 | NODE_DATA(nid)->bdata = &plat_node_bdata[nid]; | 612 | NODE_DATA(nid)->bdata = &plat_node_bdata[nid]; |
| 603 | NODE_DATA(nid)->node_start_pfn = | 613 | NODE_DATA(nid)->node_start_pfn = start_pfn; |
| 604 | init_node_data[nid].node_start_pfn; | 614 | NODE_DATA(nid)->node_spanned_pages = end_pfn - start_pfn; |
| 605 | NODE_DATA(nid)->node_spanned_pages = | ||
| 606 | end_paddr - start_paddr; | ||
| 607 | 615 | ||
| 608 | if (NODE_DATA(nid)->node_spanned_pages == 0) | 616 | if (NODE_DATA(nid)->node_spanned_pages == 0) |
| 609 | continue; | 617 | continue; |
| 610 | 618 | ||
| 611 | dbg("start_paddr = %lx\n", start_paddr); | 619 | dbg("start_paddr = %lx\n", start_pfn << PAGE_SHIFT); |
| 612 | dbg("end_paddr = %lx\n", end_paddr); | 620 | dbg("end_paddr = %lx\n", end_pfn << PAGE_SHIFT); |
| 613 | 621 | ||
| 614 | bootmap_pages = bootmem_bootmap_pages((end_paddr - start_paddr) >> PAGE_SHIFT); | 622 | bootmap_pages = bootmem_bootmap_pages(end_pfn - start_pfn); |
| 623 | bootmem_paddr = (unsigned long)careful_allocation(nid, | ||
| 624 | bootmap_pages << PAGE_SHIFT, | ||
| 625 | PAGE_SIZE, end_pfn); | ||
| 626 | memset(__va(bootmem_paddr), 0, bootmap_pages << PAGE_SHIFT); | ||
| 615 | 627 | ||
| 616 | bootmem_paddr = careful_allocation(nid, | ||
| 617 | bootmap_pages << PAGE_SHIFT, | ||
| 618 | PAGE_SIZE, end_paddr); | ||
| 619 | memset(abs_to_virt(bootmem_paddr), 0, | ||
| 620 | bootmap_pages << PAGE_SHIFT); | ||
| 621 | dbg("bootmap_paddr = %lx\n", bootmem_paddr); | 628 | dbg("bootmap_paddr = %lx\n", bootmem_paddr); |
| 622 | 629 | ||
| 623 | init_bootmem_node(NODE_DATA(nid), bootmem_paddr >> PAGE_SHIFT, | 630 | init_bootmem_node(NODE_DATA(nid), bootmem_paddr >> PAGE_SHIFT, |
| 624 | start_paddr >> PAGE_SHIFT, | 631 | start_pfn, end_pfn); |
| 625 | end_paddr >> PAGE_SHIFT); | ||
| 626 | 632 | ||
| 627 | /* | 633 | /* Add free regions on this node */ |
| 628 | * We need to do another scan of all memory sections to | 634 | for (i = 0; init_node_data[i].end_pfn; i++) { |
| 629 | * associate memory with the correct node. | 635 | unsigned long start, end; |
| 630 | */ | ||
| 631 | addr_cells = get_mem_addr_cells(); | ||
| 632 | size_cells = get_mem_size_cells(); | ||
| 633 | memory = NULL; | ||
| 634 | while ((memory = of_find_node_by_type(memory, "memory")) != NULL) { | ||
| 635 | unsigned long mem_start, mem_size; | ||
| 636 | int numa_domain, ranges; | ||
| 637 | unsigned int *memcell_buf; | ||
| 638 | unsigned int len; | ||
| 639 | |||
| 640 | memcell_buf = (unsigned int *)get_property(memory, "reg", &len); | ||
| 641 | if (!memcell_buf || len <= 0) | ||
| 642 | continue; | ||
| 643 | 636 | ||
| 644 | ranges = memory->n_addrs; /* ranges in cell */ | 637 | if (init_node_data[i].nid != nid) |
| 645 | new_range: | ||
| 646 | mem_start = read_n_cells(addr_cells, &memcell_buf); | ||
| 647 | mem_size = read_n_cells(size_cells, &memcell_buf); | ||
| 648 | if (numa_enabled) { | ||
| 649 | numa_domain = of_node_numa_domain(memory); | ||
| 650 | if (numa_domain >= MAX_NUMNODES) | ||
| 651 | numa_domain = 0; | ||
| 652 | } else | ||
| 653 | numa_domain = 0; | ||
| 654 | |||
| 655 | if (numa_domain != nid) | ||
| 656 | continue; | 638 | continue; |
| 657 | 639 | ||
| 658 | mem_size = numa_enforce_memory_limit(mem_start, mem_size); | 640 | start = init_node_data[i].start_pfn << PAGE_SHIFT; |
| 659 | if (mem_size) { | 641 | end = init_node_data[i].end_pfn << PAGE_SHIFT; |
| 660 | dbg("free_bootmem %lx %lx\n", mem_start, mem_size); | ||
| 661 | free_bootmem_node(NODE_DATA(nid), mem_start, mem_size); | ||
| 662 | } | ||
| 663 | 642 | ||
| 664 | if (--ranges) /* process all ranges in cell */ | 643 | dbg("free_bootmem %lx %lx\n", start, end - start); |
| 665 | goto new_range; | 644 | free_bootmem_node(NODE_DATA(nid), start, end - start); |
| 666 | } | 645 | } |
| 667 | 646 | ||
| 668 | /* | 647 | /* Mark reserved regions on this node */ |
| 669 | * Mark reserved regions on this node | ||
| 670 | */ | ||
| 671 | for (i = 0; i < lmb.reserved.cnt; i++) { | 648 | for (i = 0; i < lmb.reserved.cnt; i++) { |
| 672 | unsigned long physbase = lmb.reserved.region[i].base; | 649 | unsigned long physbase = lmb.reserved.region[i].base; |
| 673 | unsigned long size = lmb.reserved.region[i].size; | 650 | unsigned long size = lmb.reserved.region[i].size; |
| 651 | unsigned long start_paddr = start_pfn << PAGE_SHIFT; | ||
| 652 | unsigned long end_paddr = end_pfn << PAGE_SHIFT; | ||
| 674 | 653 | ||
| 675 | if (pa_to_nid(physbase) != nid && | 654 | if (early_pfn_to_nid(physbase >> PAGE_SHIFT) != nid && |
| 676 | pa_to_nid(physbase+size-1) != nid) | 655 | early_pfn_to_nid((physbase+size-1) >> PAGE_SHIFT) != nid) |
| 677 | continue; | 656 | continue; |
| 678 | 657 | ||
| 679 | if (physbase < end_paddr && | 658 | if (physbase < end_paddr && |
| @@ -693,46 +672,19 @@ new_range: | |||
| 693 | size); | 672 | size); |
| 694 | } | 673 | } |
| 695 | } | 674 | } |
| 696 | /* | ||
| 697 | * This loop may look famaliar, but we have to do it again | ||
| 698 | * after marking our reserved memory to mark memory present | ||
| 699 | * for sparsemem. | ||
| 700 | */ | ||
| 701 | addr_cells = get_mem_addr_cells(); | ||
| 702 | size_cells = get_mem_size_cells(); | ||
| 703 | memory = NULL; | ||
| 704 | while ((memory = of_find_node_by_type(memory, "memory")) != NULL) { | ||
| 705 | unsigned long mem_start, mem_size; | ||
| 706 | int numa_domain, ranges; | ||
| 707 | unsigned int *memcell_buf; | ||
| 708 | unsigned int len; | ||
| 709 | |||
| 710 | memcell_buf = (unsigned int *)get_property(memory, "reg", &len); | ||
| 711 | if (!memcell_buf || len <= 0) | ||
| 712 | continue; | ||
| 713 | 675 | ||
| 714 | ranges = memory->n_addrs; /* ranges in cell */ | 676 | /* Add regions into sparsemem */ |
| 715 | new_range2: | 677 | for (i = 0; init_node_data[i].end_pfn; i++) { |
| 716 | mem_start = read_n_cells(addr_cells, &memcell_buf); | 678 | unsigned long start, end; |
| 717 | mem_size = read_n_cells(size_cells, &memcell_buf); | 679 | |
| 718 | if (numa_enabled) { | 680 | if (init_node_data[i].nid != nid) |
| 719 | numa_domain = of_node_numa_domain(memory); | ||
| 720 | if (numa_domain >= MAX_NUMNODES) | ||
| 721 | numa_domain = 0; | ||
| 722 | } else | ||
| 723 | numa_domain = 0; | ||
| 724 | |||
| 725 | if (numa_domain != nid) | ||
| 726 | continue; | 681 | continue; |
| 727 | 682 | ||
| 728 | mem_size = numa_enforce_memory_limit(mem_start, mem_size); | 683 | start = init_node_data[i].start_pfn; |
| 729 | memory_present(numa_domain, mem_start >> PAGE_SHIFT, | 684 | end = init_node_data[i].end_pfn; |
| 730 | (mem_start + mem_size) >> PAGE_SHIFT); | ||
| 731 | 685 | ||
| 732 | if (--ranges) /* process all ranges in cell */ | 686 | memory_present(nid, start, end); |
| 733 | goto new_range2; | ||
| 734 | } | 687 | } |
| 735 | |||
| 736 | } | 688 | } |
| 737 | } | 689 | } |
| 738 | 690 | ||
| @@ -746,21 +698,18 @@ void __init paging_init(void) | |||
| 746 | memset(zholes_size, 0, sizeof(zholes_size)); | 698 | memset(zholes_size, 0, sizeof(zholes_size)); |
| 747 | 699 | ||
| 748 | for_each_online_node(nid) { | 700 | for_each_online_node(nid) { |
| 749 | unsigned long start_pfn; | 701 | unsigned long start_pfn, end_pfn, pages_present; |
| 750 | unsigned long end_pfn; | ||
| 751 | 702 | ||
| 752 | start_pfn = init_node_data[nid].node_start_pfn; | 703 | get_region(nid, &start_pfn, &end_pfn, &pages_present); |
| 753 | end_pfn = init_node_data[nid].node_end_pfn; | ||
| 754 | 704 | ||
| 755 | zones_size[ZONE_DMA] = end_pfn - start_pfn; | 705 | zones_size[ZONE_DMA] = end_pfn - start_pfn; |
| 756 | zholes_size[ZONE_DMA] = zones_size[ZONE_DMA] - | 706 | zholes_size[ZONE_DMA] = zones_size[ZONE_DMA] - pages_present; |
| 757 | init_node_data[nid].node_present_pages; | ||
| 758 | 707 | ||
| 759 | dbg("free_area_init node %d %lx %lx (hole: %lx)\n", nid, | 708 | dbg("free_area_init node %d %lx %lx (hole: %lx)\n", nid, |
| 760 | zones_size[ZONE_DMA], start_pfn, zholes_size[ZONE_DMA]); | 709 | zones_size[ZONE_DMA], start_pfn, zholes_size[ZONE_DMA]); |
| 761 | 710 | ||
| 762 | free_area_init_node(nid, NODE_DATA(nid), zones_size, | 711 | free_area_init_node(nid, NODE_DATA(nid), zones_size, start_pfn, |
| 763 | start_pfn, zholes_size); | 712 | zholes_size); |
| 764 | } | 713 | } |
| 765 | } | 714 | } |
| 766 | 715 | ||
diff --git a/arch/powerpc/oprofile/op_model_power4.c b/arch/powerpc/oprofile/op_model_power4.c index e3a024e324b6..a3401b46f3ba 100644 --- a/arch/powerpc/oprofile/op_model_power4.c +++ b/arch/powerpc/oprofile/op_model_power4.c | |||
| @@ -14,7 +14,6 @@ | |||
| 14 | #include <asm/system.h> | 14 | #include <asm/system.h> |
| 15 | #include <asm/processor.h> | 15 | #include <asm/processor.h> |
| 16 | #include <asm/cputable.h> | 16 | #include <asm/cputable.h> |
| 17 | #include <asm/systemcfg.h> | ||
| 18 | #include <asm/rtas.h> | 17 | #include <asm/rtas.h> |
| 19 | #include <asm/oprofile_impl.h> | 18 | #include <asm/oprofile_impl.h> |
| 20 | #include <asm/reg.h> | 19 | #include <asm/reg.h> |
diff --git a/arch/powerpc/platforms/pseries/rtasd.c b/arch/powerpc/platforms/pseries/rtasd.c index 00cf331a1dc4..a6f628d4c9dc 100644 --- a/arch/powerpc/platforms/pseries/rtasd.c +++ b/arch/powerpc/platforms/pseries/rtasd.c | |||
| @@ -27,7 +27,6 @@ | |||
| 27 | #include <asm/prom.h> | 27 | #include <asm/prom.h> |
| 28 | #include <asm/nvram.h> | 28 | #include <asm/nvram.h> |
| 29 | #include <asm/atomic.h> | 29 | #include <asm/atomic.h> |
| 30 | #include <asm/systemcfg.h> | ||
| 31 | 30 | ||
| 32 | #if 0 | 31 | #if 0 |
| 33 | #define DEBUG(A...) printk(KERN_ERR A) | 32 | #define DEBUG(A...) printk(KERN_ERR A) |
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c index e94247c28d42..31990829310c 100644 --- a/arch/powerpc/platforms/pseries/setup.c +++ b/arch/powerpc/platforms/pseries/setup.c | |||
| @@ -306,9 +306,7 @@ static void __init fw_feature_init(void) | |||
| 306 | } | 306 | } |
| 307 | 307 | ||
| 308 | of_node_put(dn); | 308 | of_node_put(dn); |
| 309 | no_rtas: | 309 | no_rtas: |
| 310 | printk(KERN_INFO "firmware_features = 0x%lx\n", | ||
| 311 | ppc64_firmware_features); | ||
| 312 | 310 | ||
| 313 | DBG(" <- fw_feature_init()\n"); | 311 | DBG(" <- fw_feature_init()\n"); |
| 314 | } | 312 | } |
diff --git a/arch/powerpc/platforms/pseries/smp.c b/arch/powerpc/platforms/pseries/smp.c index 3ba794ca3288..5800cde7d5ad 100644 --- a/arch/powerpc/platforms/pseries/smp.c +++ b/arch/powerpc/platforms/pseries/smp.c | |||
| @@ -46,7 +46,7 @@ | |||
| 46 | #include <asm/rtas.h> | 46 | #include <asm/rtas.h> |
| 47 | #include <asm/pSeries_reconfig.h> | 47 | #include <asm/pSeries_reconfig.h> |
| 48 | #include <asm/mpic.h> | 48 | #include <asm/mpic.h> |
| 49 | #include <asm/systemcfg.h> | 49 | #include <asm/vdso_datapage.h> |
| 50 | 50 | ||
| 51 | #include "plpar_wrappers.h" | 51 | #include "plpar_wrappers.h" |
| 52 | 52 | ||
| @@ -97,7 +97,7 @@ int pSeries_cpu_disable(void) | |||
| 97 | int cpu = smp_processor_id(); | 97 | int cpu = smp_processor_id(); |
| 98 | 98 | ||
| 99 | cpu_clear(cpu, cpu_online_map); | 99 | cpu_clear(cpu, cpu_online_map); |
| 100 | _systemcfg->processorCount--; | 100 | vdso_data->processorCount--; |
| 101 | 101 | ||
| 102 | /*fix boot_cpuid here*/ | 102 | /*fix boot_cpuid here*/ |
| 103 | if (cpu == boot_cpuid) | 103 | if (cpu == boot_cpuid) |
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c index cfcb2a56d662..ef4356b29a97 100644 --- a/arch/powerpc/xmon/xmon.c +++ b/arch/powerpc/xmon/xmon.c | |||
| @@ -1467,17 +1467,23 @@ read_spr(int n) | |||
| 1467 | { | 1467 | { |
| 1468 | unsigned int instrs[2]; | 1468 | unsigned int instrs[2]; |
| 1469 | unsigned long (*code)(void); | 1469 | unsigned long (*code)(void); |
| 1470 | unsigned long opd[3]; | ||
| 1471 | unsigned long ret = -1UL; | 1470 | unsigned long ret = -1UL; |
| 1471 | #ifdef CONFIG_PPC64 | ||
| 1472 | unsigned long opd[3]; | ||
| 1472 | 1473 | ||
| 1473 | instrs[0] = 0x7c6002a6 + ((n & 0x1F) << 16) + ((n & 0x3e0) << 6); | ||
| 1474 | instrs[1] = 0x4e800020; | ||
| 1475 | opd[0] = (unsigned long)instrs; | 1474 | opd[0] = (unsigned long)instrs; |
| 1476 | opd[1] = 0; | 1475 | opd[1] = 0; |
| 1477 | opd[2] = 0; | 1476 | opd[2] = 0; |
| 1477 | code = (unsigned long (*)(void)) opd; | ||
| 1478 | #else | ||
| 1479 | code = (unsigned long (*)(void)) instrs; | ||
| 1480 | #endif | ||
| 1481 | |||
| 1482 | /* mfspr r3,n; blr */ | ||
| 1483 | instrs[0] = 0x7c6002a6 + ((n & 0x1F) << 16) + ((n & 0x3e0) << 6); | ||
| 1484 | instrs[1] = 0x4e800020; | ||
| 1478 | store_inst(instrs); | 1485 | store_inst(instrs); |
| 1479 | store_inst(instrs+1); | 1486 | store_inst(instrs+1); |
| 1480 | code = (unsigned long (*)(void)) opd; | ||
| 1481 | 1487 | ||
| 1482 | if (setjmp(bus_error_jmp) == 0) { | 1488 | if (setjmp(bus_error_jmp) == 0) { |
| 1483 | catch_memory_errors = 1; | 1489 | catch_memory_errors = 1; |
| @@ -1499,16 +1505,21 @@ write_spr(int n, unsigned long val) | |||
| 1499 | { | 1505 | { |
| 1500 | unsigned int instrs[2]; | 1506 | unsigned int instrs[2]; |
| 1501 | unsigned long (*code)(unsigned long); | 1507 | unsigned long (*code)(unsigned long); |
| 1508 | #ifdef CONFIG_PPC64 | ||
| 1502 | unsigned long opd[3]; | 1509 | unsigned long opd[3]; |
| 1503 | 1510 | ||
| 1504 | instrs[0] = 0x7c6003a6 + ((n & 0x1F) << 16) + ((n & 0x3e0) << 6); | ||
| 1505 | instrs[1] = 0x4e800020; | ||
| 1506 | opd[0] = (unsigned long)instrs; | 1511 | opd[0] = (unsigned long)instrs; |
| 1507 | opd[1] = 0; | 1512 | opd[1] = 0; |
| 1508 | opd[2] = 0; | 1513 | opd[2] = 0; |
| 1514 | code = (unsigned long (*)(unsigned long)) opd; | ||
| 1515 | #else | ||
| 1516 | code = (unsigned long (*)(unsigned long)) instrs; | ||
| 1517 | #endif | ||
| 1518 | |||
| 1519 | instrs[0] = 0x7c6003a6 + ((n & 0x1F) << 16) + ((n & 0x3e0) << 6); | ||
| 1520 | instrs[1] = 0x4e800020; | ||
| 1509 | store_inst(instrs); | 1521 | store_inst(instrs); |
| 1510 | store_inst(instrs+1); | 1522 | store_inst(instrs+1); |
| 1511 | code = (unsigned long (*)(unsigned long)) opd; | ||
| 1512 | 1523 | ||
| 1513 | if (setjmp(bus_error_jmp) == 0) { | 1524 | if (setjmp(bus_error_jmp) == 0) { |
| 1514 | catch_memory_errors = 1; | 1525 | catch_memory_errors = 1; |
diff --git a/arch/ppc/kernel/asm-offsets.c b/arch/ppc/kernel/asm-offsets.c index 968261d69572..fe0e767fb94e 100644 --- a/arch/ppc/kernel/asm-offsets.c +++ b/arch/ppc/kernel/asm-offsets.c | |||
| @@ -25,6 +25,7 @@ | |||
| 25 | #include <asm/processor.h> | 25 | #include <asm/processor.h> |
| 26 | #include <asm/cputable.h> | 26 | #include <asm/cputable.h> |
| 27 | #include <asm/thread_info.h> | 27 | #include <asm/thread_info.h> |
| 28 | #include <asm/vdso_datapage.h> | ||
| 28 | 29 | ||
| 29 | #define DEFINE(sym, val) \ | 30 | #define DEFINE(sym, val) \ |
| 30 | asm volatile("\n->" #sym " %0 " #val : : "i" (val)) | 31 | asm volatile("\n->" #sym " %0 " #val : : "i" (val)) |
| @@ -143,5 +144,32 @@ main(void) | |||
| 143 | 144 | ||
| 144 | DEFINE(TASK_SIZE, TASK_SIZE); | 145 | DEFINE(TASK_SIZE, TASK_SIZE); |
| 145 | DEFINE(NUM_USER_SEGMENTS, TASK_SIZE>>28); | 146 | DEFINE(NUM_USER_SEGMENTS, TASK_SIZE>>28); |
| 147 | |||
| 148 | /* datapage offsets for use by vdso */ | ||
| 149 | DEFINE(CFG_TB_ORIG_STAMP, offsetof(struct vdso_data, tb_orig_stamp)); | ||
| 150 | DEFINE(CFG_TB_TICKS_PER_SEC, offsetof(struct vdso_data, tb_ticks_per_sec)); | ||
| 151 | DEFINE(CFG_TB_TO_XS, offsetof(struct vdso_data, tb_to_xs)); | ||
| 152 | DEFINE(CFG_STAMP_XSEC, offsetof(struct vdso_data, stamp_xsec)); | ||
| 153 | DEFINE(CFG_TB_UPDATE_COUNT, offsetof(struct vdso_data, tb_update_count)); | ||
| 154 | DEFINE(CFG_TZ_MINUTEWEST, offsetof(struct vdso_data, tz_minuteswest)); | ||
| 155 | DEFINE(CFG_TZ_DSTTIME, offsetof(struct vdso_data, tz_dsttime)); | ||
| 156 | DEFINE(CFG_SYSCALL_MAP32, offsetof(struct vdso_data, syscall_map_32)); | ||
| 157 | DEFINE(WTOM_CLOCK_SEC, offsetof(struct vdso_data, wtom_clock_sec)); | ||
| 158 | DEFINE(WTOM_CLOCK_NSEC, offsetof(struct vdso_data, wtom_clock_nsec)); | ||
| 159 | DEFINE(TVAL32_TV_SEC, offsetof(struct timeval, tv_sec)); | ||
| 160 | DEFINE(TVAL32_TV_USEC, offsetof(struct timeval, tv_usec)); | ||
| 161 | DEFINE(TSPEC32_TV_SEC, offsetof(struct timespec, tv_sec)); | ||
| 162 | DEFINE(TSPEC32_TV_NSEC, offsetof(struct timespec, tv_nsec)); | ||
| 163 | |||
| 164 | /* timeval/timezone offsets for use by vdso */ | ||
| 165 | DEFINE(TZONE_TZ_MINWEST, offsetof(struct timezone, tz_minuteswest)); | ||
| 166 | DEFINE(TZONE_TZ_DSTTIME, offsetof(struct timezone, tz_dsttime)); | ||
| 167 | |||
| 168 | /* Other bits used by the vdso */ | ||
| 169 | DEFINE(CLOCK_REALTIME, CLOCK_REALTIME); | ||
| 170 | DEFINE(CLOCK_MONOTONIC, CLOCK_MONOTONIC); | ||
| 171 | DEFINE(NSEC_PER_SEC, NSEC_PER_SEC); | ||
| 172 | DEFINE(CLOCK_REALTIME_RES, TICK_NSEC); | ||
| 173 | |||
| 146 | return 0; | 174 | return 0; |
| 147 | } | 175 | } |
diff --git a/arch/ppc/syslib/cpm2_pic.c b/arch/ppc/syslib/cpm2_pic.c index c867be6981cb..29d95d415ceb 100644 --- a/arch/ppc/syslib/cpm2_pic.c +++ b/arch/ppc/syslib/cpm2_pic.c | |||
| @@ -37,7 +37,7 @@ static u_char irq_to_siureg[] = { | |||
| 37 | static u_char irq_to_siubit[] = { | 37 | static u_char irq_to_siubit[] = { |
| 38 | 0, 15, 14, 13, 12, 11, 10, 9, | 38 | 0, 15, 14, 13, 12, 11, 10, 9, |
| 39 | 8, 7, 6, 5, 4, 3, 2, 1, | 39 | 8, 7, 6, 5, 4, 3, 2, 1, |
| 40 | 2, 1, 15, 14, 13, 12, 11, 10, | 40 | 2, 1, 0, 14, 13, 12, 11, 10, |
| 41 | 9, 8, 7, 6, 5, 4, 3, 0, | 41 | 9, 8, 7, 6, 5, 4, 3, 0, |
| 42 | 31, 30, 29, 28, 27, 26, 25, 24, | 42 | 31, 30, 29, 28, 27, 26, 25, 24, |
| 43 | 23, 22, 21, 20, 19, 18, 17, 16, | 43 | 23, 22, 21, 20, 19, 18, 17, 16, |
diff --git a/arch/ppc64/Kconfig b/arch/ppc64/Kconfig index c9d32db9d76a..9d10c12e87fe 100644 --- a/arch/ppc64/Kconfig +++ b/arch/ppc64/Kconfig | |||
| @@ -279,17 +279,12 @@ config ARCH_FLATMEM_ENABLE | |||
| 279 | def_bool y | 279 | def_bool y |
| 280 | depends on !NUMA | 280 | depends on !NUMA |
| 281 | 281 | ||
| 282 | config ARCH_DISCONTIGMEM_ENABLE | 282 | config ARCH_SPARSEMEM_ENABLE |
| 283 | def_bool y | ||
| 284 | depends on SMP && PPC_PSERIES | ||
| 285 | |||
| 286 | config ARCH_DISCONTIGMEM_DEFAULT | ||
| 287 | def_bool y | 283 | def_bool y |
| 288 | depends on ARCH_DISCONTIGMEM_ENABLE | ||
| 289 | 284 | ||
| 290 | config ARCH_SPARSEMEM_ENABLE | 285 | config ARCH_SPARSEMEM_DEFAULT |
| 291 | def_bool y | 286 | def_bool y |
| 292 | depends on ARCH_DISCONTIGMEM_ENABLE | 287 | depends on NUMA |
| 293 | 288 | ||
| 294 | source "mm/Kconfig" | 289 | source "mm/Kconfig" |
| 295 | 290 | ||
diff --git a/arch/ppc64/kernel/Makefile b/arch/ppc64/kernel/Makefile index 58b19f107656..dac4cc20fa93 100644 --- a/arch/ppc64/kernel/Makefile +++ b/arch/ppc64/kernel/Makefile | |||
| @@ -13,10 +13,8 @@ endif | |||
| 13 | 13 | ||
| 14 | obj-y += idle.o dma.o \ | 14 | obj-y += idle.o dma.o \ |
| 15 | align.o \ | 15 | align.o \ |
| 16 | udbg.o \ | ||
| 17 | rtc.o \ | 16 | rtc.o \ |
| 18 | iommu.o vdso.o | 17 | iommu.o |
| 19 | obj-y += vdso32/ vdso64/ | ||
| 20 | 18 | ||
| 21 | pci-obj-$(CONFIG_PPC_MULTIPLATFORM) += pci_dn.o pci_direct_iommu.o | 19 | pci-obj-$(CONFIG_PPC_MULTIPLATFORM) += pci_dn.o pci_direct_iommu.o |
| 22 | 20 | ||
| @@ -27,8 +25,6 @@ ifneq ($(CONFIG_PPC_MERGE),y) | |||
| 27 | obj-$(CONFIG_PPC_MULTIPLATFORM) += prom_init.o | 25 | obj-$(CONFIG_PPC_MULTIPLATFORM) += prom_init.o |
| 28 | endif | 26 | endif |
| 29 | 27 | ||
| 30 | obj-$(CONFIG_PPC_PSERIES) += udbg_16550.o | ||
| 31 | |||
| 32 | obj-$(CONFIG_KEXEC) += machine_kexec.o | 28 | obj-$(CONFIG_KEXEC) += machine_kexec.o |
| 33 | obj-$(CONFIG_MODULES) += module.o | 29 | obj-$(CONFIG_MODULES) += module.o |
| 34 | ifneq ($(CONFIG_PPC_MERGE),y) | 30 | ifneq ($(CONFIG_PPC_MERGE),y) |
| @@ -40,10 +36,6 @@ obj-$(CONFIG_BOOTX_TEXT) += btext.o | |||
| 40 | endif | 36 | endif |
| 41 | obj-$(CONFIG_HVCS) += hvcserver.o | 37 | obj-$(CONFIG_HVCS) += hvcserver.o |
| 42 | 38 | ||
| 43 | obj-$(CONFIG_PPC_PMAC) += udbg_scc.o | ||
| 44 | |||
| 45 | obj-$(CONFIG_PPC_MAPLE) += udbg_16550.o | ||
| 46 | |||
| 47 | obj-$(CONFIG_KPROBES) += kprobes.o | 39 | obj-$(CONFIG_KPROBES) += kprobes.o |
| 48 | 40 | ||
| 49 | ifneq ($(CONFIG_PPC_MERGE),y) | 41 | ifneq ($(CONFIG_PPC_MERGE),y) |
diff --git a/arch/ppc64/kernel/misc.S b/arch/ppc64/kernel/misc.S index 492bca6137eb..5e089deb0a2b 100644 --- a/arch/ppc64/kernel/misc.S +++ b/arch/ppc64/kernel/misc.S | |||
| @@ -186,7 +186,8 @@ _KPROBE(__flush_icache_range) | |||
| 186 | bdnz 2b | 186 | bdnz 2b |
| 187 | isync | 187 | isync |
| 188 | blr | 188 | blr |
| 189 | .previous .text | 189 | |
| 190 | .text | ||
| 190 | /* | 191 | /* |
| 191 | * Like above, but only do the D-cache. | 192 | * Like above, but only do the D-cache. |
| 192 | * | 193 | * |
diff --git a/arch/ppc64/kernel/vdso32/gettimeofday.S b/arch/ppc64/kernel/vdso32/gettimeofday.S deleted file mode 100644 index e243c1d24af7..000000000000 --- a/arch/ppc64/kernel/vdso32/gettimeofday.S +++ /dev/null | |||
| @@ -1,140 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Userland implementation of gettimeofday() for 32 bits processes in a | ||
| 3 | * ppc64 kernel for use in the vDSO | ||
| 4 | * | ||
| 5 | * Copyright (C) 2004 Benjamin Herrenschmuidt (benh@kernel.crashing.org), IBM Corp. | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or | ||
| 8 | * modify it under the terms of the GNU General Public License | ||
| 9 | * as published by the Free Software Foundation; either version | ||
| 10 | * 2 of the License, or (at your option) any later version. | ||
| 11 | */ | ||
| 12 | #include <linux/config.h> | ||
| 13 | #include <asm/processor.h> | ||
| 14 | #include <asm/ppc_asm.h> | ||
| 15 | #include <asm/vdso.h> | ||
| 16 | #include <asm/asm-offsets.h> | ||
| 17 | #include <asm/unistd.h> | ||
| 18 | |||
| 19 | .text | ||
| 20 | /* | ||
| 21 | * Exact prototype of gettimeofday | ||
| 22 | * | ||
| 23 | * int __kernel_gettimeofday(struct timeval *tv, struct timezone *tz); | ||
| 24 | * | ||
| 25 | */ | ||
| 26 | V_FUNCTION_BEGIN(__kernel_gettimeofday) | ||
| 27 | .cfi_startproc | ||
| 28 | mflr r12 | ||
| 29 | .cfi_register lr,r12 | ||
| 30 | |||
| 31 | mr r10,r3 /* r10 saves tv */ | ||
| 32 | mr r11,r4 /* r11 saves tz */ | ||
| 33 | bl __get_datapage@local /* get data page */ | ||
| 34 | mr r9, r3 /* datapage ptr in r9 */ | ||
| 35 | bl __do_get_xsec@local /* get xsec from tb & kernel */ | ||
| 36 | bne- 2f /* out of line -> do syscall */ | ||
| 37 | |||
| 38 | /* seconds are xsec >> 20 */ | ||
| 39 | rlwinm r5,r4,12,20,31 | ||
| 40 | rlwimi r5,r3,12,0,19 | ||
| 41 | stw r5,TVAL32_TV_SEC(r10) | ||
| 42 | |||
| 43 | /* get remaining xsec and convert to usec. we scale | ||
| 44 | * up remaining xsec by 12 bits and get the top 32 bits | ||
| 45 | * of the multiplication | ||
| 46 | */ | ||
| 47 | rlwinm r5,r4,12,0,19 | ||
| 48 | lis r6,1000000@h | ||
| 49 | ori r6,r6,1000000@l | ||
| 50 | mulhwu r5,r5,r6 | ||
| 51 | stw r5,TVAL32_TV_USEC(r10) | ||
| 52 | |||
| 53 | cmpli cr0,r11,0 /* check if tz is NULL */ | ||
| 54 | beq 1f | ||
| 55 | lwz r4,CFG_TZ_MINUTEWEST(r9)/* fill tz */ | ||
| 56 | lwz r5,CFG_TZ_DSTTIME(r9) | ||
| 57 | stw r4,TZONE_TZ_MINWEST(r11) | ||
| 58 | stw r5,TZONE_TZ_DSTTIME(r11) | ||
| 59 | |||
| 60 | 1: mtlr r12 | ||
| 61 | li r3,0 | ||
| 62 | blr | ||
| 63 | |||
| 64 | 2: mr r3,r10 | ||
| 65 | mr r4,r11 | ||
| 66 | li r0,__NR_gettimeofday | ||
| 67 | sc | ||
| 68 | b 1b | ||
| 69 | .cfi_endproc | ||
| 70 | V_FUNCTION_END(__kernel_gettimeofday) | ||
| 71 | |||
| 72 | /* | ||
| 73 | * This is the core of gettimeofday(), it returns the xsec | ||
| 74 | * value in r3 & r4 and expects the datapage ptr (non clobbered) | ||
| 75 | * in r9. clobbers r0,r4,r5,r6,r7,r8 | ||
| 76 | */ | ||
| 77 | __do_get_xsec: | ||
| 78 | .cfi_startproc | ||
| 79 | /* Check for update count & load values. We use the low | ||
| 80 | * order 32 bits of the update count | ||
| 81 | */ | ||
| 82 | 1: lwz r8,(CFG_TB_UPDATE_COUNT+4)(r9) | ||
| 83 | andi. r0,r8,1 /* pending update ? loop */ | ||
| 84 | bne- 1b | ||
| 85 | xor r0,r8,r8 /* create dependency */ | ||
| 86 | add r9,r9,r0 | ||
| 87 | |||
| 88 | /* Load orig stamp (offset to TB) */ | ||
| 89 | lwz r5,CFG_TB_ORIG_STAMP(r9) | ||
| 90 | lwz r6,(CFG_TB_ORIG_STAMP+4)(r9) | ||
| 91 | |||
| 92 | /* Get a stable TB value */ | ||
| 93 | 2: mftbu r3 | ||
| 94 | mftbl r4 | ||
| 95 | mftbu r0 | ||
| 96 | cmpl cr0,r3,r0 | ||
| 97 | bne- 2b | ||
| 98 | |||
| 99 | /* Substract tb orig stamp. If the high part is non-zero, we jump to the | ||
| 100 | * slow path which call the syscall. If it's ok, then we have our 32 bits | ||
| 101 | * tb_ticks value in r7 | ||
| 102 | */ | ||
| 103 | subfc r7,r6,r4 | ||
| 104 | subfe. r0,r5,r3 | ||
| 105 | bne- 3f | ||
| 106 | |||
| 107 | /* Load scale factor & do multiplication */ | ||
| 108 | lwz r5,CFG_TB_TO_XS(r9) /* load values */ | ||
| 109 | lwz r6,(CFG_TB_TO_XS+4)(r9) | ||
| 110 | mulhwu r4,r7,r5 | ||
| 111 | mulhwu r6,r7,r6 | ||
| 112 | mullw r0,r7,r5 | ||
| 113 | addc r6,r6,r0 | ||
| 114 | |||
| 115 | /* At this point, we have the scaled xsec value in r4 + XER:CA | ||
| 116 | * we load & add the stamp since epoch | ||
| 117 | */ | ||
| 118 | lwz r5,CFG_STAMP_XSEC(r9) | ||
| 119 | lwz r6,(CFG_STAMP_XSEC+4)(r9) | ||
| 120 | adde r4,r4,r6 | ||
| 121 | addze r3,r5 | ||
| 122 | |||
| 123 | /* We now have our result in r3,r4. We create a fake dependency | ||
| 124 | * on that result and re-check the counter | ||
| 125 | */ | ||
| 126 | xor r0,r4,r4 | ||
| 127 | add r9,r9,r0 | ||
| 128 | lwz r0,(CFG_TB_UPDATE_COUNT+4)(r9) | ||
| 129 | cmpl cr0,r8,r0 /* check if updated */ | ||
| 130 | bne- 1b | ||
| 131 | |||
| 132 | /* Warning ! The caller expects CR:EQ to be set to indicate a | ||
| 133 | * successful calculation (so it won't fallback to the syscall | ||
| 134 | * method). We have overriden that CR bit in the counter check, | ||
| 135 | * but fortunately, the loop exit condition _is_ CR:EQ set, so | ||
| 136 | * we can exit safely here. If you change this code, be careful | ||
| 137 | * of that side effect. | ||
| 138 | */ | ||
| 139 | 3: blr | ||
| 140 | .cfi_endproc | ||
diff --git a/arch/ppc64/kernel/vdso64/gettimeofday.S b/arch/ppc64/kernel/vdso64/gettimeofday.S deleted file mode 100644 index f6df8028570a..000000000000 --- a/arch/ppc64/kernel/vdso64/gettimeofday.S +++ /dev/null | |||
| @@ -1,91 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Userland implementation of gettimeofday() for 64 bits processes in a | ||
| 3 | * ppc64 kernel for use in the vDSO | ||
| 4 | * | ||
| 5 | * Copyright (C) 2004 Benjamin Herrenschmuidt (benh@kernel.crashing.org), | ||
| 6 | * IBM Corp. | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or | ||
| 9 | * modify it under the terms of the GNU General Public License | ||
| 10 | * as published by the Free Software Foundation; either version | ||
| 11 | * 2 of the License, or (at your option) any later version. | ||
| 12 | */ | ||
| 13 | #include <linux/config.h> | ||
| 14 | #include <asm/processor.h> | ||
| 15 | #include <asm/ppc_asm.h> | ||
| 16 | #include <asm/vdso.h> | ||
| 17 | #include <asm/asm-offsets.h> | ||
| 18 | |||
| 19 | .text | ||
| 20 | /* | ||
| 21 | * Exact prototype of gettimeofday | ||
| 22 | * | ||
| 23 | * int __kernel_gettimeofday(struct timeval *tv, struct timezone *tz); | ||
| 24 | * | ||
| 25 | */ | ||
| 26 | V_FUNCTION_BEGIN(__kernel_gettimeofday) | ||
| 27 | .cfi_startproc | ||
| 28 | mflr r12 | ||
| 29 | .cfi_register lr,r12 | ||
| 30 | |||
| 31 | mr r11,r3 /* r11 holds tv */ | ||
| 32 | mr r10,r4 /* r10 holds tz */ | ||
| 33 | bl V_LOCAL_FUNC(__get_datapage) /* get data page */ | ||
| 34 | bl V_LOCAL_FUNC(__do_get_xsec) /* get xsec from tb & kernel */ | ||
| 35 | lis r7,15 /* r7 = 1000000 = USEC_PER_SEC */ | ||
| 36 | ori r7,r7,16960 | ||
| 37 | rldicl r5,r4,44,20 /* r5 = sec = xsec / XSEC_PER_SEC */ | ||
| 38 | rldicr r6,r5,20,43 /* r6 = sec * XSEC_PER_SEC */ | ||
| 39 | std r5,TVAL64_TV_SEC(r11) /* store sec in tv */ | ||
| 40 | subf r0,r6,r4 /* r0 = xsec = (xsec - r6) */ | ||
| 41 | mulld r0,r0,r7 /* usec = (xsec * USEC_PER_SEC) / XSEC_PER_SEC */ | ||
| 42 | rldicl r0,r0,44,20 | ||
| 43 | cmpldi cr0,r10,0 /* check if tz is NULL */ | ||
| 44 | std r0,TVAL64_TV_USEC(r11) /* store usec in tv */ | ||
| 45 | beq 1f | ||
| 46 | lwz r4,CFG_TZ_MINUTEWEST(r3)/* fill tz */ | ||
| 47 | lwz r5,CFG_TZ_DSTTIME(r3) | ||
| 48 | stw r4,TZONE_TZ_MINWEST(r10) | ||
| 49 | stw r5,TZONE_TZ_DSTTIME(r10) | ||
| 50 | 1: mtlr r12 | ||
| 51 | li r3,0 /* always success */ | ||
| 52 | blr | ||
| 53 | .cfi_endproc | ||
| 54 | V_FUNCTION_END(__kernel_gettimeofday) | ||
| 55 | |||
| 56 | |||
| 57 | /* | ||
| 58 | * This is the core of gettimeofday(), it returns the xsec | ||
| 59 | * value in r4 and expects the datapage ptr (non clobbered) | ||
| 60 | * in r3. clobbers r0,r4,r5,r6,r7,r8 | ||
| 61 | */ | ||
| 62 | V_FUNCTION_BEGIN(__do_get_xsec) | ||
| 63 | .cfi_startproc | ||
| 64 | /* check for update count & load values */ | ||
| 65 | 1: ld r7,CFG_TB_UPDATE_COUNT(r3) | ||
| 66 | andi. r0,r4,1 /* pending update ? loop */ | ||
| 67 | bne- 1b | ||
| 68 | xor r0,r4,r4 /* create dependency */ | ||
| 69 | add r3,r3,r0 | ||
| 70 | |||
| 71 | /* Get TB & offset it */ | ||
| 72 | mftb r8 | ||
| 73 | ld r9,CFG_TB_ORIG_STAMP(r3) | ||
| 74 | subf r8,r9,r8 | ||
| 75 | |||
| 76 | /* Scale result */ | ||
| 77 | ld r5,CFG_TB_TO_XS(r3) | ||
| 78 | mulhdu r8,r8,r5 | ||
| 79 | |||
| 80 | /* Add stamp since epoch */ | ||
| 81 | ld r6,CFG_STAMP_XSEC(r3) | ||
| 82 | add r4,r6,r8 | ||
| 83 | |||
| 84 | xor r0,r4,r4 | ||
| 85 | add r3,r3,r0 | ||
| 86 | ld r0,CFG_TB_UPDATE_COUNT(r3) | ||
| 87 | cmpld cr0,r0,r7 /* check if updated */ | ||
| 88 | bne- 1b | ||
| 89 | blr | ||
| 90 | .cfi_endproc | ||
| 91 | V_FUNCTION_END(__do_get_xsec) | ||
diff --git a/arch/um/drivers/net_kern.c b/arch/um/drivers/net_kern.c index 4cf31a2ae19c..84c73a300acb 100644 --- a/arch/um/drivers/net_kern.c +++ b/arch/um/drivers/net_kern.c | |||
| @@ -268,9 +268,10 @@ void uml_net_user_timer_expire(unsigned long _conn) | |||
| 268 | static DEFINE_SPINLOCK(devices_lock); | 268 | static DEFINE_SPINLOCK(devices_lock); |
| 269 | static struct list_head devices = LIST_HEAD_INIT(devices); | 269 | static struct list_head devices = LIST_HEAD_INIT(devices); |
| 270 | 270 | ||
| 271 | static struct device_driver uml_net_driver = { | 271 | static struct platform_driver uml_net_driver = { |
| 272 | .name = DRIVER_NAME, | 272 | .driver = { |
| 273 | .bus = &platform_bus_type, | 273 | .name = DRIVER_NAME, |
| 274 | }, | ||
| 274 | }; | 275 | }; |
| 275 | static int driver_registered; | 276 | static int driver_registered; |
| 276 | 277 | ||
| @@ -317,7 +318,7 @@ static int eth_configure(int n, void *init, char *mac, | |||
| 317 | 318 | ||
| 318 | /* sysfs register */ | 319 | /* sysfs register */ |
| 319 | if (!driver_registered) { | 320 | if (!driver_registered) { |
| 320 | driver_register(¨_net_driver); | 321 | platform_driver_register(¨_net_driver); |
| 321 | driver_registered = 1; | 322 | driver_registered = 1; |
| 322 | } | 323 | } |
| 323 | device->pdev.id = n; | 324 | device->pdev.id = n; |
diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c index b2c86257b0f8..93898917cbe5 100644 --- a/arch/um/drivers/ubd_kern.c +++ b/arch/um/drivers/ubd_kern.c | |||
| @@ -823,9 +823,10 @@ static int ubd_mc_init(void) | |||
| 823 | 823 | ||
| 824 | __initcall(ubd_mc_init); | 824 | __initcall(ubd_mc_init); |
| 825 | 825 | ||
| 826 | static struct device_driver ubd_driver = { | 826 | static struct platform_driver ubd_driver = { |
| 827 | .name = DRIVER_NAME, | 827 | .driver = { |
| 828 | .bus = &platform_bus_type, | 828 | .name = DRIVER_NAME, |
| 829 | }, | ||
| 829 | }; | 830 | }; |
| 830 | 831 | ||
| 831 | int ubd_init(void) | 832 | int ubd_init(void) |
| @@ -850,7 +851,7 @@ int ubd_init(void) | |||
| 850 | if (register_blkdev(fake_major, "ubd")) | 851 | if (register_blkdev(fake_major, "ubd")) |
| 851 | return -1; | 852 | return -1; |
| 852 | } | 853 | } |
| 853 | driver_register(&ubd_driver); | 854 | platform_driver_register(&ubd_driver); |
| 854 | for (i = 0; i < MAX_DEV; i++) | 855 | for (i = 0; i < MAX_DEV; i++) |
| 855 | ubd_add(i); | 856 | ubd_add(i); |
| 856 | return 0; | 857 | return 0; |
diff --git a/arch/xtensa/platform-iss/network.c b/arch/xtensa/platform-iss/network.c index 96b9bb4a478d..0dc55cc8691b 100644 --- a/arch/xtensa/platform-iss/network.c +++ b/arch/xtensa/platform-iss/network.c | |||
| @@ -616,9 +616,10 @@ void iss_net_user_timer_expire(unsigned long _conn) | |||
| 616 | } | 616 | } |
| 617 | 617 | ||
| 618 | 618 | ||
| 619 | static struct device_driver iss_net_driver = { | 619 | static struct platform_driver iss_net_driver = { |
| 620 | .name = DRIVER_NAME, | 620 | .driver = { |
| 621 | .bus = &platform_bus_type, | 621 | .name = DRIVER_NAME, |
| 622 | }, | ||
| 622 | }; | 623 | }; |
| 623 | 624 | ||
| 624 | static int driver_registered; | 625 | static int driver_registered; |
| @@ -669,7 +670,7 @@ static int iss_net_configure(int index, char *init) | |||
| 669 | /* sysfs register */ | 670 | /* sysfs register */ |
| 670 | 671 | ||
| 671 | if (!driver_registered) { | 672 | if (!driver_registered) { |
| 672 | driver_register(&iss_net_driver); | 673 | platform_driver_register(&iss_net_driver); |
| 673 | driver_registered = 1; | 674 | driver_registered = 1; |
| 674 | } | 675 | } |
| 675 | 676 | ||
diff --git a/drivers/base/platform.c b/drivers/base/platform.c index 6d4736e89f1a..8827dafba945 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c | |||
| @@ -20,6 +20,8 @@ | |||
| 20 | 20 | ||
| 21 | #include "base.h" | 21 | #include "base.h" |
| 22 | 22 | ||
| 23 | #define to_platform_driver(drv) (container_of((drv), struct platform_driver, driver)) | ||
| 24 | |||
| 23 | struct device platform_bus = { | 25 | struct device platform_bus = { |
| 24 | .bus_id = "platform", | 26 | .bus_id = "platform", |
| 25 | }; | 27 | }; |
| @@ -354,6 +356,77 @@ error: | |||
| 354 | return ERR_PTR(retval); | 356 | return ERR_PTR(retval); |
| 355 | } | 357 | } |
| 356 | 358 | ||
| 359 | static int platform_drv_probe(struct device *_dev) | ||
| 360 | { | ||
| 361 | struct platform_driver *drv = to_platform_driver(_dev->driver); | ||
| 362 | struct platform_device *dev = to_platform_device(_dev); | ||
| 363 | |||
| 364 | return drv->probe(dev); | ||
| 365 | } | ||
| 366 | |||
| 367 | static int platform_drv_remove(struct device *_dev) | ||
| 368 | { | ||
| 369 | struct platform_driver *drv = to_platform_driver(_dev->driver); | ||
| 370 | struct platform_device *dev = to_platform_device(_dev); | ||
| 371 | |||
| 372 | return drv->remove(dev); | ||
| 373 | } | ||
| 374 | |||
| 375 | static void platform_drv_shutdown(struct device *_dev) | ||
| 376 | { | ||
| 377 | struct platform_driver *drv = to_platform_driver(_dev->driver); | ||
| 378 | struct platform_device *dev = to_platform_device(_dev); | ||
| 379 | |||
| 380 | drv->shutdown(dev); | ||
| 381 | } | ||
| 382 | |||
| 383 | static int platform_drv_suspend(struct device *_dev, pm_message_t state) | ||
| 384 | { | ||
| 385 | struct platform_driver *drv = to_platform_driver(_dev->driver); | ||
| 386 | struct platform_device *dev = to_platform_device(_dev); | ||
| 387 | |||
| 388 | return drv->suspend(dev, state); | ||
| 389 | } | ||
| 390 | |||
| 391 | static int platform_drv_resume(struct device *_dev) | ||
| 392 | { | ||
| 393 | struct platform_driver *drv = to_platform_driver(_dev->driver); | ||
| 394 | struct platform_device *dev = to_platform_device(_dev); | ||
| 395 | |||
| 396 | return drv->resume(dev); | ||
| 397 | } | ||
| 398 | |||
| 399 | /** | ||
| 400 | * platform_driver_register | ||
| 401 | * @drv: platform driver structure | ||
| 402 | */ | ||
| 403 | int platform_driver_register(struct platform_driver *drv) | ||
| 404 | { | ||
| 405 | drv->driver.bus = &platform_bus_type; | ||
| 406 | if (drv->probe) | ||
| 407 | drv->driver.probe = platform_drv_probe; | ||
| 408 | if (drv->remove) | ||
| 409 | drv->driver.remove = platform_drv_remove; | ||
| 410 | if (drv->shutdown) | ||
| 411 | drv->driver.shutdown = platform_drv_shutdown; | ||
| 412 | if (drv->suspend) | ||
| 413 | drv->driver.suspend = platform_drv_suspend; | ||
| 414 | if (drv->resume) | ||
| 415 | drv->driver.resume = platform_drv_resume; | ||
| 416 | return driver_register(&drv->driver); | ||
| 417 | } | ||
| 418 | EXPORT_SYMBOL_GPL(platform_driver_register); | ||
| 419 | |||
| 420 | /** | ||
| 421 | * platform_driver_unregister | ||
| 422 | * @drv: platform driver structure | ||
| 423 | */ | ||
| 424 | void platform_driver_unregister(struct platform_driver *drv) | ||
| 425 | { | ||
| 426 | driver_unregister(&drv->driver); | ||
| 427 | } | ||
| 428 | EXPORT_SYMBOL_GPL(platform_driver_unregister); | ||
| 429 | |||
| 357 | 430 | ||
| 358 | /** | 431 | /** |
| 359 | * platform_match - bind platform device to platform driver. | 432 | * platform_match - bind platform device to platform driver. |
diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c index c1d06ba449b6..d16bd4b5c117 100644 --- a/drivers/char/ipmi/ipmi_msghandler.c +++ b/drivers/char/ipmi/ipmi_msghandler.c | |||
| @@ -2648,7 +2648,7 @@ void ipmi_smi_msg_received(ipmi_smi_t intf, | |||
| 2648 | spin_lock_irqsave(&intf->waiting_msgs_lock, flags); | 2648 | spin_lock_irqsave(&intf->waiting_msgs_lock, flags); |
| 2649 | if (!list_empty(&intf->waiting_msgs)) { | 2649 | if (!list_empty(&intf->waiting_msgs)) { |
| 2650 | list_add_tail(&msg->link, &intf->waiting_msgs); | 2650 | list_add_tail(&msg->link, &intf->waiting_msgs); |
| 2651 | spin_unlock(&intf->waiting_msgs_lock); | 2651 | spin_unlock_irqrestore(&intf->waiting_msgs_lock, flags); |
| 2652 | goto out; | 2652 | goto out; |
| 2653 | } | 2653 | } |
| 2654 | spin_unlock_irqrestore(&intf->waiting_msgs_lock, flags); | 2654 | spin_unlock_irqrestore(&intf->waiting_msgs_lock, flags); |
| @@ -2657,9 +2657,9 @@ void ipmi_smi_msg_received(ipmi_smi_t intf, | |||
| 2657 | if (rv > 0) { | 2657 | if (rv > 0) { |
| 2658 | /* Could not handle the message now, just add it to a | 2658 | /* Could not handle the message now, just add it to a |
| 2659 | list to handle later. */ | 2659 | list to handle later. */ |
| 2660 | spin_lock(&intf->waiting_msgs_lock); | 2660 | spin_lock_irqsave(&intf->waiting_msgs_lock, flags); |
| 2661 | list_add_tail(&msg->link, &intf->waiting_msgs); | 2661 | list_add_tail(&msg->link, &intf->waiting_msgs); |
| 2662 | spin_unlock(&intf->waiting_msgs_lock); | 2662 | spin_unlock_irqrestore(&intf->waiting_msgs_lock, flags); |
| 2663 | } else if (rv == 0) { | 2663 | } else if (rv == 0) { |
| 2664 | ipmi_free_smi_msg(msg); | 2664 | ipmi_free_smi_msg(msg); |
| 2665 | } | 2665 | } |
diff --git a/drivers/char/s3c2410-rtc.c b/drivers/char/s3c2410-rtc.c index d724c0de4f28..3df7a574267b 100644 --- a/drivers/char/s3c2410-rtc.c +++ b/drivers/char/s3c2410-rtc.c | |||
| @@ -382,7 +382,7 @@ static struct rtc_ops s3c2410_rtcops = { | |||
| 382 | .proc = s3c2410_rtc_proc, | 382 | .proc = s3c2410_rtc_proc, |
| 383 | }; | 383 | }; |
| 384 | 384 | ||
| 385 | static void s3c2410_rtc_enable(struct device *dev, int en) | 385 | static void s3c2410_rtc_enable(struct platform_device *pdev, int en) |
| 386 | { | 386 | { |
| 387 | unsigned int tmp; | 387 | unsigned int tmp; |
| 388 | 388 | ||
| @@ -399,21 +399,21 @@ static void s3c2410_rtc_enable(struct device *dev, int en) | |||
| 399 | /* re-enable the device, and check it is ok */ | 399 | /* re-enable the device, and check it is ok */ |
| 400 | 400 | ||
| 401 | if ((readb(S3C2410_RTCCON) & S3C2410_RTCCON_RTCEN) == 0){ | 401 | if ((readb(S3C2410_RTCCON) & S3C2410_RTCCON_RTCEN) == 0){ |
| 402 | dev_info(dev, "rtc disabled, re-enabling\n"); | 402 | dev_info(&pdev->dev, "rtc disabled, re-enabling\n"); |
| 403 | 403 | ||
| 404 | tmp = readb(S3C2410_RTCCON); | 404 | tmp = readb(S3C2410_RTCCON); |
| 405 | writeb(tmp | S3C2410_RTCCON_RTCEN , S3C2410_RTCCON); | 405 | writeb(tmp | S3C2410_RTCCON_RTCEN , S3C2410_RTCCON); |
| 406 | } | 406 | } |
| 407 | 407 | ||
| 408 | if ((readb(S3C2410_RTCCON) & S3C2410_RTCCON_CNTSEL)){ | 408 | if ((readb(S3C2410_RTCCON) & S3C2410_RTCCON_CNTSEL)){ |
| 409 | dev_info(dev, "removing S3C2410_RTCCON_CNTSEL\n"); | 409 | dev_info(&pdev->dev, "removing S3C2410_RTCCON_CNTSEL\n"); |
| 410 | 410 | ||
| 411 | tmp = readb(S3C2410_RTCCON); | 411 | tmp = readb(S3C2410_RTCCON); |
| 412 | writeb(tmp& ~S3C2410_RTCCON_CNTSEL , S3C2410_RTCCON); | 412 | writeb(tmp& ~S3C2410_RTCCON_CNTSEL , S3C2410_RTCCON); |
| 413 | } | 413 | } |
| 414 | 414 | ||
| 415 | if ((readb(S3C2410_RTCCON) & S3C2410_RTCCON_CLKRST)){ | 415 | if ((readb(S3C2410_RTCCON) & S3C2410_RTCCON_CLKRST)){ |
| 416 | dev_info(dev, "removing S3C2410_RTCCON_CLKRST\n"); | 416 | dev_info(&pdev->dev, "removing S3C2410_RTCCON_CLKRST\n"); |
| 417 | 417 | ||
| 418 | tmp = readb(S3C2410_RTCCON); | 418 | tmp = readb(S3C2410_RTCCON); |
| 419 | writeb(tmp & ~S3C2410_RTCCON_CLKRST, S3C2410_RTCCON); | 419 | writeb(tmp & ~S3C2410_RTCCON_CLKRST, S3C2410_RTCCON); |
| @@ -421,7 +421,7 @@ static void s3c2410_rtc_enable(struct device *dev, int en) | |||
| 421 | } | 421 | } |
| 422 | } | 422 | } |
| 423 | 423 | ||
| 424 | static int s3c2410_rtc_remove(struct device *dev) | 424 | static int s3c2410_rtc_remove(struct platform_device *dev) |
| 425 | { | 425 | { |
| 426 | unregister_rtc(&s3c2410_rtcops); | 426 | unregister_rtc(&s3c2410_rtcops); |
| 427 | 427 | ||
| @@ -438,25 +438,24 @@ static int s3c2410_rtc_remove(struct device *dev) | |||
| 438 | return 0; | 438 | return 0; |
| 439 | } | 439 | } |
| 440 | 440 | ||
| 441 | static int s3c2410_rtc_probe(struct device *dev) | 441 | static int s3c2410_rtc_probe(struct platform_device *pdev) |
| 442 | { | 442 | { |
| 443 | struct platform_device *pdev = to_platform_device(dev); | ||
| 444 | struct resource *res; | 443 | struct resource *res; |
| 445 | int ret; | 444 | int ret; |
| 446 | 445 | ||
| 447 | pr_debug("%s: probe=%p, device=%p\n", __FUNCTION__, pdev, dev); | 446 | pr_debug("%s: probe=%p\n", __FUNCTION__, pdev); |
| 448 | 447 | ||
| 449 | /* find the IRQs */ | 448 | /* find the IRQs */ |
| 450 | 449 | ||
| 451 | s3c2410_rtc_tickno = platform_get_irq(pdev, 1); | 450 | s3c2410_rtc_tickno = platform_get_irq(pdev, 1); |
| 452 | if (s3c2410_rtc_tickno <= 0) { | 451 | if (s3c2410_rtc_tickno <= 0) { |
| 453 | dev_err(dev, "no irq for rtc tick\n"); | 452 | dev_err(&pdev->dev, "no irq for rtc tick\n"); |
| 454 | return -ENOENT; | 453 | return -ENOENT; |
| 455 | } | 454 | } |
| 456 | 455 | ||
| 457 | s3c2410_rtc_alarmno = platform_get_irq(pdev, 0); | 456 | s3c2410_rtc_alarmno = platform_get_irq(pdev, 0); |
| 458 | if (s3c2410_rtc_alarmno <= 0) { | 457 | if (s3c2410_rtc_alarmno <= 0) { |
| 459 | dev_err(dev, "no irq for alarm\n"); | 458 | dev_err(&pdev->dev, "no irq for alarm\n"); |
| 460 | return -ENOENT; | 459 | return -ENOENT; |
| 461 | } | 460 | } |
| 462 | 461 | ||
| @@ -467,7 +466,7 @@ static int s3c2410_rtc_probe(struct device *dev) | |||
| 467 | 466 | ||
| 468 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 467 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
| 469 | if (res == NULL) { | 468 | if (res == NULL) { |
| 470 | dev_err(dev, "failed to get memory region resource\n"); | 469 | dev_err(&pdev->dev, "failed to get memory region resource\n"); |
| 471 | return -ENOENT; | 470 | return -ENOENT; |
| 472 | } | 471 | } |
| 473 | 472 | ||
| @@ -475,14 +474,14 @@ static int s3c2410_rtc_probe(struct device *dev) | |||
| 475 | pdev->name); | 474 | pdev->name); |
| 476 | 475 | ||
| 477 | if (s3c2410_rtc_mem == NULL) { | 476 | if (s3c2410_rtc_mem == NULL) { |
| 478 | dev_err(dev, "failed to reserve memory region\n"); | 477 | dev_err(&pdev->dev, "failed to reserve memory region\n"); |
| 479 | ret = -ENOENT; | 478 | ret = -ENOENT; |
| 480 | goto exit_err; | 479 | goto exit_err; |
| 481 | } | 480 | } |
| 482 | 481 | ||
| 483 | s3c2410_rtc_base = ioremap(res->start, res->end - res->start + 1); | 482 | s3c2410_rtc_base = ioremap(res->start, res->end - res->start + 1); |
| 484 | if (s3c2410_rtc_base == NULL) { | 483 | if (s3c2410_rtc_base == NULL) { |
| 485 | dev_err(dev, "failed ioremap()\n"); | 484 | dev_err(&pdev->dev, "failed ioremap()\n"); |
| 486 | ret = -EINVAL; | 485 | ret = -EINVAL; |
| 487 | goto exit_err; | 486 | goto exit_err; |
| 488 | } | 487 | } |
| @@ -494,7 +493,7 @@ static int s3c2410_rtc_probe(struct device *dev) | |||
| 494 | 493 | ||
| 495 | /* check to see if everything is setup correctly */ | 494 | /* check to see if everything is setup correctly */ |
| 496 | 495 | ||
| 497 | s3c2410_rtc_enable(dev, 1); | 496 | s3c2410_rtc_enable(pdev, 1); |
| 498 | 497 | ||
| 499 | pr_debug("s3c2410_rtc: RTCCON=%02x\n", readb(S3C2410_RTCCON)); | 498 | pr_debug("s3c2410_rtc: RTCCON=%02x\n", readb(S3C2410_RTCCON)); |
| 500 | 499 | ||
| @@ -506,7 +505,7 @@ static int s3c2410_rtc_probe(struct device *dev) | |||
| 506 | return 0; | 505 | return 0; |
| 507 | 506 | ||
| 508 | exit_err: | 507 | exit_err: |
| 509 | dev_err(dev, "error %d during initialisation\n", ret); | 508 | dev_err(&pdev->dev, "error %d during initialisation\n", ret); |
| 510 | 509 | ||
| 511 | return ret; | 510 | return ret; |
| 512 | } | 511 | } |
| @@ -519,7 +518,7 @@ static struct timespec s3c2410_rtc_delta; | |||
| 519 | 518 | ||
| 520 | static int ticnt_save; | 519 | static int ticnt_save; |
| 521 | 520 | ||
| 522 | static int s3c2410_rtc_suspend(struct device *dev, pm_message_t state) | 521 | static int s3c2410_rtc_suspend(struct platform_device *pdev, pm_message_t state) |
| 523 | { | 522 | { |
| 524 | struct rtc_time tm; | 523 | struct rtc_time tm; |
| 525 | struct timespec time; | 524 | struct timespec time; |
| @@ -535,19 +534,19 @@ static int s3c2410_rtc_suspend(struct device *dev, pm_message_t state) | |||
| 535 | s3c2410_rtc_gettime(&tm); | 534 | s3c2410_rtc_gettime(&tm); |
| 536 | rtc_tm_to_time(&tm, &time.tv_sec); | 535 | rtc_tm_to_time(&tm, &time.tv_sec); |
| 537 | save_time_delta(&s3c2410_rtc_delta, &time); | 536 | save_time_delta(&s3c2410_rtc_delta, &time); |
| 538 | s3c2410_rtc_enable(dev, 0); | 537 | s3c2410_rtc_enable(pdev, 0); |
| 539 | 538 | ||
| 540 | return 0; | 539 | return 0; |
| 541 | } | 540 | } |
| 542 | 541 | ||
| 543 | static int s3c2410_rtc_resume(struct device *dev) | 542 | static int s3c2410_rtc_resume(struct platform_device *pdev) |
| 544 | { | 543 | { |
| 545 | struct rtc_time tm; | 544 | struct rtc_time tm; |
| 546 | struct timespec time; | 545 | struct timespec time; |
| 547 | 546 | ||
| 548 | time.tv_nsec = 0; | 547 | time.tv_nsec = 0; |
| 549 | 548 | ||
| 550 | s3c2410_rtc_enable(dev, 1); | 549 | s3c2410_rtc_enable(pdev, 1); |
| 551 | s3c2410_rtc_gettime(&tm); | 550 | s3c2410_rtc_gettime(&tm); |
| 552 | rtc_tm_to_time(&tm, &time.tv_sec); | 551 | rtc_tm_to_time(&tm, &time.tv_sec); |
| 553 | restore_time_delta(&s3c2410_rtc_delta, &time); | 552 | restore_time_delta(&s3c2410_rtc_delta, &time); |
| @@ -560,14 +559,15 @@ static int s3c2410_rtc_resume(struct device *dev) | |||
| 560 | #define s3c2410_rtc_resume NULL | 559 | #define s3c2410_rtc_resume NULL |
| 561 | #endif | 560 | #endif |
| 562 | 561 | ||
| 563 | static struct device_driver s3c2410_rtcdrv = { | 562 | static struct platform_driver s3c2410_rtcdrv = { |
| 564 | .name = "s3c2410-rtc", | ||
| 565 | .owner = THIS_MODULE, | ||
| 566 | .bus = &platform_bus_type, | ||
| 567 | .probe = s3c2410_rtc_probe, | 563 | .probe = s3c2410_rtc_probe, |
| 568 | .remove = s3c2410_rtc_remove, | 564 | .remove = s3c2410_rtc_remove, |
| 569 | .suspend = s3c2410_rtc_suspend, | 565 | .suspend = s3c2410_rtc_suspend, |
| 570 | .resume = s3c2410_rtc_resume, | 566 | .resume = s3c2410_rtc_resume, |
| 567 | .driver = { | ||
| 568 | .name = "s3c2410-rtc", | ||
| 569 | .owner = THIS_MODULE, | ||
| 570 | }, | ||
| 571 | }; | 571 | }; |
| 572 | 572 | ||
| 573 | static char __initdata banner[] = "S3C2410 RTC, (c) 2004 Simtec Electronics\n"; | 573 | static char __initdata banner[] = "S3C2410 RTC, (c) 2004 Simtec Electronics\n"; |
| @@ -575,12 +575,12 @@ static char __initdata banner[] = "S3C2410 RTC, (c) 2004 Simtec Electronics\n"; | |||
| 575 | static int __init s3c2410_rtc_init(void) | 575 | static int __init s3c2410_rtc_init(void) |
| 576 | { | 576 | { |
| 577 | printk(banner); | 577 | printk(banner); |
| 578 | return driver_register(&s3c2410_rtcdrv); | 578 | return platform_driver_register(&s3c2410_rtcdrv); |
| 579 | } | 579 | } |
| 580 | 580 | ||
| 581 | static void __exit s3c2410_rtc_exit(void) | 581 | static void __exit s3c2410_rtc_exit(void) |
| 582 | { | 582 | { |
| 583 | driver_unregister(&s3c2410_rtcdrv); | 583 | platform_driver_unregister(&s3c2410_rtcdrv); |
| 584 | } | 584 | } |
| 585 | 585 | ||
| 586 | module_init(s3c2410_rtc_init); | 586 | module_init(s3c2410_rtc_init); |
diff --git a/drivers/char/sonypi.c b/drivers/char/sonypi.c index d05067dcea01..51a07370e636 100644 --- a/drivers/char/sonypi.c +++ b/drivers/char/sonypi.c | |||
| @@ -1168,7 +1168,7 @@ static int sonypi_disable(void) | |||
| 1168 | #ifdef CONFIG_PM | 1168 | #ifdef CONFIG_PM |
| 1169 | static int old_camera_power; | 1169 | static int old_camera_power; |
| 1170 | 1170 | ||
| 1171 | static int sonypi_suspend(struct device *dev, pm_message_t state) | 1171 | static int sonypi_suspend(struct platform_device *dev, pm_message_t state) |
| 1172 | { | 1172 | { |
| 1173 | old_camera_power = sonypi_device.camera_power; | 1173 | old_camera_power = sonypi_device.camera_power; |
| 1174 | sonypi_disable(); | 1174 | sonypi_disable(); |
| @@ -1176,26 +1176,27 @@ static int sonypi_suspend(struct device *dev, pm_message_t state) | |||
| 1176 | return 0; | 1176 | return 0; |
| 1177 | } | 1177 | } |
| 1178 | 1178 | ||
| 1179 | static int sonypi_resume(struct device *dev) | 1179 | static int sonypi_resume(struct platform_device *dev) |
| 1180 | { | 1180 | { |
| 1181 | sonypi_enable(old_camera_power); | 1181 | sonypi_enable(old_camera_power); |
| 1182 | return 0; | 1182 | return 0; |
| 1183 | } | 1183 | } |
| 1184 | #endif | 1184 | #endif |
| 1185 | 1185 | ||
| 1186 | static void sonypi_shutdown(struct device *dev) | 1186 | static void sonypi_shutdown(struct platform_device *dev) |
| 1187 | { | 1187 | { |
| 1188 | sonypi_disable(); | 1188 | sonypi_disable(); |
| 1189 | } | 1189 | } |
| 1190 | 1190 | ||
| 1191 | static struct device_driver sonypi_driver = { | 1191 | static struct platform_driver sonypi_driver = { |
| 1192 | .name = "sonypi", | ||
| 1193 | .bus = &platform_bus_type, | ||
| 1194 | #ifdef CONFIG_PM | 1192 | #ifdef CONFIG_PM |
| 1195 | .suspend = sonypi_suspend, | 1193 | .suspend = sonypi_suspend, |
| 1196 | .resume = sonypi_resume, | 1194 | .resume = sonypi_resume, |
| 1197 | #endif | 1195 | #endif |
| 1198 | .shutdown = sonypi_shutdown, | 1196 | .shutdown = sonypi_shutdown, |
| 1197 | .driver = { | ||
| 1198 | .name = "sonypi", | ||
| 1199 | }, | ||
| 1199 | }; | 1200 | }; |
| 1200 | 1201 | ||
| 1201 | static int __devinit sonypi_create_input_devices(void) | 1202 | static int __devinit sonypi_create_input_devices(void) |
| @@ -1455,20 +1456,20 @@ static int __init sonypi_init(void) | |||
| 1455 | if (!dmi_check_system(sonypi_dmi_table)) | 1456 | if (!dmi_check_system(sonypi_dmi_table)) |
| 1456 | return -ENODEV; | 1457 | return -ENODEV; |
| 1457 | 1458 | ||
| 1458 | ret = driver_register(&sonypi_driver); | 1459 | ret = platform_driver_register(&sonypi_driver); |
| 1459 | if (ret) | 1460 | if (ret) |
| 1460 | return ret; | 1461 | return ret; |
| 1461 | 1462 | ||
| 1462 | ret = sonypi_probe(); | 1463 | ret = sonypi_probe(); |
| 1463 | if (ret) | 1464 | if (ret) |
| 1464 | driver_unregister(&sonypi_driver); | 1465 | platform_driver_unregister(&sonypi_driver); |
| 1465 | 1466 | ||
| 1466 | return ret; | 1467 | return ret; |
| 1467 | } | 1468 | } |
| 1468 | 1469 | ||
| 1469 | static void __exit sonypi_exit(void) | 1470 | static void __exit sonypi_exit(void) |
| 1470 | { | 1471 | { |
| 1471 | driver_unregister(&sonypi_driver); | 1472 | platform_driver_unregister(&sonypi_driver); |
| 1472 | sonypi_remove(); | 1473 | sonypi_remove(); |
| 1473 | } | 1474 | } |
| 1474 | 1475 | ||
diff --git a/drivers/char/tb0219.c b/drivers/char/tb0219.c index 24355b23b2ca..b3d411a756fe 100644 --- a/drivers/char/tb0219.c +++ b/drivers/char/tb0219.c | |||
| @@ -283,7 +283,7 @@ static void tb0219_pci_irq_init(void) | |||
| 283 | vr41xx_set_irq_level(TB0219_PCI_SLOT3_PIN, IRQ_LEVEL_LOW); | 283 | vr41xx_set_irq_level(TB0219_PCI_SLOT3_PIN, IRQ_LEVEL_LOW); |
| 284 | } | 284 | } |
| 285 | 285 | ||
| 286 | static int tb0219_probe(struct device *dev) | 286 | static int tb0219_probe(struct platform_device *dev) |
| 287 | { | 287 | { |
| 288 | int retval; | 288 | int retval; |
| 289 | 289 | ||
| @@ -319,7 +319,7 @@ static int tb0219_probe(struct device *dev) | |||
| 319 | return 0; | 319 | return 0; |
| 320 | } | 320 | } |
| 321 | 321 | ||
| 322 | static int tb0219_remove(struct device *dev) | 322 | static int tb0219_remove(struct platform_device *dev) |
| 323 | { | 323 | { |
| 324 | _machine_restart = old_machine_restart; | 324 | _machine_restart = old_machine_restart; |
| 325 | 325 | ||
| @@ -333,11 +333,12 @@ static int tb0219_remove(struct device *dev) | |||
| 333 | 333 | ||
| 334 | static struct platform_device *tb0219_platform_device; | 334 | static struct platform_device *tb0219_platform_device; |
| 335 | 335 | ||
| 336 | static struct device_driver tb0219_device_driver = { | 336 | static struct platform_driver tb0219_device_driver = { |
| 337 | .name = "TB0219", | ||
| 338 | .bus = &platform_bus_type, | ||
| 339 | .probe = tb0219_probe, | 337 | .probe = tb0219_probe, |
| 340 | .remove = tb0219_remove, | 338 | .remove = tb0219_remove, |
| 339 | .driver = { | ||
| 340 | .name = "TB0219", | ||
| 341 | }, | ||
| 341 | }; | 342 | }; |
| 342 | 343 | ||
| 343 | static int __devinit tanbac_tb0219_init(void) | 344 | static int __devinit tanbac_tb0219_init(void) |
| @@ -348,7 +349,7 @@ static int __devinit tanbac_tb0219_init(void) | |||
| 348 | if (IS_ERR(tb0219_platform_device)) | 349 | if (IS_ERR(tb0219_platform_device)) |
| 349 | return PTR_ERR(tb0219_platform_device); | 350 | return PTR_ERR(tb0219_platform_device); |
| 350 | 351 | ||
| 351 | retval = driver_register(&tb0219_device_driver); | 352 | retval = platform_driver_register(&tb0219_device_driver); |
| 352 | if (retval < 0) | 353 | if (retval < 0) |
| 353 | platform_device_unregister(tb0219_platform_device); | 354 | platform_device_unregister(tb0219_platform_device); |
| 354 | 355 | ||
| @@ -357,7 +358,7 @@ static int __devinit tanbac_tb0219_init(void) | |||
| 357 | 358 | ||
| 358 | static void __devexit tanbac_tb0219_exit(void) | 359 | static void __devexit tanbac_tb0219_exit(void) |
| 359 | { | 360 | { |
| 360 | driver_unregister(&tb0219_device_driver); | 361 | platform_driver_unregister(&tb0219_device_driver); |
| 361 | 362 | ||
| 362 | platform_device_unregister(tb0219_platform_device); | 363 | platform_device_unregister(tb0219_platform_device); |
| 363 | } | 364 | } |
diff --git a/drivers/char/vr41xx_giu.c b/drivers/char/vr41xx_giu.c index 94641085faf8..9ac6d43437b3 100644 --- a/drivers/char/vr41xx_giu.c +++ b/drivers/char/vr41xx_giu.c | |||
| @@ -613,7 +613,7 @@ static struct file_operations gpio_fops = { | |||
| 613 | .release = gpio_release, | 613 | .release = gpio_release, |
| 614 | }; | 614 | }; |
| 615 | 615 | ||
| 616 | static int giu_probe(struct device *dev) | 616 | static int giu_probe(struct platform_device *dev) |
| 617 | { | 617 | { |
| 618 | unsigned long start, size, flags = 0; | 618 | unsigned long start, size, flags = 0; |
| 619 | unsigned int nr_pins = 0; | 619 | unsigned int nr_pins = 0; |
| @@ -697,7 +697,7 @@ static int giu_probe(struct device *dev) | |||
| 697 | return cascade_irq(GIUINT_IRQ, giu_get_irq); | 697 | return cascade_irq(GIUINT_IRQ, giu_get_irq); |
| 698 | } | 698 | } |
| 699 | 699 | ||
| 700 | static int giu_remove(struct device *dev) | 700 | static int giu_remove(struct platform_device *dev) |
| 701 | { | 701 | { |
| 702 | iounmap(giu_base); | 702 | iounmap(giu_base); |
| 703 | 703 | ||
| @@ -710,11 +710,12 @@ static int giu_remove(struct device *dev) | |||
| 710 | 710 | ||
| 711 | static struct platform_device *giu_platform_device; | 711 | static struct platform_device *giu_platform_device; |
| 712 | 712 | ||
| 713 | static struct device_driver giu_device_driver = { | 713 | static struct platform_driver giu_device_driver = { |
| 714 | .name = "GIU", | ||
| 715 | .bus = &platform_bus_type, | ||
| 716 | .probe = giu_probe, | 714 | .probe = giu_probe, |
| 717 | .remove = giu_remove, | 715 | .remove = giu_remove, |
| 716 | .driver = { | ||
| 717 | .name = "GIU", | ||
| 718 | }, | ||
| 718 | }; | 719 | }; |
| 719 | 720 | ||
| 720 | static int __devinit vr41xx_giu_init(void) | 721 | static int __devinit vr41xx_giu_init(void) |
| @@ -725,7 +726,7 @@ static int __devinit vr41xx_giu_init(void) | |||
| 725 | if (IS_ERR(giu_platform_device)) | 726 | if (IS_ERR(giu_platform_device)) |
| 726 | return PTR_ERR(giu_platform_device); | 727 | return PTR_ERR(giu_platform_device); |
| 727 | 728 | ||
| 728 | retval = driver_register(&giu_device_driver); | 729 | retval = platform_driver_register(&giu_device_driver); |
| 729 | if (retval < 0) | 730 | if (retval < 0) |
| 730 | platform_device_unregister(giu_platform_device); | 731 | platform_device_unregister(giu_platform_device); |
| 731 | 732 | ||
| @@ -734,7 +735,7 @@ static int __devinit vr41xx_giu_init(void) | |||
| 734 | 735 | ||
| 735 | static void __devexit vr41xx_giu_exit(void) | 736 | static void __devexit vr41xx_giu_exit(void) |
| 736 | { | 737 | { |
| 737 | driver_unregister(&giu_device_driver); | 738 | platform_driver_unregister(&giu_device_driver); |
| 738 | 739 | ||
| 739 | platform_device_unregister(giu_platform_device); | 740 | platform_device_unregister(giu_platform_device); |
| 740 | } | 741 | } |
diff --git a/drivers/char/vr41xx_rtc.c b/drivers/char/vr41xx_rtc.c index 5e3292df69d8..435b30748e23 100644 --- a/drivers/char/vr41xx_rtc.c +++ b/drivers/char/vr41xx_rtc.c | |||
| @@ -560,13 +560,11 @@ static struct miscdevice rtc_miscdevice = { | |||
| 560 | .fops = &rtc_fops, | 560 | .fops = &rtc_fops, |
| 561 | }; | 561 | }; |
| 562 | 562 | ||
| 563 | static int rtc_probe(struct device *dev) | 563 | static int rtc_probe(struct platform_device *pdev) |
| 564 | { | 564 | { |
| 565 | struct platform_device *pdev; | ||
| 566 | unsigned int irq; | 565 | unsigned int irq; |
| 567 | int retval; | 566 | int retval; |
| 568 | 567 | ||
| 569 | pdev = to_platform_device(dev); | ||
| 570 | if (pdev->num_resources != 2) | 568 | if (pdev->num_resources != 2) |
| 571 | return -EBUSY; | 569 | return -EBUSY; |
| 572 | 570 | ||
| @@ -635,7 +633,7 @@ static int rtc_probe(struct device *dev) | |||
| 635 | return 0; | 633 | return 0; |
| 636 | } | 634 | } |
| 637 | 635 | ||
| 638 | static int rtc_remove(struct device *dev) | 636 | static int rtc_remove(struct platform_device *dev) |
| 639 | { | 637 | { |
| 640 | int retval; | 638 | int retval; |
| 641 | 639 | ||
| @@ -655,11 +653,12 @@ static int rtc_remove(struct device *dev) | |||
| 655 | 653 | ||
| 656 | static struct platform_device *rtc_platform_device; | 654 | static struct platform_device *rtc_platform_device; |
| 657 | 655 | ||
| 658 | static struct device_driver rtc_device_driver = { | 656 | static struct platform_driver rtc_device_driver = { |
| 659 | .name = rtc_name, | ||
| 660 | .bus = &platform_bus_type, | ||
| 661 | .probe = rtc_probe, | 657 | .probe = rtc_probe, |
| 662 | .remove = rtc_remove, | 658 | .remove = rtc_remove, |
| 659 | .driver = { | ||
| 660 | .name = rtc_name, | ||
| 661 | }, | ||
| 663 | }; | 662 | }; |
| 664 | 663 | ||
| 665 | static int __devinit vr41xx_rtc_init(void) | 664 | static int __devinit vr41xx_rtc_init(void) |
| @@ -691,7 +690,7 @@ static int __devinit vr41xx_rtc_init(void) | |||
| 691 | if (IS_ERR(rtc_platform_device)) | 690 | if (IS_ERR(rtc_platform_device)) |
| 692 | return PTR_ERR(rtc_platform_device); | 691 | return PTR_ERR(rtc_platform_device); |
| 693 | 692 | ||
| 694 | retval = driver_register(&rtc_device_driver); | 693 | retval = platform_driver_register(&rtc_device_driver); |
| 695 | if (retval < 0) | 694 | if (retval < 0) |
| 696 | platform_device_unregister(rtc_platform_device); | 695 | platform_device_unregister(rtc_platform_device); |
| 697 | 696 | ||
| @@ -700,7 +699,7 @@ static int __devinit vr41xx_rtc_init(void) | |||
| 700 | 699 | ||
| 701 | static void __devexit vr41xx_rtc_exit(void) | 700 | static void __devexit vr41xx_rtc_exit(void) |
| 702 | { | 701 | { |
| 703 | driver_unregister(&rtc_device_driver); | 702 | platform_driver_unregister(&rtc_device_driver); |
| 704 | 703 | ||
| 705 | platform_device_unregister(rtc_platform_device); | 704 | platform_device_unregister(rtc_platform_device); |
| 706 | } | 705 | } |
diff --git a/drivers/char/watchdog/mpcore_wdt.c b/drivers/char/watchdog/mpcore_wdt.c index da631c114fd1..9defcf861b67 100644 --- a/drivers/char/watchdog/mpcore_wdt.c +++ b/drivers/char/watchdog/mpcore_wdt.c | |||
| @@ -139,7 +139,7 @@ static int mpcore_wdt_set_heartbeat(int t) | |||
| 139 | */ | 139 | */ |
| 140 | static int mpcore_wdt_open(struct inode *inode, struct file *file) | 140 | static int mpcore_wdt_open(struct inode *inode, struct file *file) |
| 141 | { | 141 | { |
| 142 | struct mpcore_wdt *wdt = dev_get_drvdata(&mpcore_wdt_dev->dev); | 142 | struct mpcore_wdt *wdt = platform_get_drvdata(mpcore_wdt_dev); |
| 143 | 143 | ||
| 144 | if (test_and_set_bit(0, &wdt->timer_alive)) | 144 | if (test_and_set_bit(0, &wdt->timer_alive)) |
| 145 | return -EBUSY; | 145 | return -EBUSY; |
| @@ -291,9 +291,9 @@ static int mpcore_wdt_ioctl(struct inode *inode, struct file *file, | |||
| 291 | * System shutdown handler. Turn off the watchdog if we're | 291 | * System shutdown handler. Turn off the watchdog if we're |
| 292 | * restarting or halting the system. | 292 | * restarting or halting the system. |
| 293 | */ | 293 | */ |
| 294 | static void mpcore_wdt_shutdown(struct device *_dev) | 294 | static void mpcore_wdt_shutdown(struct platform_device *dev) |
| 295 | { | 295 | { |
| 296 | struct mpcore_wdt *wdt = dev_get_drvdata(_dev); | 296 | struct mpcore_wdt *wdt = platform_get_drvdata(dev); |
| 297 | 297 | ||
| 298 | if (system_state == SYSTEM_RESTART || system_state == SYSTEM_HALT) | 298 | if (system_state == SYSTEM_RESTART || system_state == SYSTEM_HALT) |
| 299 | mpcore_wdt_stop(wdt); | 299 | mpcore_wdt_stop(wdt); |
| @@ -317,9 +317,8 @@ static struct miscdevice mpcore_wdt_miscdev = { | |||
| 317 | .fops = &mpcore_wdt_fops, | 317 | .fops = &mpcore_wdt_fops, |
| 318 | }; | 318 | }; |
| 319 | 319 | ||
| 320 | static int __devinit mpcore_wdt_probe(struct device *_dev) | 320 | static int __devinit mpcore_wdt_probe(struct platform_device *dev) |
| 321 | { | 321 | { |
| 322 | struct platform_device *dev = to_platform_device(_dev); | ||
| 323 | struct mpcore_wdt *wdt; | 322 | struct mpcore_wdt *wdt; |
| 324 | struct resource *res; | 323 | struct resource *res; |
| 325 | int ret; | 324 | int ret; |
| @@ -364,7 +363,7 @@ static int __devinit mpcore_wdt_probe(struct device *_dev) | |||
| 364 | } | 363 | } |
| 365 | 364 | ||
| 366 | mpcore_wdt_stop(wdt); | 365 | mpcore_wdt_stop(wdt); |
| 367 | dev_set_drvdata(&dev->dev, wdt); | 366 | platform_set_drvdata(&dev->dev, wdt); |
| 368 | mpcore_wdt_dev = dev; | 367 | mpcore_wdt_dev = dev; |
| 369 | 368 | ||
| 370 | return 0; | 369 | return 0; |
| @@ -379,11 +378,11 @@ static int __devinit mpcore_wdt_probe(struct device *_dev) | |||
| 379 | return ret; | 378 | return ret; |
| 380 | } | 379 | } |
| 381 | 380 | ||
| 382 | static int __devexit mpcore_wdt_remove(struct device *dev) | 381 | static int __devexit mpcore_wdt_remove(struct platform_device *dev) |
| 383 | { | 382 | { |
| 384 | struct mpcore_wdt *wdt = dev_get_drvdata(dev); | 383 | struct mpcore_wdt *wdt = platform_get_drvdata(dev); |
| 385 | 384 | ||
| 386 | dev_set_drvdata(dev, NULL); | 385 | platform_set_drvdata(dev, NULL); |
| 387 | 386 | ||
| 388 | misc_deregister(&mpcore_wdt_miscdev); | 387 | misc_deregister(&mpcore_wdt_miscdev); |
| 389 | 388 | ||
| @@ -395,13 +394,14 @@ static int __devexit mpcore_wdt_remove(struct device *dev) | |||
| 395 | return 0; | 394 | return 0; |
| 396 | } | 395 | } |
| 397 | 396 | ||
| 398 | static struct device_driver mpcore_wdt_driver = { | 397 | static struct platform_driver mpcore_wdt_driver = { |
| 399 | .owner = THIS_MODULE, | ||
| 400 | .name = "mpcore_wdt", | ||
| 401 | .bus = &platform_bus_type, | ||
| 402 | .probe = mpcore_wdt_probe, | 398 | .probe = mpcore_wdt_probe, |
| 403 | .remove = __devexit_p(mpcore_wdt_remove), | 399 | .remove = __devexit_p(mpcore_wdt_remove), |
| 404 | .shutdown = mpcore_wdt_shutdown, | 400 | .shutdown = mpcore_wdt_shutdown, |
| 401 | .driver = { | ||
| 402 | .owner = THIS_MODULE, | ||
| 403 | .name = "mpcore_wdt", | ||
| 404 | }, | ||
| 405 | }; | 405 | }; |
| 406 | 406 | ||
| 407 | static char banner[] __initdata = KERN_INFO "MPcore Watchdog Timer: 0.1. mpcore_noboot=%d mpcore_margin=%d sec (nowayout= %d)\n"; | 407 | static char banner[] __initdata = KERN_INFO "MPcore Watchdog Timer: 0.1. mpcore_noboot=%d mpcore_margin=%d sec (nowayout= %d)\n"; |
| @@ -420,12 +420,12 @@ static int __init mpcore_wdt_init(void) | |||
| 420 | 420 | ||
| 421 | printk(banner, mpcore_noboot, mpcore_margin, nowayout); | 421 | printk(banner, mpcore_noboot, mpcore_margin, nowayout); |
| 422 | 422 | ||
| 423 | return driver_register(&mpcore_wdt_driver); | 423 | return platform_driver_register(&mpcore_wdt_driver); |
| 424 | } | 424 | } |
| 425 | 425 | ||
| 426 | static void __exit mpcore_wdt_exit(void) | 426 | static void __exit mpcore_wdt_exit(void) |
| 427 | { | 427 | { |
| 428 | driver_unregister(&mpcore_wdt_driver); | 428 | platform_driver_unregister(&mpcore_wdt_driver); |
| 429 | } | 429 | } |
| 430 | 430 | ||
| 431 | module_init(mpcore_wdt_init); | 431 | module_init(mpcore_wdt_init); |
diff --git a/drivers/char/watchdog/mv64x60_wdt.c b/drivers/char/watchdog/mv64x60_wdt.c index 119b3c541d95..00d9ef04a369 100644 --- a/drivers/char/watchdog/mv64x60_wdt.c +++ b/drivers/char/watchdog/mv64x60_wdt.c | |||
| @@ -182,10 +182,9 @@ static struct miscdevice mv64x60_wdt_miscdev = { | |||
| 182 | .fops = &mv64x60_wdt_fops, | 182 | .fops = &mv64x60_wdt_fops, |
| 183 | }; | 183 | }; |
| 184 | 184 | ||
| 185 | static int __devinit mv64x60_wdt_probe(struct device *dev) | 185 | static int __devinit mv64x60_wdt_probe(struct platform_device *dev) |
| 186 | { | 186 | { |
| 187 | struct platform_device *pd = to_platform_device(dev); | 187 | struct mv64x60_wdt_pdata *pdata = dev->dev.platform_data; |
| 188 | struct mv64x60_wdt_pdata *pdata = pd->dev.platform_data; | ||
| 189 | int bus_clk = 133; | 188 | int bus_clk = 133; |
| 190 | 189 | ||
| 191 | mv64x60_wdt_timeout = 10; | 190 | mv64x60_wdt_timeout = 10; |
| @@ -202,7 +201,7 @@ static int __devinit mv64x60_wdt_probe(struct device *dev) | |||
| 202 | return misc_register(&mv64x60_wdt_miscdev); | 201 | return misc_register(&mv64x60_wdt_miscdev); |
| 203 | } | 202 | } |
| 204 | 203 | ||
| 205 | static int __devexit mv64x60_wdt_remove(struct device *dev) | 204 | static int __devexit mv64x60_wdt_remove(struct platform_device *dev) |
| 206 | { | 205 | { |
| 207 | misc_deregister(&mv64x60_wdt_miscdev); | 206 | misc_deregister(&mv64x60_wdt_miscdev); |
| 208 | 207 | ||
| @@ -212,12 +211,13 @@ static int __devexit mv64x60_wdt_remove(struct device *dev) | |||
| 212 | return 0; | 211 | return 0; |
| 213 | } | 212 | } |
| 214 | 213 | ||
| 215 | static struct device_driver mv64x60_wdt_driver = { | 214 | static struct platform_driver mv64x60_wdt_driver = { |
| 216 | .owner = THIS_MODULE, | ||
| 217 | .name = MV64x60_WDT_NAME, | ||
| 218 | .bus = &platform_bus_type, | ||
| 219 | .probe = mv64x60_wdt_probe, | 215 | .probe = mv64x60_wdt_probe, |
| 220 | .remove = __devexit_p(mv64x60_wdt_remove), | 216 | .remove = __devexit_p(mv64x60_wdt_remove), |
| 217 | .driver = { | ||
| 218 | .owner = THIS_MODULE, | ||
| 219 | .name = MV64x60_WDT_NAME, | ||
| 220 | }, | ||
| 221 | }; | 221 | }; |
| 222 | 222 | ||
| 223 | static struct platform_device *mv64x60_wdt_dev; | 223 | static struct platform_device *mv64x60_wdt_dev; |
| @@ -235,14 +235,14 @@ static int __init mv64x60_wdt_init(void) | |||
| 235 | goto out; | 235 | goto out; |
| 236 | } | 236 | } |
| 237 | 237 | ||
| 238 | ret = driver_register(&mv64x60_wdt_driver); | 238 | ret = platform_driver_register(&mv64x60_wdt_driver); |
| 239 | out: | 239 | out: |
| 240 | return ret; | 240 | return ret; |
| 241 | } | 241 | } |
| 242 | 242 | ||
| 243 | static void __exit mv64x60_wdt_exit(void) | 243 | static void __exit mv64x60_wdt_exit(void) |
| 244 | { | 244 | { |
| 245 | driver_unregister(&mv64x60_wdt_driver); | 245 | platform_driver_unregister(&mv64x60_wdt_driver); |
| 246 | platform_device_unregister(mv64x60_wdt_dev); | 246 | platform_device_unregister(mv64x60_wdt_dev); |
| 247 | } | 247 | } |
| 248 | 248 | ||
diff --git a/drivers/char/watchdog/s3c2410_wdt.c b/drivers/char/watchdog/s3c2410_wdt.c index 751cb77b0715..eb667daee19b 100644 --- a/drivers/char/watchdog/s3c2410_wdt.c +++ b/drivers/char/watchdog/s3c2410_wdt.c | |||
| @@ -347,15 +347,14 @@ static irqreturn_t s3c2410wdt_irq(int irqno, void *param, | |||
| 347 | } | 347 | } |
| 348 | /* device interface */ | 348 | /* device interface */ |
| 349 | 349 | ||
| 350 | static int s3c2410wdt_probe(struct device *dev) | 350 | static int s3c2410wdt_probe(struct platform_device *pdev) |
| 351 | { | 351 | { |
| 352 | struct platform_device *pdev = to_platform_device(dev); | ||
| 353 | struct resource *res; | 352 | struct resource *res; |
| 354 | int started = 0; | 353 | int started = 0; |
| 355 | int ret; | 354 | int ret; |
| 356 | int size; | 355 | int size; |
| 357 | 356 | ||
| 358 | DBG("%s: probe=%p, device=%p\n", __FUNCTION__, pdev, dev); | 357 | DBG("%s: probe=%p\n", __FUNCTION__, pdev); |
| 359 | 358 | ||
| 360 | /* get the memory region for the watchdog timer */ | 359 | /* get the memory region for the watchdog timer */ |
| 361 | 360 | ||
| @@ -386,13 +385,13 @@ static int s3c2410wdt_probe(struct device *dev) | |||
| 386 | return -ENOENT; | 385 | return -ENOENT; |
| 387 | } | 386 | } |
| 388 | 387 | ||
| 389 | ret = request_irq(res->start, s3c2410wdt_irq, 0, pdev->name, dev); | 388 | ret = request_irq(res->start, s3c2410wdt_irq, 0, pdev->name, pdev); |
| 390 | if (ret != 0) { | 389 | if (ret != 0) { |
| 391 | printk(KERN_INFO PFX "failed to install irq (%d)\n", ret); | 390 | printk(KERN_INFO PFX "failed to install irq (%d)\n", ret); |
| 392 | return ret; | 391 | return ret; |
| 393 | } | 392 | } |
| 394 | 393 | ||
| 395 | wdt_clock = clk_get(dev, "watchdog"); | 394 | wdt_clock = clk_get(&pdev->dev, "watchdog"); |
| 396 | if (wdt_clock == NULL) { | 395 | if (wdt_clock == NULL) { |
| 397 | printk(KERN_INFO PFX "failed to find watchdog clock source\n"); | 396 | printk(KERN_INFO PFX "failed to find watchdog clock source\n"); |
| 398 | return -ENOENT; | 397 | return -ENOENT; |
| @@ -430,7 +429,7 @@ static int s3c2410wdt_probe(struct device *dev) | |||
| 430 | return 0; | 429 | return 0; |
| 431 | } | 430 | } |
| 432 | 431 | ||
| 433 | static int s3c2410wdt_remove(struct device *dev) | 432 | static int s3c2410wdt_remove(struct platform_device *dev) |
| 434 | { | 433 | { |
| 435 | if (wdt_mem != NULL) { | 434 | if (wdt_mem != NULL) { |
| 436 | release_resource(wdt_mem); | 435 | release_resource(wdt_mem); |
| @@ -454,7 +453,7 @@ static int s3c2410wdt_remove(struct device *dev) | |||
| 454 | return 0; | 453 | return 0; |
| 455 | } | 454 | } |
| 456 | 455 | ||
| 457 | static void s3c2410wdt_shutdown(struct device *dev) | 456 | static void s3c2410wdt_shutdown(struct platform_device *dev) |
| 458 | { | 457 | { |
| 459 | s3c2410wdt_stop(); | 458 | s3c2410wdt_stop(); |
| 460 | } | 459 | } |
| @@ -464,7 +463,7 @@ static void s3c2410wdt_shutdown(struct device *dev) | |||
| 464 | static unsigned long wtcon_save; | 463 | static unsigned long wtcon_save; |
| 465 | static unsigned long wtdat_save; | 464 | static unsigned long wtdat_save; |
| 466 | 465 | ||
| 467 | static int s3c2410wdt_suspend(struct device *dev, pm_message_t state) | 466 | static int s3c2410wdt_suspend(struct platform_device *dev, pm_message_t state) |
| 468 | { | 467 | { |
| 469 | /* Save watchdog state, and turn it off. */ | 468 | /* Save watchdog state, and turn it off. */ |
| 470 | wtcon_save = readl(wdt_base + S3C2410_WTCON); | 469 | wtcon_save = readl(wdt_base + S3C2410_WTCON); |
| @@ -476,7 +475,7 @@ static int s3c2410wdt_suspend(struct device *dev, pm_message_t state) | |||
| 476 | return 0; | 475 | return 0; |
| 477 | } | 476 | } |
| 478 | 477 | ||
| 479 | static int s3c2410wdt_resume(struct device *dev) | 478 | static int s3c2410wdt_resume(struct platform_device *dev) |
| 480 | { | 479 | { |
| 481 | /* Restore watchdog state. */ | 480 | /* Restore watchdog state. */ |
| 482 | 481 | ||
| @@ -496,15 +495,16 @@ static int s3c2410wdt_resume(struct device *dev) | |||
| 496 | #endif /* CONFIG_PM */ | 495 | #endif /* CONFIG_PM */ |
| 497 | 496 | ||
| 498 | 497 | ||
| 499 | static struct device_driver s3c2410wdt_driver = { | 498 | static struct platform_driver s3c2410wdt_driver = { |
| 500 | .owner = THIS_MODULE, | ||
| 501 | .name = "s3c2410-wdt", | ||
| 502 | .bus = &platform_bus_type, | ||
| 503 | .probe = s3c2410wdt_probe, | 499 | .probe = s3c2410wdt_probe, |
| 504 | .remove = s3c2410wdt_remove, | 500 | .remove = s3c2410wdt_remove, |
| 505 | .shutdown = s3c2410wdt_shutdown, | 501 | .shutdown = s3c2410wdt_shutdown, |
| 506 | .suspend = s3c2410wdt_suspend, | 502 | .suspend = s3c2410wdt_suspend, |
| 507 | .resume = s3c2410wdt_resume, | 503 | .resume = s3c2410wdt_resume, |
| 504 | .driver = { | ||
| 505 | .owner = THIS_MODULE, | ||
| 506 | .name = "s3c2410-wdt", | ||
| 507 | }, | ||
| 508 | }; | 508 | }; |
| 509 | 509 | ||
| 510 | 510 | ||
| @@ -513,12 +513,12 @@ static char banner[] __initdata = KERN_INFO "S3C2410 Watchdog Timer, (c) 2004 Si | |||
| 513 | static int __init watchdog_init(void) | 513 | static int __init watchdog_init(void) |
| 514 | { | 514 | { |
| 515 | printk(banner); | 515 | printk(banner); |
| 516 | return driver_register(&s3c2410wdt_driver); | 516 | return platform_driver_register(&s3c2410wdt_driver); |
| 517 | } | 517 | } |
| 518 | 518 | ||
| 519 | static void __exit watchdog_exit(void) | 519 | static void __exit watchdog_exit(void) |
| 520 | { | 520 | { |
| 521 | driver_unregister(&s3c2410wdt_driver); | 521 | platform_driver_unregister(&s3c2410wdt_driver); |
| 522 | } | 522 | } |
| 523 | 523 | ||
| 524 | module_init(watchdog_init); | 524 | module_init(watchdog_init); |
diff --git a/drivers/hwmon/hdaps.c b/drivers/hwmon/hdaps.c index 1e5dfc7805e2..c81bd4bce1b8 100644 --- a/drivers/hwmon/hdaps.c +++ b/drivers/hwmon/hdaps.c | |||
| @@ -60,9 +60,11 @@ | |||
| 60 | 60 | ||
| 61 | #define HDAPS_POLL_PERIOD (HZ/20) /* poll for input every 1/20s */ | 61 | #define HDAPS_POLL_PERIOD (HZ/20) /* poll for input every 1/20s */ |
| 62 | #define HDAPS_INPUT_FUZZ 4 /* input event threshold */ | 62 | #define HDAPS_INPUT_FUZZ 4 /* input event threshold */ |
| 63 | #define HDAPS_INPUT_FLAT 4 | ||
| 63 | 64 | ||
| 64 | static struct timer_list hdaps_timer; | 65 | static struct timer_list hdaps_timer; |
| 65 | static struct platform_device *pdev; | 66 | static struct platform_device *pdev; |
| 67 | static struct input_dev *hdaps_idev; | ||
| 66 | static unsigned int hdaps_invert; | 68 | static unsigned int hdaps_invert; |
| 67 | static u8 km_activity; | 69 | static u8 km_activity; |
| 68 | static int rest_x; | 70 | static int rest_x; |
| @@ -284,7 +286,7 @@ out: | |||
| 284 | 286 | ||
| 285 | /* Device model stuff */ | 287 | /* Device model stuff */ |
| 286 | 288 | ||
| 287 | static int hdaps_probe(struct device *dev) | 289 | static int hdaps_probe(struct platform_device *dev) |
| 288 | { | 290 | { |
| 289 | int ret; | 291 | int ret; |
| 290 | 292 | ||
| @@ -296,29 +298,18 @@ static int hdaps_probe(struct device *dev) | |||
| 296 | return 0; | 298 | return 0; |
| 297 | } | 299 | } |
| 298 | 300 | ||
| 299 | static int hdaps_resume(struct device *dev) | 301 | static int hdaps_resume(struct platform_device *dev) |
| 300 | { | 302 | { |
| 301 | return hdaps_device_init(); | 303 | return hdaps_device_init(); |
| 302 | } | 304 | } |
| 303 | 305 | ||
| 304 | static struct device_driver hdaps_driver = { | 306 | static struct platform_driver hdaps_driver = { |
| 305 | .name = "hdaps", | ||
| 306 | .bus = &platform_bus_type, | ||
| 307 | .owner = THIS_MODULE, | ||
| 308 | .probe = hdaps_probe, | 307 | .probe = hdaps_probe, |
| 309 | .resume = hdaps_resume | 308 | .resume = hdaps_resume, |
| 310 | }; | 309 | .driver = { |
| 311 | 310 | .name = "hdaps", | |
| 312 | /* Input class stuff */ | 311 | .owner = THIS_MODULE, |
| 313 | 312 | }, | |
| 314 | static struct input_dev hdaps_idev = { | ||
| 315 | .name = "hdaps", | ||
| 316 | .evbit = { BIT(EV_ABS) }, | ||
| 317 | .absbit = { BIT(ABS_X) | BIT(ABS_Y) }, | ||
| 318 | .absmin = { [ABS_X] = -256, [ABS_Y] = -256 }, | ||
| 319 | .absmax = { [ABS_X] = 256, [ABS_Y] = 256 }, | ||
| 320 | .absfuzz = { [ABS_X] = HDAPS_INPUT_FUZZ, [ABS_Y] = HDAPS_INPUT_FUZZ }, | ||
| 321 | .absflat = { [ABS_X] = HDAPS_INPUT_FUZZ, [ABS_Y] = HDAPS_INPUT_FUZZ }, | ||
| 322 | }; | 313 | }; |
| 323 | 314 | ||
| 324 | /* | 315 | /* |
| @@ -342,9 +333,9 @@ static void hdaps_mousedev_poll(unsigned long unused) | |||
| 342 | if (__hdaps_read_pair(HDAPS_PORT_XPOS, HDAPS_PORT_YPOS, &x, &y)) | 333 | if (__hdaps_read_pair(HDAPS_PORT_XPOS, HDAPS_PORT_YPOS, &x, &y)) |
| 343 | goto out; | 334 | goto out; |
| 344 | 335 | ||
| 345 | input_report_abs(&hdaps_idev, ABS_X, x - rest_x); | 336 | input_report_abs(hdaps_idev, ABS_X, x - rest_x); |
| 346 | input_report_abs(&hdaps_idev, ABS_Y, y - rest_y); | 337 | input_report_abs(hdaps_idev, ABS_Y, y - rest_y); |
| 347 | input_sync(&hdaps_idev); | 338 | input_sync(hdaps_idev); |
| 348 | 339 | ||
| 349 | mod_timer(&hdaps_timer, jiffies + HDAPS_POLL_PERIOD); | 340 | mod_timer(&hdaps_timer, jiffies + HDAPS_POLL_PERIOD); |
| 350 | 341 | ||
| @@ -550,7 +541,7 @@ static int __init hdaps_init(void) | |||
| 550 | goto out; | 541 | goto out; |
| 551 | } | 542 | } |
| 552 | 543 | ||
| 553 | ret = driver_register(&hdaps_driver); | 544 | ret = platform_driver_register(&hdaps_driver); |
| 554 | if (ret) | 545 | if (ret) |
| 555 | goto out_region; | 546 | goto out_region; |
| 556 | 547 | ||
| @@ -564,12 +555,25 @@ static int __init hdaps_init(void) | |||
| 564 | if (ret) | 555 | if (ret) |
| 565 | goto out_device; | 556 | goto out_device; |
| 566 | 557 | ||
| 558 | hdaps_idev = input_allocate_device(); | ||
| 559 | if (!hdaps_idev) { | ||
| 560 | ret = -ENOMEM; | ||
| 561 | goto out_group; | ||
| 562 | } | ||
| 563 | |||
| 567 | /* initial calibrate for the input device */ | 564 | /* initial calibrate for the input device */ |
| 568 | hdaps_calibrate(); | 565 | hdaps_calibrate(); |
| 569 | 566 | ||
| 570 | /* initialize the input class */ | 567 | /* initialize the input class */ |
| 571 | hdaps_idev.dev = &pdev->dev; | 568 | hdaps_idev->name = "hdaps"; |
| 572 | input_register_device(&hdaps_idev); | 569 | hdaps_idev->cdev.dev = &pdev->dev; |
| 570 | hdaps_idev->evbit[0] = BIT(EV_ABS); | ||
| 571 | input_set_abs_params(hdaps_idev, ABS_X, | ||
| 572 | -256, 256, HDAPS_INPUT_FUZZ, HDAPS_INPUT_FLAT); | ||
| 573 | input_set_abs_params(hdaps_idev, ABS_X, | ||
| 574 | -256, 256, HDAPS_INPUT_FUZZ, HDAPS_INPUT_FLAT); | ||
| 575 | |||
| 576 | input_register_device(hdaps_idev); | ||
| 573 | 577 | ||
| 574 | /* start up our timer for the input device */ | 578 | /* start up our timer for the input device */ |
| 575 | init_timer(&hdaps_timer); | 579 | init_timer(&hdaps_timer); |
| @@ -580,10 +584,12 @@ static int __init hdaps_init(void) | |||
| 580 | printk(KERN_INFO "hdaps: driver successfully loaded.\n"); | 584 | printk(KERN_INFO "hdaps: driver successfully loaded.\n"); |
| 581 | return 0; | 585 | return 0; |
| 582 | 586 | ||
| 587 | out_group: | ||
| 588 | sysfs_remove_group(&pdev->dev.kobj, &hdaps_attribute_group); | ||
| 583 | out_device: | 589 | out_device: |
| 584 | platform_device_unregister(pdev); | 590 | platform_device_unregister(pdev); |
| 585 | out_driver: | 591 | out_driver: |
| 586 | driver_unregister(&hdaps_driver); | 592 | platform_driver_unregister(&hdaps_driver); |
| 587 | out_region: | 593 | out_region: |
| 588 | release_region(HDAPS_LOW_PORT, HDAPS_NR_PORTS); | 594 | release_region(HDAPS_LOW_PORT, HDAPS_NR_PORTS); |
| 589 | out: | 595 | out: |
| @@ -594,10 +600,10 @@ out: | |||
| 594 | static void __exit hdaps_exit(void) | 600 | static void __exit hdaps_exit(void) |
| 595 | { | 601 | { |
| 596 | del_timer_sync(&hdaps_timer); | 602 | del_timer_sync(&hdaps_timer); |
| 597 | input_unregister_device(&hdaps_idev); | 603 | input_unregister_device(hdaps_idev); |
| 598 | sysfs_remove_group(&pdev->dev.kobj, &hdaps_attribute_group); | 604 | sysfs_remove_group(&pdev->dev.kobj, &hdaps_attribute_group); |
| 599 | platform_device_unregister(pdev); | 605 | platform_device_unregister(pdev); |
| 600 | driver_unregister(&hdaps_driver); | 606 | platform_driver_unregister(&hdaps_driver); |
| 601 | release_region(HDAPS_LOW_PORT, HDAPS_NR_PORTS); | 607 | release_region(HDAPS_LOW_PORT, HDAPS_NR_PORTS); |
| 602 | 608 | ||
| 603 | printk(KERN_INFO "hdaps: driver unloaded.\n"); | 609 | printk(KERN_INFO "hdaps: driver unloaded.\n"); |
diff --git a/drivers/i2c/busses/i2c-iop3xx.c b/drivers/i2c/busses/i2c-iop3xx.c index cfae4ad00fae..1414851a17b8 100644 --- a/drivers/i2c/busses/i2c-iop3xx.c +++ b/drivers/i2c/busses/i2c-iop3xx.c | |||
| @@ -405,10 +405,9 @@ static struct i2c_algorithm iop3xx_i2c_algo = { | |||
| 405 | }; | 405 | }; |
| 406 | 406 | ||
| 407 | static int | 407 | static int |
| 408 | iop3xx_i2c_remove(struct device *device) | 408 | iop3xx_i2c_remove(struct platform_device *pdev) |
| 409 | { | 409 | { |
| 410 | struct platform_device *pdev = to_platform_device(device); | 410 | struct i2c_adapter *padapter = platform_get_drvdata(pdev); |
| 411 | struct i2c_adapter *padapter = dev_get_drvdata(&pdev->dev); | ||
| 412 | struct i2c_algo_iop3xx_data *adapter_data = | 411 | struct i2c_algo_iop3xx_data *adapter_data = |
| 413 | (struct i2c_algo_iop3xx_data *)padapter->algo_data; | 412 | (struct i2c_algo_iop3xx_data *)padapter->algo_data; |
| 414 | struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 413 | struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
| @@ -426,15 +425,14 @@ iop3xx_i2c_remove(struct device *device) | |||
| 426 | kfree(adapter_data); | 425 | kfree(adapter_data); |
| 427 | kfree(padapter); | 426 | kfree(padapter); |
| 428 | 427 | ||
| 429 | dev_set_drvdata(&pdev->dev, NULL); | 428 | platform_set_drvdata(pdev, NULL); |
| 430 | 429 | ||
| 431 | return 0; | 430 | return 0; |
| 432 | } | 431 | } |
| 433 | 432 | ||
| 434 | static int | 433 | static int |
| 435 | iop3xx_i2c_probe(struct device *dev) | 434 | iop3xx_i2c_probe(struct platform_device *pdev) |
| 436 | { | 435 | { |
| 437 | struct platform_device *pdev = to_platform_device(dev); | ||
| 438 | struct resource *res; | 436 | struct resource *res; |
| 439 | int ret; | 437 | int ret; |
| 440 | struct i2c_adapter *new_adapter; | 438 | struct i2c_adapter *new_adapter; |
| @@ -499,7 +497,7 @@ iop3xx_i2c_probe(struct device *dev) | |||
| 499 | iop3xx_i2c_set_slave_addr(adapter_data); | 497 | iop3xx_i2c_set_slave_addr(adapter_data); |
| 500 | iop3xx_i2c_enable(adapter_data); | 498 | iop3xx_i2c_enable(adapter_data); |
| 501 | 499 | ||
| 502 | dev_set_drvdata(&pdev->dev, new_adapter); | 500 | platform_set_drvdata(pdev, new_adapter); |
| 503 | new_adapter->algo_data = adapter_data; | 501 | new_adapter->algo_data = adapter_data; |
| 504 | 502 | ||
| 505 | i2c_add_adapter(new_adapter); | 503 | i2c_add_adapter(new_adapter); |
| @@ -523,24 +521,25 @@ out: | |||
| 523 | } | 521 | } |
| 524 | 522 | ||
| 525 | 523 | ||
| 526 | static struct device_driver iop3xx_i2c_driver = { | 524 | static struct platform_driver iop3xx_i2c_driver = { |
| 527 | .owner = THIS_MODULE, | ||
| 528 | .name = "IOP3xx-I2C", | ||
| 529 | .bus = &platform_bus_type, | ||
| 530 | .probe = iop3xx_i2c_probe, | 525 | .probe = iop3xx_i2c_probe, |
| 531 | .remove = iop3xx_i2c_remove | 526 | .remove = iop3xx_i2c_remove, |
| 527 | .driver = { | ||
| 528 | .owner = THIS_MODULE, | ||
| 529 | .name = "IOP3xx-I2C", | ||
| 530 | }, | ||
| 532 | }; | 531 | }; |
| 533 | 532 | ||
| 534 | static int __init | 533 | static int __init |
| 535 | i2c_iop3xx_init (void) | 534 | i2c_iop3xx_init (void) |
| 536 | { | 535 | { |
| 537 | return driver_register(&iop3xx_i2c_driver); | 536 | return platform_driver_register(&iop3xx_i2c_driver); |
| 538 | } | 537 | } |
| 539 | 538 | ||
| 540 | static void __exit | 539 | static void __exit |
| 541 | i2c_iop3xx_exit (void) | 540 | i2c_iop3xx_exit (void) |
| 542 | { | 541 | { |
| 543 | driver_unregister(&iop3xx_i2c_driver); | 542 | platform_driver_unregister(&iop3xx_i2c_driver); |
| 544 | return; | 543 | return; |
| 545 | } | 544 | } |
| 546 | 545 | ||
diff --git a/drivers/i2c/busses/i2c-ixp2000.c b/drivers/i2c/busses/i2c-ixp2000.c index 64552a376f2d..cef024a7d048 100644 --- a/drivers/i2c/busses/i2c-ixp2000.c +++ b/drivers/i2c/busses/i2c-ixp2000.c | |||
| @@ -86,12 +86,11 @@ struct ixp2000_i2c_data { | |||
| 86 | struct i2c_algo_bit_data algo_data; | 86 | struct i2c_algo_bit_data algo_data; |
| 87 | }; | 87 | }; |
| 88 | 88 | ||
| 89 | static int ixp2000_i2c_remove(struct device *dev) | 89 | static int ixp2000_i2c_remove(struct platform_device *plat_dev) |
| 90 | { | 90 | { |
| 91 | struct platform_device *plat_dev = to_platform_device(dev); | 91 | struct ixp2000_i2c_data *drv_data = platform_get_drvdata(plat_dev); |
| 92 | struct ixp2000_i2c_data *drv_data = dev_get_drvdata(&plat_dev->dev); | ||
| 93 | 92 | ||
| 94 | dev_set_drvdata(&plat_dev->dev, NULL); | 93 | platform_set_drvdata(plat_dev, NULL); |
| 95 | 94 | ||
| 96 | i2c_bit_del_bus(&drv_data->adapter); | 95 | i2c_bit_del_bus(&drv_data->adapter); |
| 97 | 96 | ||
| @@ -100,10 +99,9 @@ static int ixp2000_i2c_remove(struct device *dev) | |||
| 100 | return 0; | 99 | return 0; |
| 101 | } | 100 | } |
| 102 | 101 | ||
| 103 | static int ixp2000_i2c_probe(struct device *dev) | 102 | static int ixp2000_i2c_probe(struct platform_device *plat_dev) |
| 104 | { | 103 | { |
| 105 | int err; | 104 | int err; |
| 106 | struct platform_device *plat_dev = to_platform_device(dev); | ||
| 107 | struct ixp2000_i2c_pins *gpio = plat_dev->dev.platform_data; | 105 | struct ixp2000_i2c_pins *gpio = plat_dev->dev.platform_data; |
| 108 | struct ixp2000_i2c_data *drv_data = | 106 | struct ixp2000_i2c_data *drv_data = |
| 109 | kzalloc(sizeof(struct ixp2000_i2c_data), GFP_KERNEL); | 107 | kzalloc(sizeof(struct ixp2000_i2c_data), GFP_KERNEL); |
| @@ -139,27 +137,28 @@ static int ixp2000_i2c_probe(struct device *dev) | |||
| 139 | return err; | 137 | return err; |
| 140 | } | 138 | } |
| 141 | 139 | ||
| 142 | dev_set_drvdata(&plat_dev->dev, drv_data); | 140 | platform_set_drvdata(plat_dev, drv_data); |
| 143 | 141 | ||
| 144 | return 0; | 142 | return 0; |
| 145 | } | 143 | } |
| 146 | 144 | ||
| 147 | static struct device_driver ixp2000_i2c_driver = { | 145 | static struct platform_driver ixp2000_i2c_driver = { |
| 148 | .owner = THIS_MODULE, | ||
| 149 | .name = "IXP2000-I2C", | ||
| 150 | .bus = &platform_bus_type, | ||
| 151 | .probe = ixp2000_i2c_probe, | 146 | .probe = ixp2000_i2c_probe, |
| 152 | .remove = ixp2000_i2c_remove, | 147 | .remove = ixp2000_i2c_remove, |
| 148 | .driver = { | ||
| 149 | .name = "IXP2000-I2C", | ||
| 150 | .owner = THIS_MODULE, | ||
| 151 | }, | ||
| 153 | }; | 152 | }; |
| 154 | 153 | ||
| 155 | static int __init ixp2000_i2c_init(void) | 154 | static int __init ixp2000_i2c_init(void) |
| 156 | { | 155 | { |
| 157 | return driver_register(&ixp2000_i2c_driver); | 156 | return platform_driver_register(&ixp2000_i2c_driver); |
| 158 | } | 157 | } |
| 159 | 158 | ||
| 160 | static void __exit ixp2000_i2c_exit(void) | 159 | static void __exit ixp2000_i2c_exit(void) |
| 161 | { | 160 | { |
| 162 | driver_unregister(&ixp2000_i2c_driver); | 161 | platform_driver_unregister(&ixp2000_i2c_driver); |
| 163 | } | 162 | } |
| 164 | 163 | ||
| 165 | module_init(ixp2000_i2c_init); | 164 | module_init(ixp2000_i2c_init); |
diff --git a/drivers/i2c/busses/i2c-ixp4xx.c b/drivers/i2c/busses/i2c-ixp4xx.c index cc652c350814..aa36855fa995 100644 --- a/drivers/i2c/busses/i2c-ixp4xx.c +++ b/drivers/i2c/busses/i2c-ixp4xx.c | |||
| @@ -87,12 +87,11 @@ struct ixp4xx_i2c_data { | |||
| 87 | struct i2c_algo_bit_data algo_data; | 87 | struct i2c_algo_bit_data algo_data; |
| 88 | }; | 88 | }; |
| 89 | 89 | ||
| 90 | static int ixp4xx_i2c_remove(struct device *dev) | 90 | static int ixp4xx_i2c_remove(struct platform_device *plat_dev) |
| 91 | { | 91 | { |
| 92 | struct platform_device *plat_dev = to_platform_device(dev); | 92 | struct ixp4xx_i2c_data *drv_data = platform_get_drvdata(plat_dev); |
| 93 | struct ixp4xx_i2c_data *drv_data = dev_get_drvdata(&plat_dev->dev); | ||
| 94 | 93 | ||
| 95 | dev_set_drvdata(&plat_dev->dev, NULL); | 94 | platform_set_drvdata(plat_dev, NULL); |
| 96 | 95 | ||
| 97 | i2c_bit_del_bus(&drv_data->adapter); | 96 | i2c_bit_del_bus(&drv_data->adapter); |
| 98 | 97 | ||
| @@ -101,10 +100,9 @@ static int ixp4xx_i2c_remove(struct device *dev) | |||
| 101 | return 0; | 100 | return 0; |
| 102 | } | 101 | } |
| 103 | 102 | ||
| 104 | static int ixp4xx_i2c_probe(struct device *dev) | 103 | static int ixp4xx_i2c_probe(struct platform_device *plat_dev) |
| 105 | { | 104 | { |
| 106 | int err; | 105 | int err; |
| 107 | struct platform_device *plat_dev = to_platform_device(dev); | ||
| 108 | struct ixp4xx_i2c_pins *gpio = plat_dev->dev.platform_data; | 106 | struct ixp4xx_i2c_pins *gpio = plat_dev->dev.platform_data; |
| 109 | struct ixp4xx_i2c_data *drv_data = | 107 | struct ixp4xx_i2c_data *drv_data = |
| 110 | kzalloc(sizeof(struct ixp4xx_i2c_data), GFP_KERNEL); | 108 | kzalloc(sizeof(struct ixp4xx_i2c_data), GFP_KERNEL); |
| @@ -148,27 +146,28 @@ static int ixp4xx_i2c_probe(struct device *dev) | |||
| 148 | return err; | 146 | return err; |
| 149 | } | 147 | } |
| 150 | 148 | ||
| 151 | dev_set_drvdata(&plat_dev->dev, drv_data); | 149 | platform_set_drvdata(plat_dev, drv_data); |
| 152 | 150 | ||
| 153 | return 0; | 151 | return 0; |
| 154 | } | 152 | } |
| 155 | 153 | ||
| 156 | static struct device_driver ixp4xx_i2c_driver = { | 154 | static struct platform_driver ixp4xx_i2c_driver = { |
| 157 | .owner = THIS_MODULE, | ||
| 158 | .name = "IXP4XX-I2C", | ||
| 159 | .bus = &platform_bus_type, | ||
| 160 | .probe = ixp4xx_i2c_probe, | 155 | .probe = ixp4xx_i2c_probe, |
| 161 | .remove = ixp4xx_i2c_remove, | 156 | .remove = ixp4xx_i2c_remove, |
| 157 | .driver = { | ||
| 158 | .name = "IXP4XX-I2C", | ||
| 159 | .owner = THIS_MODULE, | ||
| 160 | }, | ||
| 162 | }; | 161 | }; |
| 163 | 162 | ||
| 164 | static int __init ixp4xx_i2c_init(void) | 163 | static int __init ixp4xx_i2c_init(void) |
| 165 | { | 164 | { |
| 166 | return driver_register(&ixp4xx_i2c_driver); | 165 | return platform_driver_register(&ixp4xx_i2c_driver); |
| 167 | } | 166 | } |
| 168 | 167 | ||
| 169 | static void __exit ixp4xx_i2c_exit(void) | 168 | static void __exit ixp4xx_i2c_exit(void) |
| 170 | { | 169 | { |
| 171 | driver_unregister(&ixp4xx_i2c_driver); | 170 | platform_driver_unregister(&ixp4xx_i2c_driver); |
| 172 | } | 171 | } |
| 173 | 172 | ||
| 174 | module_init(ixp4xx_i2c_init); | 173 | module_init(ixp4xx_i2c_init); |
diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c index 65b939a059e9..5ccd338a9dc9 100644 --- a/drivers/i2c/busses/i2c-mpc.c +++ b/drivers/i2c/busses/i2c-mpc.c | |||
| @@ -288,11 +288,10 @@ static struct i2c_adapter mpc_ops = { | |||
| 288 | .retries = 1 | 288 | .retries = 1 |
| 289 | }; | 289 | }; |
| 290 | 290 | ||
| 291 | static int fsl_i2c_probe(struct device *device) | 291 | static int fsl_i2c_probe(struct platform_device *pdev) |
| 292 | { | 292 | { |
| 293 | int result = 0; | 293 | int result = 0; |
| 294 | struct mpc_i2c *i2c; | 294 | struct mpc_i2c *i2c; |
| 295 | struct platform_device *pdev = to_platform_device(device); | ||
| 296 | struct fsl_i2c_platform_data *pdata; | 295 | struct fsl_i2c_platform_data *pdata; |
| 297 | struct resource *r = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 296 | struct resource *r = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
| 298 | 297 | ||
| @@ -323,7 +322,7 @@ static int fsl_i2c_probe(struct device *device) | |||
| 323 | } | 322 | } |
| 324 | 323 | ||
| 325 | mpc_i2c_setclock(i2c); | 324 | mpc_i2c_setclock(i2c); |
| 326 | dev_set_drvdata(device, i2c); | 325 | platform_set_drvdata(pdev, i2c); |
| 327 | 326 | ||
| 328 | i2c->adap = mpc_ops; | 327 | i2c->adap = mpc_ops; |
| 329 | i2c_set_adapdata(&i2c->adap, i2c); | 328 | i2c_set_adapdata(&i2c->adap, i2c); |
| @@ -345,12 +344,12 @@ static int fsl_i2c_probe(struct device *device) | |||
| 345 | return result; | 344 | return result; |
| 346 | }; | 345 | }; |
| 347 | 346 | ||
| 348 | static int fsl_i2c_remove(struct device *device) | 347 | static int fsl_i2c_remove(struct platform_device *pdev) |
| 349 | { | 348 | { |
| 350 | struct mpc_i2c *i2c = dev_get_drvdata(device); | 349 | struct mpc_i2c *i2c = platform_get_drvdata(pdev); |
| 351 | 350 | ||
| 352 | i2c_del_adapter(&i2c->adap); | 351 | i2c_del_adapter(&i2c->adap); |
| 353 | dev_set_drvdata(device, NULL); | 352 | platform_set_drvdata(pdev, NULL); |
| 354 | 353 | ||
| 355 | if (i2c->irq != 0) | 354 | if (i2c->irq != 0) |
| 356 | free_irq(i2c->irq, i2c); | 355 | free_irq(i2c->irq, i2c); |
| @@ -361,22 +360,23 @@ static int fsl_i2c_remove(struct device *device) | |||
| 361 | }; | 360 | }; |
| 362 | 361 | ||
| 363 | /* Structure for a device driver */ | 362 | /* Structure for a device driver */ |
| 364 | static struct device_driver fsl_i2c_driver = { | 363 | static struct platform_driver fsl_i2c_driver = { |
| 365 | .owner = THIS_MODULE, | ||
| 366 | .name = "fsl-i2c", | ||
| 367 | .bus = &platform_bus_type, | ||
| 368 | .probe = fsl_i2c_probe, | 364 | .probe = fsl_i2c_probe, |
| 369 | .remove = fsl_i2c_remove, | 365 | .remove = fsl_i2c_remove, |
| 366 | .driver = { | ||
| 367 | .owner = THIS_MODULE, | ||
| 368 | .name = "fsl-i2c", | ||
| 369 | }, | ||
| 370 | }; | 370 | }; |
| 371 | 371 | ||
| 372 | static int __init fsl_i2c_init(void) | 372 | static int __init fsl_i2c_init(void) |
| 373 | { | 373 | { |
| 374 | return driver_register(&fsl_i2c_driver); | 374 | return platform_driver_register(&fsl_i2c_driver); |
| 375 | } | 375 | } |
| 376 | 376 | ||
| 377 | static void __exit fsl_i2c_exit(void) | 377 | static void __exit fsl_i2c_exit(void) |
| 378 | { | 378 | { |
| 379 | driver_unregister(&fsl_i2c_driver); | 379 | platform_driver_unregister(&fsl_i2c_driver); |
| 380 | } | 380 | } |
| 381 | 381 | ||
| 382 | module_init(fsl_i2c_init); | 382 | module_init(fsl_i2c_init); |
diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c index 6b48027b2ee3..afd7634e5cc9 100644 --- a/drivers/i2c/busses/i2c-mv64xxx.c +++ b/drivers/i2c/busses/i2c-mv64xxx.c | |||
| @@ -492,11 +492,10 @@ mv64xxx_i2c_unmap_regs(struct mv64xxx_i2c_data *drv_data) | |||
| 492 | } | 492 | } |
| 493 | 493 | ||
| 494 | static int __devinit | 494 | static int __devinit |
| 495 | mv64xxx_i2c_probe(struct device *dev) | 495 | mv64xxx_i2c_probe(struct platform_device *pd) |
| 496 | { | 496 | { |
| 497 | struct platform_device *pd = to_platform_device(dev); | ||
| 498 | struct mv64xxx_i2c_data *drv_data; | 497 | struct mv64xxx_i2c_data *drv_data; |
| 499 | struct mv64xxx_i2c_pdata *pdata = dev->platform_data; | 498 | struct mv64xxx_i2c_pdata *pdata = pd->dev.platform_data; |
| 500 | int rc; | 499 | int rc; |
| 501 | 500 | ||
| 502 | if ((pd->id != 0) || !pdata) | 501 | if ((pd->id != 0) || !pdata) |
| @@ -526,7 +525,7 @@ mv64xxx_i2c_probe(struct device *dev) | |||
| 526 | drv_data->adapter.class = I2C_CLASS_HWMON; | 525 | drv_data->adapter.class = I2C_CLASS_HWMON; |
| 527 | drv_data->adapter.timeout = pdata->timeout; | 526 | drv_data->adapter.timeout = pdata->timeout; |
| 528 | drv_data->adapter.retries = pdata->retries; | 527 | drv_data->adapter.retries = pdata->retries; |
| 529 | dev_set_drvdata(dev, drv_data); | 528 | platform_set_drvdata(pd, drv_data); |
| 530 | i2c_set_adapdata(&drv_data->adapter, drv_data); | 529 | i2c_set_adapdata(&drv_data->adapter, drv_data); |
| 531 | 530 | ||
| 532 | if (request_irq(drv_data->irq, mv64xxx_i2c_intr, 0, | 531 | if (request_irq(drv_data->irq, mv64xxx_i2c_intr, 0, |
| @@ -555,9 +554,9 @@ mv64xxx_i2c_probe(struct device *dev) | |||
| 555 | } | 554 | } |
| 556 | 555 | ||
| 557 | static int __devexit | 556 | static int __devexit |
| 558 | mv64xxx_i2c_remove(struct device *dev) | 557 | mv64xxx_i2c_remove(struct platform_device *dev) |
| 559 | { | 558 | { |
| 560 | struct mv64xxx_i2c_data *drv_data = dev_get_drvdata(dev); | 559 | struct mv64xxx_i2c_data *drv_data = platform_get_drvdata(dev); |
| 561 | int rc; | 560 | int rc; |
| 562 | 561 | ||
| 563 | rc = i2c_del_adapter(&drv_data->adapter); | 562 | rc = i2c_del_adapter(&drv_data->adapter); |
| @@ -568,24 +567,25 @@ mv64xxx_i2c_remove(struct device *dev) | |||
| 568 | return rc; | 567 | return rc; |
| 569 | } | 568 | } |
| 570 | 569 | ||
| 571 | static struct device_driver mv64xxx_i2c_driver = { | 570 | static struct platform_driver mv64xxx_i2c_driver = { |
| 572 | .owner = THIS_MODULE, | ||
| 573 | .name = MV64XXX_I2C_CTLR_NAME, | ||
| 574 | .bus = &platform_bus_type, | ||
| 575 | .probe = mv64xxx_i2c_probe, | 571 | .probe = mv64xxx_i2c_probe, |
| 576 | .remove = mv64xxx_i2c_remove, | 572 | .remove = mv64xxx_i2c_remove, |
| 573 | .driver = { | ||
| 574 | .owner = THIS_MODULE, | ||
| 575 | .name = MV64XXX_I2C_CTLR_NAME, | ||
| 576 | }, | ||
| 577 | }; | 577 | }; |
| 578 | 578 | ||
| 579 | static int __init | 579 | static int __init |
| 580 | mv64xxx_i2c_init(void) | 580 | mv64xxx_i2c_init(void) |
| 581 | { | 581 | { |
| 582 | return driver_register(&mv64xxx_i2c_driver); | 582 | return platform_driver_register(&mv64xxx_i2c_driver); |
| 583 | } | 583 | } |
| 584 | 584 | ||
| 585 | static void __exit | 585 | static void __exit |
| 586 | mv64xxx_i2c_exit(void) | 586 | mv64xxx_i2c_exit(void) |
| 587 | { | 587 | { |
| 588 | driver_unregister(&mv64xxx_i2c_driver); | 588 | platform_driver_unregister(&mv64xxx_i2c_driver); |
| 589 | } | 589 | } |
| 590 | 590 | ||
| 591 | module_init(mv64xxx_i2c_init); | 591 | module_init(mv64xxx_i2c_init); |
diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c index 67ccbea24ba4..70f7ab829d36 100644 --- a/drivers/i2c/busses/i2c-pxa.c +++ b/drivers/i2c/busses/i2c-pxa.c | |||
| @@ -936,10 +936,10 @@ static struct pxa_i2c i2c_pxa = { | |||
| 936 | }, | 936 | }, |
| 937 | }; | 937 | }; |
| 938 | 938 | ||
| 939 | static int i2c_pxa_probe(struct device *dev) | 939 | static int i2c_pxa_probe(struct platform_device *dev) |
| 940 | { | 940 | { |
| 941 | struct pxa_i2c *i2c = &i2c_pxa; | 941 | struct pxa_i2c *i2c = &i2c_pxa; |
| 942 | struct i2c_pxa_platform_data *plat = dev->platform_data; | 942 | struct i2c_pxa_platform_data *plat = dev->dev.platform_data; |
| 943 | int ret; | 943 | int ret; |
| 944 | 944 | ||
| 945 | #ifdef CONFIG_PXA27x | 945 | #ifdef CONFIG_PXA27x |
| @@ -968,7 +968,7 @@ static int i2c_pxa_probe(struct device *dev) | |||
| 968 | i2c_pxa_reset(i2c); | 968 | i2c_pxa_reset(i2c); |
| 969 | 969 | ||
| 970 | i2c->adap.algo_data = i2c; | 970 | i2c->adap.algo_data = i2c; |
| 971 | i2c->adap.dev.parent = dev; | 971 | i2c->adap.dev.parent = &dev->dev; |
| 972 | 972 | ||
| 973 | ret = i2c_add_adapter(&i2c->adap); | 973 | ret = i2c_add_adapter(&i2c->adap); |
| 974 | if (ret < 0) { | 974 | if (ret < 0) { |
| @@ -976,7 +976,7 @@ static int i2c_pxa_probe(struct device *dev) | |||
| 976 | goto err_irq; | 976 | goto err_irq; |
| 977 | } | 977 | } |
| 978 | 978 | ||
| 979 | dev_set_drvdata(dev, i2c); | 979 | platform_set_drvdata(dev, i2c); |
| 980 | 980 | ||
| 981 | #ifdef CONFIG_I2C_PXA_SLAVE | 981 | #ifdef CONFIG_I2C_PXA_SLAVE |
| 982 | printk(KERN_INFO "I2C: %s: PXA I2C adapter, slave address %d\n", | 982 | printk(KERN_INFO "I2C: %s: PXA I2C adapter, slave address %d\n", |
| @@ -993,11 +993,11 @@ static int i2c_pxa_probe(struct device *dev) | |||
| 993 | return ret; | 993 | return ret; |
| 994 | } | 994 | } |
| 995 | 995 | ||
| 996 | static int i2c_pxa_remove(struct device *dev) | 996 | static int i2c_pxa_remove(struct platform_device *dev) |
| 997 | { | 997 | { |
| 998 | struct pxa_i2c *i2c = dev_get_drvdata(dev); | 998 | struct pxa_i2c *i2c = platform_get_drvdata(dev); |
| 999 | 999 | ||
| 1000 | dev_set_drvdata(dev, NULL); | 1000 | platform_set_drvdata(dev, NULL); |
| 1001 | 1001 | ||
| 1002 | i2c_del_adapter(&i2c->adap); | 1002 | i2c_del_adapter(&i2c->adap); |
| 1003 | free_irq(IRQ_I2C, i2c); | 1003 | free_irq(IRQ_I2C, i2c); |
| @@ -1006,21 +1006,22 @@ static int i2c_pxa_remove(struct device *dev) | |||
| 1006 | return 0; | 1006 | return 0; |
| 1007 | } | 1007 | } |
| 1008 | 1008 | ||
| 1009 | static struct device_driver i2c_pxa_driver = { | 1009 | static struct platform_driver i2c_pxa_driver = { |
| 1010 | .name = "pxa2xx-i2c", | ||
| 1011 | .bus = &platform_bus_type, | ||
| 1012 | .probe = i2c_pxa_probe, | 1010 | .probe = i2c_pxa_probe, |
| 1013 | .remove = i2c_pxa_remove, | 1011 | .remove = i2c_pxa_remove, |
| 1012 | .driver = { | ||
| 1013 | .name = "pxa2xx-i2c", | ||
| 1014 | }, | ||
| 1014 | }; | 1015 | }; |
| 1015 | 1016 | ||
| 1016 | static int __init i2c_adap_pxa_init(void) | 1017 | static int __init i2c_adap_pxa_init(void) |
| 1017 | { | 1018 | { |
| 1018 | return driver_register(&i2c_pxa_driver); | 1019 | return platform_driver_register(&i2c_pxa_driver); |
| 1019 | } | 1020 | } |
| 1020 | 1021 | ||
| 1021 | static void i2c_adap_pxa_exit(void) | 1022 | static void i2c_adap_pxa_exit(void) |
| 1022 | { | 1023 | { |
| 1023 | return driver_unregister(&i2c_pxa_driver); | 1024 | return platform_driver_unregister(&i2c_pxa_driver); |
| 1024 | } | 1025 | } |
| 1025 | 1026 | ||
| 1026 | module_init(i2c_adap_pxa_init); | 1027 | module_init(i2c_adap_pxa_init); |
diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c index 1b582262e677..58cfd3111ef6 100644 --- a/drivers/i2c/busses/i2c-s3c2410.c +++ b/drivers/i2c/busses/i2c-s3c2410.c | |||
| @@ -760,24 +760,23 @@ static void s3c24xx_i2c_free(struct s3c24xx_i2c *i2c) | |||
| 760 | * called by the bus driver when a suitable device is found | 760 | * called by the bus driver when a suitable device is found |
| 761 | */ | 761 | */ |
| 762 | 762 | ||
| 763 | static int s3c24xx_i2c_probe(struct device *dev) | 763 | static int s3c24xx_i2c_probe(struct platform_device *pdev) |
| 764 | { | 764 | { |
| 765 | struct platform_device *pdev = to_platform_device(dev); | ||
| 766 | struct s3c24xx_i2c *i2c = &s3c24xx_i2c; | 765 | struct s3c24xx_i2c *i2c = &s3c24xx_i2c; |
| 767 | struct resource *res; | 766 | struct resource *res; |
| 768 | int ret; | 767 | int ret; |
| 769 | 768 | ||
| 770 | /* find the clock and enable it */ | 769 | /* find the clock and enable it */ |
| 771 | 770 | ||
| 772 | i2c->dev = dev; | 771 | i2c->dev = &pdev->dev; |
| 773 | i2c->clk = clk_get(dev, "i2c"); | 772 | i2c->clk = clk_get(&pdev->dev, "i2c"); |
| 774 | if (IS_ERR(i2c->clk)) { | 773 | if (IS_ERR(i2c->clk)) { |
| 775 | dev_err(dev, "cannot get clock\n"); | 774 | dev_err(&pdev->dev, "cannot get clock\n"); |
| 776 | ret = -ENOENT; | 775 | ret = -ENOENT; |
| 777 | goto out; | 776 | goto out; |
| 778 | } | 777 | } |
| 779 | 778 | ||
| 780 | dev_dbg(dev, "clock source %p\n", i2c->clk); | 779 | dev_dbg(&pdev->dev, "clock source %p\n", i2c->clk); |
| 781 | 780 | ||
| 782 | clk_use(i2c->clk); | 781 | clk_use(i2c->clk); |
| 783 | clk_enable(i2c->clk); | 782 | clk_enable(i2c->clk); |
| @@ -786,7 +785,7 @@ static int s3c24xx_i2c_probe(struct device *dev) | |||
| 786 | 785 | ||
| 787 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 786 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
| 788 | if (res == NULL) { | 787 | if (res == NULL) { |
| 789 | dev_err(dev, "cannot find IO resource\n"); | 788 | dev_err(&pdev->dev, "cannot find IO resource\n"); |
| 790 | ret = -ENOENT; | 789 | ret = -ENOENT; |
| 791 | goto out; | 790 | goto out; |
| 792 | } | 791 | } |
| @@ -795,7 +794,7 @@ static int s3c24xx_i2c_probe(struct device *dev) | |||
| 795 | pdev->name); | 794 | pdev->name); |
| 796 | 795 | ||
| 797 | if (i2c->ioarea == NULL) { | 796 | if (i2c->ioarea == NULL) { |
| 798 | dev_err(dev, "cannot request IO\n"); | 797 | dev_err(&pdev->dev, "cannot request IO\n"); |
| 799 | ret = -ENXIO; | 798 | ret = -ENXIO; |
| 800 | goto out; | 799 | goto out; |
| 801 | } | 800 | } |
| @@ -803,17 +802,17 @@ static int s3c24xx_i2c_probe(struct device *dev) | |||
| 803 | i2c->regs = ioremap(res->start, (res->end-res->start)+1); | 802 | i2c->regs = ioremap(res->start, (res->end-res->start)+1); |
| 804 | 803 | ||
| 805 | if (i2c->regs == NULL) { | 804 | if (i2c->regs == NULL) { |
| 806 | dev_err(dev, "cannot map IO\n"); | 805 | dev_err(&pdev->dev, "cannot map IO\n"); |
| 807 | ret = -ENXIO; | 806 | ret = -ENXIO; |
| 808 | goto out; | 807 | goto out; |
| 809 | } | 808 | } |
| 810 | 809 | ||
| 811 | dev_dbg(dev, "registers %p (%p, %p)\n", i2c->regs, i2c->ioarea, res); | 810 | dev_dbg(&pdev->dev, "registers %p (%p, %p)\n", i2c->regs, i2c->ioarea, res); |
| 812 | 811 | ||
| 813 | /* setup info block for the i2c core */ | 812 | /* setup info block for the i2c core */ |
| 814 | 813 | ||
| 815 | i2c->adap.algo_data = i2c; | 814 | i2c->adap.algo_data = i2c; |
| 816 | i2c->adap.dev.parent = dev; | 815 | i2c->adap.dev.parent = &pdev->dev; |
| 817 | 816 | ||
| 818 | /* initialise the i2c controller */ | 817 | /* initialise the i2c controller */ |
| 819 | 818 | ||
| @@ -827,7 +826,7 @@ static int s3c24xx_i2c_probe(struct device *dev) | |||
| 827 | 826 | ||
| 828 | res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); | 827 | res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); |
| 829 | if (res == NULL) { | 828 | if (res == NULL) { |
| 830 | dev_err(dev, "cannot find IRQ\n"); | 829 | dev_err(&pdev->dev, "cannot find IRQ\n"); |
| 831 | ret = -ENOENT; | 830 | ret = -ENOENT; |
| 832 | goto out; | 831 | goto out; |
| 833 | } | 832 | } |
| @@ -836,23 +835,23 @@ static int s3c24xx_i2c_probe(struct device *dev) | |||
| 836 | pdev->name, i2c); | 835 | pdev->name, i2c); |
| 837 | 836 | ||
| 838 | if (ret != 0) { | 837 | if (ret != 0) { |
| 839 | dev_err(dev, "cannot claim IRQ\n"); | 838 | dev_err(&pdev->dev, "cannot claim IRQ\n"); |
| 840 | goto out; | 839 | goto out; |
| 841 | } | 840 | } |
| 842 | 841 | ||
| 843 | i2c->irq = res; | 842 | i2c->irq = res; |
| 844 | 843 | ||
| 845 | dev_dbg(dev, "irq resource %p (%ld)\n", res, res->start); | 844 | dev_dbg(&pdev->dev, "irq resource %p (%ld)\n", res, res->start); |
| 846 | 845 | ||
| 847 | ret = i2c_add_adapter(&i2c->adap); | 846 | ret = i2c_add_adapter(&i2c->adap); |
| 848 | if (ret < 0) { | 847 | if (ret < 0) { |
| 849 | dev_err(dev, "failed to add bus to i2c core\n"); | 848 | dev_err(&pdev->dev, "failed to add bus to i2c core\n"); |
| 850 | goto out; | 849 | goto out; |
| 851 | } | 850 | } |
| 852 | 851 | ||
| 853 | dev_set_drvdata(dev, i2c); | 852 | platform_set_drvdata(pdev, i2c); |
| 854 | 853 | ||
| 855 | dev_info(dev, "%s: S3C I2C adapter\n", i2c->adap.dev.bus_id); | 854 | dev_info(&pdev->dev, "%s: S3C I2C adapter\n", i2c->adap.dev.bus_id); |
| 856 | 855 | ||
| 857 | out: | 856 | out: |
| 858 | if (ret < 0) | 857 | if (ret < 0) |
| @@ -866,22 +865,22 @@ static int s3c24xx_i2c_probe(struct device *dev) | |||
| 866 | * called when device is removed from the bus | 865 | * called when device is removed from the bus |
| 867 | */ | 866 | */ |
| 868 | 867 | ||
| 869 | static int s3c24xx_i2c_remove(struct device *dev) | 868 | static int s3c24xx_i2c_remove(struct platform_device *pdev) |
| 870 | { | 869 | { |
| 871 | struct s3c24xx_i2c *i2c = dev_get_drvdata(dev); | 870 | struct s3c24xx_i2c *i2c = platform_get_drvdata(pdev); |
| 872 | 871 | ||
| 873 | if (i2c != NULL) { | 872 | if (i2c != NULL) { |
| 874 | s3c24xx_i2c_free(i2c); | 873 | s3c24xx_i2c_free(i2c); |
| 875 | dev_set_drvdata(dev, NULL); | 874 | platform_set_drvdata(pdev, NULL); |
| 876 | } | 875 | } |
| 877 | 876 | ||
| 878 | return 0; | 877 | return 0; |
| 879 | } | 878 | } |
| 880 | 879 | ||
| 881 | #ifdef CONFIG_PM | 880 | #ifdef CONFIG_PM |
| 882 | static int s3c24xx_i2c_resume(struct device *dev) | 881 | static int s3c24xx_i2c_resume(struct platform_device *dev) |
| 883 | { | 882 | { |
| 884 | struct s3c24xx_i2c *i2c = dev_get_drvdata(dev); | 883 | struct s3c24xx_i2c *i2c = platform_get_drvdata(dev); |
| 885 | 884 | ||
| 886 | if (i2c != NULL) | 885 | if (i2c != NULL) |
| 887 | s3c24xx_i2c_init(i2c); | 886 | s3c24xx_i2c_init(i2c); |
| @@ -895,33 +894,35 @@ static int s3c24xx_i2c_resume(struct device *dev) | |||
| 895 | 894 | ||
| 896 | /* device driver for platform bus bits */ | 895 | /* device driver for platform bus bits */ |
| 897 | 896 | ||
| 898 | static struct device_driver s3c2410_i2c_driver = { | 897 | static struct platform_driver s3c2410_i2c_driver = { |
| 899 | .owner = THIS_MODULE, | ||
| 900 | .name = "s3c2410-i2c", | ||
| 901 | .bus = &platform_bus_type, | ||
| 902 | .probe = s3c24xx_i2c_probe, | 898 | .probe = s3c24xx_i2c_probe, |
| 903 | .remove = s3c24xx_i2c_remove, | 899 | .remove = s3c24xx_i2c_remove, |
| 904 | .resume = s3c24xx_i2c_resume, | 900 | .resume = s3c24xx_i2c_resume, |
| 901 | .driver = { | ||
| 902 | .owner = THIS_MODULE, | ||
| 903 | .name = "s3c2410-i2c", | ||
| 904 | }, | ||
| 905 | }; | 905 | }; |
| 906 | 906 | ||
| 907 | static struct device_driver s3c2440_i2c_driver = { | 907 | static struct platform_driver s3c2440_i2c_driver = { |
| 908 | .owner = THIS_MODULE, | ||
| 909 | .name = "s3c2440-i2c", | ||
| 910 | .bus = &platform_bus_type, | ||
| 911 | .probe = s3c24xx_i2c_probe, | 908 | .probe = s3c24xx_i2c_probe, |
| 912 | .remove = s3c24xx_i2c_remove, | 909 | .remove = s3c24xx_i2c_remove, |
| 913 | .resume = s3c24xx_i2c_resume, | 910 | .resume = s3c24xx_i2c_resume, |
| 911 | .driver = { | ||
| 912 | .owner = THIS_MODULE, | ||
| 913 | .name = "s3c2440-i2c", | ||
| 914 | }, | ||
| 914 | }; | 915 | }; |
| 915 | 916 | ||
| 916 | static int __init i2c_adap_s3c_init(void) | 917 | static int __init i2c_adap_s3c_init(void) |
| 917 | { | 918 | { |
| 918 | int ret; | 919 | int ret; |
| 919 | 920 | ||
| 920 | ret = driver_register(&s3c2410_i2c_driver); | 921 | ret = platform_driver_register(&s3c2410_i2c_driver); |
| 921 | if (ret == 0) { | 922 | if (ret == 0) { |
| 922 | ret = driver_register(&s3c2440_i2c_driver); | 923 | ret = platform_driver_register(&s3c2440_i2c_driver); |
| 923 | if (ret) | 924 | if (ret) |
| 924 | driver_unregister(&s3c2410_i2c_driver); | 925 | platform_driver_unregister(&s3c2410_i2c_driver); |
| 925 | } | 926 | } |
| 926 | 927 | ||
| 927 | return ret; | 928 | return ret; |
| @@ -929,8 +930,8 @@ static int __init i2c_adap_s3c_init(void) | |||
| 929 | 930 | ||
| 930 | static void __exit i2c_adap_s3c_exit(void) | 931 | static void __exit i2c_adap_s3c_exit(void) |
| 931 | { | 932 | { |
| 932 | driver_unregister(&s3c2410_i2c_driver); | 933 | platform_driver_unregister(&s3c2410_i2c_driver); |
| 933 | driver_unregister(&s3c2440_i2c_driver); | 934 | platform_driver_unregister(&s3c2440_i2c_driver); |
| 934 | } | 935 | } |
| 935 | 936 | ||
| 936 | module_init(i2c_adap_s3c_init); | 937 | module_init(i2c_adap_s3c_init); |
diff --git a/drivers/i2c/chips/isp1301_omap.c b/drivers/i2c/chips/isp1301_omap.c index 9dbb72fffbe2..d2a100d77839 100644 --- a/drivers/i2c/chips/isp1301_omap.c +++ b/drivers/i2c/chips/isp1301_omap.c | |||
| @@ -873,26 +873,27 @@ static int otg_init(struct isp1301 *isp) | |||
| 873 | return 0; | 873 | return 0; |
| 874 | } | 874 | } |
| 875 | 875 | ||
| 876 | static int otg_probe(struct device *dev) | 876 | static int otg_probe(struct platform_device *dev) |
| 877 | { | 877 | { |
| 878 | // struct omap_usb_config *config = dev->platform_data; | 878 | // struct omap_usb_config *config = dev->platform_data; |
| 879 | 879 | ||
| 880 | otg_dev = to_platform_device(dev); | 880 | otg_dev = dev; |
| 881 | return 0; | 881 | return 0; |
| 882 | } | 882 | } |
| 883 | 883 | ||
| 884 | static int otg_remove(struct device *dev) | 884 | static int otg_remove(struct platform_device *dev) |
| 885 | { | 885 | { |
| 886 | otg_dev = 0; | 886 | otg_dev = 0; |
| 887 | return 0; | 887 | return 0; |
| 888 | } | 888 | } |
| 889 | 889 | ||
| 890 | struct device_driver omap_otg_driver = { | 890 | struct platform_driver omap_otg_driver = { |
| 891 | .owner = THIS_MODULE, | ||
| 892 | .name = "omap_otg", | ||
| 893 | .bus = &platform_bus_type, | ||
| 894 | .probe = otg_probe, | 891 | .probe = otg_probe, |
| 895 | .remove = otg_remove, | 892 | .remove = otg_remove, |
| 893 | .driver = { | ||
| 894 | .owner = THIS_MODULE, | ||
| 895 | .name = "omap_otg", | ||
| 896 | }, | ||
| 896 | }; | 897 | }; |
| 897 | 898 | ||
| 898 | static int otg_bind(struct isp1301 *isp) | 899 | static int otg_bind(struct isp1301 *isp) |
| @@ -902,7 +903,7 @@ static int otg_bind(struct isp1301 *isp) | |||
| 902 | if (otg_dev) | 903 | if (otg_dev) |
| 903 | return -EBUSY; | 904 | return -EBUSY; |
| 904 | 905 | ||
| 905 | status = driver_register(&omap_otg_driver); | 906 | status = platform_driver_register(&omap_otg_driver); |
| 906 | if (status < 0) | 907 | if (status < 0) |
| 907 | return status; | 908 | return status; |
| 908 | 909 | ||
| @@ -913,7 +914,7 @@ static int otg_bind(struct isp1301 *isp) | |||
| 913 | status = -ENODEV; | 914 | status = -ENODEV; |
| 914 | 915 | ||
| 915 | if (status < 0) | 916 | if (status < 0) |
| 916 | driver_unregister(&omap_otg_driver); | 917 | platform_driver_unregister(&omap_otg_driver); |
| 917 | return status; | 918 | return status; |
| 918 | } | 919 | } |
| 919 | 920 | ||
diff --git a/drivers/input/keyboard/corgikbd.c b/drivers/input/keyboard/corgikbd.c index d00d14bb637a..64672d491222 100644 --- a/drivers/input/keyboard/corgikbd.c +++ b/drivers/input/keyboard/corgikbd.c | |||
| @@ -259,17 +259,17 @@ static void corgikbd_hinge_timer(unsigned long data) | |||
| 259 | } | 259 | } |
| 260 | 260 | ||
| 261 | #ifdef CONFIG_PM | 261 | #ifdef CONFIG_PM |
| 262 | static int corgikbd_suspend(struct device *dev, pm_message_t state) | 262 | static int corgikbd_suspend(struct platform_device *dev, pm_message_t state) |
| 263 | { | 263 | { |
| 264 | struct corgikbd *corgikbd = dev_get_drvdata(dev); | 264 | struct corgikbd *corgikbd = platform_get_drvdata(dev); |
| 265 | corgikbd->suspended = 1; | 265 | corgikbd->suspended = 1; |
| 266 | 266 | ||
| 267 | return 0; | 267 | return 0; |
| 268 | } | 268 | } |
| 269 | 269 | ||
| 270 | static int corgikbd_resume(struct device *dev) | 270 | static int corgikbd_resume(struct platform_device *dev) |
| 271 | { | 271 | { |
| 272 | struct corgikbd *corgikbd = dev_get_drvdata(dev); | 272 | struct corgikbd *corgikbd = platform_get_drvdata(dev); |
| 273 | 273 | ||
| 274 | /* Upon resume, ignore the suspend key for a short while */ | 274 | /* Upon resume, ignore the suspend key for a short while */ |
| 275 | corgikbd->suspend_jiffies=jiffies; | 275 | corgikbd->suspend_jiffies=jiffies; |
| @@ -282,7 +282,7 @@ static int corgikbd_resume(struct device *dev) | |||
| 282 | #define corgikbd_resume NULL | 282 | #define corgikbd_resume NULL |
| 283 | #endif | 283 | #endif |
| 284 | 284 | ||
| 285 | static int __init corgikbd_probe(struct device *dev) | 285 | static int __init corgikbd_probe(struct platform_device *pdev) |
| 286 | { | 286 | { |
| 287 | struct corgikbd *corgikbd; | 287 | struct corgikbd *corgikbd; |
| 288 | struct input_dev *input_dev; | 288 | struct input_dev *input_dev; |
| @@ -296,7 +296,7 @@ static int __init corgikbd_probe(struct device *dev) | |||
| 296 | return -ENOMEM; | 296 | return -ENOMEM; |
| 297 | } | 297 | } |
| 298 | 298 | ||
| 299 | dev_set_drvdata(dev, corgikbd); | 299 | platform_set_drvdata(pdev, corgikbd); |
| 300 | 300 | ||
| 301 | corgikbd->input = input_dev; | 301 | corgikbd->input = input_dev; |
| 302 | spin_lock_init(&corgikbd->lock); | 302 | spin_lock_init(&corgikbd->lock); |
| @@ -321,7 +321,7 @@ static int __init corgikbd_probe(struct device *dev) | |||
| 321 | input_dev->id.vendor = 0x0001; | 321 | input_dev->id.vendor = 0x0001; |
| 322 | input_dev->id.product = 0x0001; | 322 | input_dev->id.product = 0x0001; |
| 323 | input_dev->id.version = 0x0100; | 323 | input_dev->id.version = 0x0100; |
| 324 | input_dev->cdev.dev = dev; | 324 | input_dev->cdev.dev = &pdev->dev; |
| 325 | input_dev->private = corgikbd; | 325 | input_dev->private = corgikbd; |
| 326 | 326 | ||
| 327 | input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP) | BIT(EV_PWR) | BIT(EV_SW); | 327 | input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP) | BIT(EV_PWR) | BIT(EV_SW); |
| @@ -356,10 +356,10 @@ static int __init corgikbd_probe(struct device *dev) | |||
| 356 | return 0; | 356 | return 0; |
| 357 | } | 357 | } |
| 358 | 358 | ||
| 359 | static int corgikbd_remove(struct device *dev) | 359 | static int corgikbd_remove(struct platform_device *pdev) |
| 360 | { | 360 | { |
| 361 | int i; | 361 | int i; |
| 362 | struct corgikbd *corgikbd = dev_get_drvdata(dev); | 362 | struct corgikbd *corgikbd = platform_get_drvdata(pdev); |
| 363 | 363 | ||
| 364 | for (i = 0; i < CORGI_KEY_SENSE_NUM; i++) | 364 | for (i = 0; i < CORGI_KEY_SENSE_NUM; i++) |
| 365 | free_irq(CORGI_IRQ_GPIO_KEY_SENSE(i), corgikbd); | 365 | free_irq(CORGI_IRQ_GPIO_KEY_SENSE(i), corgikbd); |
| @@ -374,23 +374,24 @@ static int corgikbd_remove(struct device *dev) | |||
| 374 | return 0; | 374 | return 0; |
| 375 | } | 375 | } |
| 376 | 376 | ||
| 377 | static struct device_driver corgikbd_driver = { | 377 | static struct platform_driver corgikbd_driver = { |
| 378 | .name = "corgi-keyboard", | ||
| 379 | .bus = &platform_bus_type, | ||
| 380 | .probe = corgikbd_probe, | 378 | .probe = corgikbd_probe, |
| 381 | .remove = corgikbd_remove, | 379 | .remove = corgikbd_remove, |
| 382 | .suspend = corgikbd_suspend, | 380 | .suspend = corgikbd_suspend, |
| 383 | .resume = corgikbd_resume, | 381 | .resume = corgikbd_resume, |
| 382 | .driver = { | ||
| 383 | .name = "corgi-keyboard", | ||
| 384 | }, | ||
| 384 | }; | 385 | }; |
| 385 | 386 | ||
| 386 | static int __devinit corgikbd_init(void) | 387 | static int __devinit corgikbd_init(void) |
| 387 | { | 388 | { |
| 388 | return driver_register(&corgikbd_driver); | 389 | return platform_driver_register(&corgikbd_driver); |
| 389 | } | 390 | } |
| 390 | 391 | ||
| 391 | static void __exit corgikbd_exit(void) | 392 | static void __exit corgikbd_exit(void) |
| 392 | { | 393 | { |
| 393 | driver_unregister(&corgikbd_driver); | 394 | platform_driver_unregister(&corgikbd_driver); |
| 394 | } | 395 | } |
| 395 | 396 | ||
| 396 | module_init(corgikbd_init); | 397 | module_init(corgikbd_init); |
diff --git a/drivers/input/keyboard/spitzkbd.c b/drivers/input/keyboard/spitzkbd.c index 0fa38a559cdf..6a15fe3bc527 100644 --- a/drivers/input/keyboard/spitzkbd.c +++ b/drivers/input/keyboard/spitzkbd.c | |||
| @@ -309,10 +309,10 @@ static void spitzkbd_hinge_timer(unsigned long data) | |||
| 309 | } | 309 | } |
| 310 | 310 | ||
| 311 | #ifdef CONFIG_PM | 311 | #ifdef CONFIG_PM |
| 312 | static int spitzkbd_suspend(struct device *dev, pm_message_t state) | 312 | static int spitzkbd_suspend(struct platform_device *dev, pm_message_t state) |
| 313 | { | 313 | { |
| 314 | int i; | 314 | int i; |
| 315 | struct spitzkbd *spitzkbd = dev_get_drvdata(dev); | 315 | struct spitzkbd *spitzkbd = platform_get_drvdata(dev); |
| 316 | spitzkbd->suspended = 1; | 316 | spitzkbd->suspended = 1; |
| 317 | 317 | ||
| 318 | /* Set Strobe lines as inputs - *except* strobe line 0 leave this | 318 | /* Set Strobe lines as inputs - *except* strobe line 0 leave this |
| @@ -323,10 +323,10 @@ static int spitzkbd_suspend(struct device *dev, pm_message_t state) | |||
| 323 | return 0; | 323 | return 0; |
| 324 | } | 324 | } |
| 325 | 325 | ||
| 326 | static int spitzkbd_resume(struct device *dev) | 326 | static int spitzkbd_resume(struct platform_device *dev) |
| 327 | { | 327 | { |
| 328 | int i; | 328 | int i; |
| 329 | struct spitzkbd *spitzkbd = dev_get_drvdata(dev); | 329 | struct spitzkbd *spitzkbd = platform_get_drvdata(dev); |
| 330 | 330 | ||
| 331 | for (i = 0; i < SPITZ_KEY_STROBE_NUM; i++) | 331 | for (i = 0; i < SPITZ_KEY_STROBE_NUM; i++) |
| 332 | pxa_gpio_mode(spitz_strobes[i] | GPIO_OUT | GPIO_DFLT_HIGH); | 332 | pxa_gpio_mode(spitz_strobes[i] | GPIO_OUT | GPIO_DFLT_HIGH); |
| @@ -342,7 +342,7 @@ static int spitzkbd_resume(struct device *dev) | |||
| 342 | #define spitzkbd_resume NULL | 342 | #define spitzkbd_resume NULL |
| 343 | #endif | 343 | #endif |
| 344 | 344 | ||
| 345 | static int __init spitzkbd_probe(struct device *dev) | 345 | static int __init spitzkbd_probe(struct platform_device *dev) |
| 346 | { | 346 | { |
| 347 | struct spitzkbd *spitzkbd; | 347 | struct spitzkbd *spitzkbd; |
| 348 | struct input_dev *input_dev; | 348 | struct input_dev *input_dev; |
| @@ -358,7 +358,7 @@ static int __init spitzkbd_probe(struct device *dev) | |||
| 358 | return -ENOMEM; | 358 | return -ENOMEM; |
| 359 | } | 359 | } |
| 360 | 360 | ||
| 361 | dev_set_drvdata(dev, spitzkbd); | 361 | platform_set_drvdata(dev, spitzkbd); |
| 362 | strcpy(spitzkbd->phys, "spitzkbd/input0"); | 362 | strcpy(spitzkbd->phys, "spitzkbd/input0"); |
| 363 | 363 | ||
| 364 | spin_lock_init(&spitzkbd->lock); | 364 | spin_lock_init(&spitzkbd->lock); |
| @@ -380,7 +380,7 @@ static int __init spitzkbd_probe(struct device *dev) | |||
| 380 | input_dev->private = spitzkbd; | 380 | input_dev->private = spitzkbd; |
| 381 | input_dev->name = "Spitz Keyboard"; | 381 | input_dev->name = "Spitz Keyboard"; |
| 382 | input_dev->phys = spitzkbd->phys; | 382 | input_dev->phys = spitzkbd->phys; |
| 383 | input_dev->cdev.dev = dev; | 383 | input_dev->cdev.dev = &dev->dev; |
| 384 | 384 | ||
| 385 | input_dev->id.bustype = BUS_HOST; | 385 | input_dev->id.bustype = BUS_HOST; |
| 386 | input_dev->id.vendor = 0x0001; | 386 | input_dev->id.vendor = 0x0001; |
| @@ -437,10 +437,10 @@ static int __init spitzkbd_probe(struct device *dev) | |||
| 437 | return 0; | 437 | return 0; |
| 438 | } | 438 | } |
| 439 | 439 | ||
| 440 | static int spitzkbd_remove(struct device *dev) | 440 | static int spitzkbd_remove(struct platform_device *dev) |
| 441 | { | 441 | { |
| 442 | int i; | 442 | int i; |
| 443 | struct spitzkbd *spitzkbd = dev_get_drvdata(dev); | 443 | struct spitzkbd *spitzkbd = platform_get_drvdata(dev); |
| 444 | 444 | ||
| 445 | for (i = 0; i < SPITZ_KEY_SENSE_NUM; i++) | 445 | for (i = 0; i < SPITZ_KEY_SENSE_NUM; i++) |
| 446 | free_irq(IRQ_GPIO(spitz_senses[i]), spitzkbd); | 446 | free_irq(IRQ_GPIO(spitz_senses[i]), spitzkbd); |
| @@ -460,23 +460,24 @@ static int spitzkbd_remove(struct device *dev) | |||
| 460 | return 0; | 460 | return 0; |
| 461 | } | 461 | } |
| 462 | 462 | ||
| 463 | static struct device_driver spitzkbd_driver = { | 463 | static struct platform_driver spitzkbd_driver = { |
| 464 | .name = "spitz-keyboard", | ||
| 465 | .bus = &platform_bus_type, | ||
| 466 | .probe = spitzkbd_probe, | 464 | .probe = spitzkbd_probe, |
| 467 | .remove = spitzkbd_remove, | 465 | .remove = spitzkbd_remove, |
| 468 | .suspend = spitzkbd_suspend, | 466 | .suspend = spitzkbd_suspend, |
| 469 | .resume = spitzkbd_resume, | 467 | .resume = spitzkbd_resume, |
| 468 | .driver = { | ||
| 469 | .name = "spitz-keyboard", | ||
| 470 | }, | ||
| 470 | }; | 471 | }; |
| 471 | 472 | ||
| 472 | static int __devinit spitzkbd_init(void) | 473 | static int __devinit spitzkbd_init(void) |
| 473 | { | 474 | { |
| 474 | return driver_register(&spitzkbd_driver); | 475 | return platform_driver_register(&spitzkbd_driver); |
| 475 | } | 476 | } |
| 476 | 477 | ||
| 477 | static void __exit spitzkbd_exit(void) | 478 | static void __exit spitzkbd_exit(void) |
| 478 | { | 479 | { |
| 479 | driver_unregister(&spitzkbd_driver); | 480 | platform_driver_unregister(&spitzkbd_driver); |
| 480 | } | 481 | } |
| 481 | 482 | ||
| 482 | module_init(spitzkbd_init); | 483 | module_init(spitzkbd_init); |
diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c index 01e186422021..ac86c1d1d83e 100644 --- a/drivers/input/serio/i8042.c +++ b/drivers/input/serio/i8042.c | |||
| @@ -912,7 +912,7 @@ static long i8042_panic_blink(long count) | |||
| 912 | * Here we try to restore the original BIOS settings | 912 | * Here we try to restore the original BIOS settings |
| 913 | */ | 913 | */ |
| 914 | 914 | ||
| 915 | static int i8042_suspend(struct device *dev, pm_message_t state) | 915 | static int i8042_suspend(struct platform_device *dev, pm_message_t state) |
| 916 | { | 916 | { |
| 917 | del_timer_sync(&i8042_timer); | 917 | del_timer_sync(&i8042_timer); |
| 918 | i8042_controller_reset(); | 918 | i8042_controller_reset(); |
| @@ -925,7 +925,7 @@ static int i8042_suspend(struct device *dev, pm_message_t state) | |||
| 925 | * Here we try to reset everything back to a state in which suspended | 925 | * Here we try to reset everything back to a state in which suspended |
| 926 | */ | 926 | */ |
| 927 | 927 | ||
| 928 | static int i8042_resume(struct device *dev) | 928 | static int i8042_resume(struct platform_device *dev) |
| 929 | { | 929 | { |
| 930 | int i; | 930 | int i; |
| 931 | 931 | ||
| @@ -964,17 +964,18 @@ static int i8042_resume(struct device *dev) | |||
| 964 | * because otherwise BIOSes will be confused. | 964 | * because otherwise BIOSes will be confused. |
| 965 | */ | 965 | */ |
| 966 | 966 | ||
| 967 | static void i8042_shutdown(struct device *dev) | 967 | static void i8042_shutdown(struct platform_device *dev) |
| 968 | { | 968 | { |
| 969 | i8042_controller_cleanup(); | 969 | i8042_controller_cleanup(); |
| 970 | } | 970 | } |
| 971 | 971 | ||
| 972 | static struct device_driver i8042_driver = { | 972 | static struct platform_driver i8042_driver = { |
| 973 | .name = "i8042", | ||
| 974 | .bus = &platform_bus_type, | ||
| 975 | .suspend = i8042_suspend, | 973 | .suspend = i8042_suspend, |
| 976 | .resume = i8042_resume, | 974 | .resume = i8042_resume, |
| 977 | .shutdown = i8042_shutdown, | 975 | .shutdown = i8042_shutdown, |
| 976 | .driver = { | ||
| 977 | .name = "i8042", | ||
| 978 | }, | ||
| 978 | }; | 979 | }; |
| 979 | 980 | ||
| 980 | static int __init i8042_create_kbd_port(void) | 981 | static int __init i8042_create_kbd_port(void) |
| @@ -1078,7 +1079,7 @@ static int __init i8042_init(void) | |||
| 1078 | goto err_platform_exit; | 1079 | goto err_platform_exit; |
| 1079 | } | 1080 | } |
| 1080 | 1081 | ||
| 1081 | err = driver_register(&i8042_driver); | 1082 | err = platform_driver_register(&i8042_driver); |
| 1082 | if (err) | 1083 | if (err) |
| 1083 | goto err_controller_cleanup; | 1084 | goto err_controller_cleanup; |
| 1084 | 1085 | ||
| @@ -1126,7 +1127,7 @@ static int __init i8042_init(void) | |||
| 1126 | err_unregister_device: | 1127 | err_unregister_device: |
| 1127 | platform_device_unregister(i8042_platform_device); | 1128 | platform_device_unregister(i8042_platform_device); |
| 1128 | err_unregister_driver: | 1129 | err_unregister_driver: |
| 1129 | driver_unregister(&i8042_driver); | 1130 | platform_driver_unregister(&i8042_driver); |
| 1130 | err_controller_cleanup: | 1131 | err_controller_cleanup: |
| 1131 | i8042_controller_cleanup(); | 1132 | i8042_controller_cleanup(); |
| 1132 | err_platform_exit: | 1133 | err_platform_exit: |
| @@ -1148,7 +1149,7 @@ static void __exit i8042_exit(void) | |||
| 1148 | del_timer_sync(&i8042_timer); | 1149 | del_timer_sync(&i8042_timer); |
| 1149 | 1150 | ||
| 1150 | platform_device_unregister(i8042_platform_device); | 1151 | platform_device_unregister(i8042_platform_device); |
| 1151 | driver_unregister(&i8042_driver); | 1152 | platform_driver_unregister(&i8042_driver); |
| 1152 | 1153 | ||
| 1153 | i8042_platform_exit(); | 1154 | i8042_platform_exit(); |
| 1154 | 1155 | ||
diff --git a/drivers/input/serio/rpckbd.c b/drivers/input/serio/rpckbd.c index 52c49258f8a4..a3bd11589bc3 100644 --- a/drivers/input/serio/rpckbd.c +++ b/drivers/input/serio/rpckbd.c | |||
| @@ -107,7 +107,7 @@ static void rpckbd_close(struct serio *port) | |||
| 107 | * Allocate and initialize serio structure for subsequent registration | 107 | * Allocate and initialize serio structure for subsequent registration |
| 108 | * with serio core. | 108 | * with serio core. |
| 109 | */ | 109 | */ |
| 110 | static int __devinit rpckbd_probe(struct device *dev) | 110 | static int __devinit rpckbd_probe(struct platform_device *dev) |
| 111 | { | 111 | { |
| 112 | struct serio *serio; | 112 | struct serio *serio; |
| 113 | 113 | ||
| @@ -120,37 +120,38 @@ static int __devinit rpckbd_probe(struct device *dev) | |||
| 120 | serio->write = rpckbd_write; | 120 | serio->write = rpckbd_write; |
| 121 | serio->open = rpckbd_open; | 121 | serio->open = rpckbd_open; |
| 122 | serio->close = rpckbd_close; | 122 | serio->close = rpckbd_close; |
| 123 | serio->dev.parent = dev; | 123 | serio->dev.parent = &dev->dev; |
| 124 | strlcpy(serio->name, "RiscPC PS/2 kbd port", sizeof(serio->name)); | 124 | strlcpy(serio->name, "RiscPC PS/2 kbd port", sizeof(serio->name)); |
| 125 | strlcpy(serio->phys, "rpckbd/serio0", sizeof(serio->phys)); | 125 | strlcpy(serio->phys, "rpckbd/serio0", sizeof(serio->phys)); |
| 126 | 126 | ||
| 127 | dev_set_drvdata(dev, serio); | 127 | platform_set_drvdata(dev, serio); |
| 128 | serio_register_port(serio); | 128 | serio_register_port(serio); |
| 129 | return 0; | 129 | return 0; |
| 130 | } | 130 | } |
| 131 | 131 | ||
| 132 | static int __devexit rpckbd_remove(struct device *dev) | 132 | static int __devexit rpckbd_remove(struct platform_device *dev) |
| 133 | { | 133 | { |
| 134 | struct serio *serio = dev_get_drvdata(dev); | 134 | struct serio *serio = platform_get_drvdata(dev); |
| 135 | serio_unregister_port(serio); | 135 | serio_unregister_port(serio); |
| 136 | return 0; | 136 | return 0; |
| 137 | } | 137 | } |
| 138 | 138 | ||
| 139 | static struct device_driver rpckbd_driver = { | 139 | static struct platform_driver rpckbd_driver = { |
| 140 | .name = "kart", | ||
| 141 | .bus = &platform_bus_type, | ||
| 142 | .probe = rpckbd_probe, | 140 | .probe = rpckbd_probe, |
| 143 | .remove = __devexit_p(rpckbd_remove), | 141 | .remove = __devexit_p(rpckbd_remove), |
| 142 | .driver = { | ||
| 143 | .name = "kart", | ||
| 144 | }, | ||
| 144 | }; | 145 | }; |
| 145 | 146 | ||
| 146 | static int __init rpckbd_init(void) | 147 | static int __init rpckbd_init(void) |
| 147 | { | 148 | { |
| 148 | return driver_register(&rpckbd_driver); | 149 | return platform_driver_register(&rpckbd_driver); |
| 149 | } | 150 | } |
| 150 | 151 | ||
| 151 | static void __exit rpckbd_exit(void) | 152 | static void __exit rpckbd_exit(void) |
| 152 | { | 153 | { |
| 153 | driver_unregister(&rpckbd_driver); | 154 | platform_driver_unregister(&rpckbd_driver); |
| 154 | } | 155 | } |
| 155 | 156 | ||
| 156 | module_init(rpckbd_init); | 157 | module_init(rpckbd_init); |
diff --git a/drivers/input/touchscreen/corgi_ts.c b/drivers/input/touchscreen/corgi_ts.c index 15e88eeae8d6..1042987856f7 100644 --- a/drivers/input/touchscreen/corgi_ts.c +++ b/drivers/input/touchscreen/corgi_ts.c | |||
| @@ -231,9 +231,9 @@ static irqreturn_t ts_interrupt(int irq, void *dev_id, struct pt_regs *regs) | |||
| 231 | } | 231 | } |
| 232 | 232 | ||
| 233 | #ifdef CONFIG_PM | 233 | #ifdef CONFIG_PM |
| 234 | static int corgits_suspend(struct device *dev, pm_message_t state) | 234 | static int corgits_suspend(struct platform_device *dev, pm_message_t state) |
| 235 | { | 235 | { |
| 236 | struct corgi_ts *corgi_ts = dev_get_drvdata(dev); | 236 | struct corgi_ts *corgi_ts = platform_get_drvdata(dev); |
| 237 | 237 | ||
| 238 | if (corgi_ts->pendown) { | 238 | if (corgi_ts->pendown) { |
| 239 | del_timer_sync(&corgi_ts->timer); | 239 | del_timer_sync(&corgi_ts->timer); |
| @@ -248,9 +248,9 @@ static int corgits_suspend(struct device *dev, pm_message_t state) | |||
| 248 | return 0; | 248 | return 0; |
| 249 | } | 249 | } |
| 250 | 250 | ||
| 251 | static int corgits_resume(struct device *dev) | 251 | static int corgits_resume(struct platform_device *dev) |
| 252 | { | 252 | { |
| 253 | struct corgi_ts *corgi_ts = dev_get_drvdata(dev); | 253 | struct corgi_ts *corgi_ts = platform_get_drvdata(dev); |
| 254 | 254 | ||
| 255 | corgi_ssp_ads7846_putget((4u << ADSCTRL_ADR_SH) | ADSCTRL_STS); | 255 | corgi_ssp_ads7846_putget((4u << ADSCTRL_ADR_SH) | ADSCTRL_STS); |
| 256 | /* Enable Falling Edge */ | 256 | /* Enable Falling Edge */ |
| @@ -264,10 +264,9 @@ static int corgits_resume(struct device *dev) | |||
| 264 | #define corgits_resume NULL | 264 | #define corgits_resume NULL |
| 265 | #endif | 265 | #endif |
| 266 | 266 | ||
| 267 | static int __init corgits_probe(struct device *dev) | 267 | static int __init corgits_probe(struct platform_device *pdev) |
| 268 | { | 268 | { |
| 269 | struct corgi_ts *corgi_ts; | 269 | struct corgi_ts *corgi_ts; |
| 270 | struct platform_device *pdev = to_platform_device(dev); | ||
| 271 | struct input_dev *input_dev; | 270 | struct input_dev *input_dev; |
| 272 | int err = -ENOMEM; | 271 | int err = -ENOMEM; |
| 273 | 272 | ||
| @@ -276,9 +275,9 @@ static int __init corgits_probe(struct device *dev) | |||
| 276 | if (!corgi_ts || !input_dev) | 275 | if (!corgi_ts || !input_dev) |
| 277 | goto fail; | 276 | goto fail; |
| 278 | 277 | ||
| 279 | dev_set_drvdata(dev, corgi_ts); | 278 | platform_set_drvdata(pdev, corgi_ts); |
| 280 | 279 | ||
| 281 | corgi_ts->machinfo = dev->platform_data; | 280 | corgi_ts->machinfo = pdev->dev.platform_data; |
| 282 | corgi_ts->irq_gpio = platform_get_irq(pdev, 0); | 281 | corgi_ts->irq_gpio = platform_get_irq(pdev, 0); |
| 283 | 282 | ||
| 284 | if (corgi_ts->irq_gpio < 0) { | 283 | if (corgi_ts->irq_gpio < 0) { |
| @@ -298,7 +297,7 @@ static int __init corgits_probe(struct device *dev) | |||
| 298 | input_dev->id.vendor = 0x0001; | 297 | input_dev->id.vendor = 0x0001; |
| 299 | input_dev->id.product = 0x0002; | 298 | input_dev->id.product = 0x0002; |
| 300 | input_dev->id.version = 0x0100; | 299 | input_dev->id.version = 0x0100; |
| 301 | input_dev->cdev.dev = dev; | 300 | input_dev->cdev.dev = &pdev->dev; |
| 302 | input_dev->private = corgi_ts; | 301 | input_dev->private = corgi_ts; |
| 303 | 302 | ||
| 304 | input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); | 303 | input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); |
| @@ -339,9 +338,9 @@ static int __init corgits_probe(struct device *dev) | |||
| 339 | 338 | ||
| 340 | } | 339 | } |
| 341 | 340 | ||
| 342 | static int corgits_remove(struct device *dev) | 341 | static int corgits_remove(struct platform_device *pdev) |
| 343 | { | 342 | { |
| 344 | struct corgi_ts *corgi_ts = dev_get_drvdata(dev); | 343 | struct corgi_ts *corgi_ts = platform_get_drvdata(pdev); |
| 345 | 344 | ||
| 346 | free_irq(corgi_ts->irq_gpio, NULL); | 345 | free_irq(corgi_ts->irq_gpio, NULL); |
| 347 | del_timer_sync(&corgi_ts->timer); | 346 | del_timer_sync(&corgi_ts->timer); |
| @@ -351,23 +350,24 @@ static int corgits_remove(struct device *dev) | |||
| 351 | return 0; | 350 | return 0; |
| 352 | } | 351 | } |
| 353 | 352 | ||
| 354 | static struct device_driver corgits_driver = { | 353 | static struct platform_driver corgits_driver = { |
| 355 | .name = "corgi-ts", | ||
| 356 | .bus = &platform_bus_type, | ||
| 357 | .probe = corgits_probe, | 354 | .probe = corgits_probe, |
| 358 | .remove = corgits_remove, | 355 | .remove = corgits_remove, |
| 359 | .suspend = corgits_suspend, | 356 | .suspend = corgits_suspend, |
| 360 | .resume = corgits_resume, | 357 | .resume = corgits_resume, |
| 358 | .driver = { | ||
| 359 | .name = "corgi-ts", | ||
| 360 | }, | ||
| 361 | }; | 361 | }; |
| 362 | 362 | ||
| 363 | static int __devinit corgits_init(void) | 363 | static int __devinit corgits_init(void) |
| 364 | { | 364 | { |
| 365 | return driver_register(&corgits_driver); | 365 | return platform_driver_register(&corgits_driver); |
| 366 | } | 366 | } |
| 367 | 367 | ||
| 368 | static void __exit corgits_exit(void) | 368 | static void __exit corgits_exit(void) |
| 369 | { | 369 | { |
| 370 | driver_unregister(&corgits_driver); | 370 | platform_driver_unregister(&corgits_driver); |
| 371 | } | 371 | } |
| 372 | 372 | ||
| 373 | module_init(corgits_init); | 373 | module_init(corgits_init); |
diff --git a/drivers/mfd/mcp-sa11x0.c b/drivers/mfd/mcp-sa11x0.c index 7daa0ed7331c..1eab7cffceaa 100644 --- a/drivers/mfd/mcp-sa11x0.c +++ b/drivers/mfd/mcp-sa11x0.c | |||
| @@ -138,9 +138,8 @@ static struct mcp_ops mcp_sa11x0 = { | |||
| 138 | .disable = mcp_sa11x0_disable, | 138 | .disable = mcp_sa11x0_disable, |
| 139 | }; | 139 | }; |
| 140 | 140 | ||
| 141 | static int mcp_sa11x0_probe(struct device *dev) | 141 | static int mcp_sa11x0_probe(struct platform_device *pdev) |
| 142 | { | 142 | { |
| 143 | struct platform_device *pdev = to_platform_device(dev); | ||
| 144 | struct mcp_plat_data *data = pdev->dev.platform_data; | 143 | struct mcp_plat_data *data = pdev->dev.platform_data; |
| 145 | struct mcp *mcp; | 144 | struct mcp *mcp; |
| 146 | int ret; | 145 | int ret; |
| @@ -165,7 +164,7 @@ static int mcp_sa11x0_probe(struct device *dev) | |||
| 165 | mcp->dma_telco_rd = DMA_Ser4MCP1Rd; | 164 | mcp->dma_telco_rd = DMA_Ser4MCP1Rd; |
| 166 | mcp->dma_telco_wr = DMA_Ser4MCP1Wr; | 165 | mcp->dma_telco_wr = DMA_Ser4MCP1Wr; |
| 167 | 166 | ||
| 168 | dev_set_drvdata(dev, mcp); | 167 | platform_set_drvdata(pdev, mcp); |
| 169 | 168 | ||
| 170 | if (machine_is_assabet()) { | 169 | if (machine_is_assabet()) { |
| 171 | ASSABET_BCR_set(ASSABET_BCR_CODEC_RST); | 170 | ASSABET_BCR_set(ASSABET_BCR_CODEC_RST); |
| @@ -202,26 +201,26 @@ static int mcp_sa11x0_probe(struct device *dev) | |||
| 202 | 201 | ||
| 203 | release: | 202 | release: |
| 204 | release_mem_region(0x80060000, 0x60); | 203 | release_mem_region(0x80060000, 0x60); |
| 205 | dev_set_drvdata(dev, NULL); | 204 | platform_set_drvdata(pdev, NULL); |
| 206 | 205 | ||
| 207 | out: | 206 | out: |
| 208 | return ret; | 207 | return ret; |
| 209 | } | 208 | } |
| 210 | 209 | ||
| 211 | static int mcp_sa11x0_remove(struct device *dev) | 210 | static int mcp_sa11x0_remove(struct platform_device *dev) |
| 212 | { | 211 | { |
| 213 | struct mcp *mcp = dev_get_drvdata(dev); | 212 | struct mcp *mcp = platform_get_drvdata(dev); |
| 214 | 213 | ||
| 215 | dev_set_drvdata(dev, NULL); | 214 | platform_set_drvdata(dev, NULL); |
| 216 | mcp_host_unregister(mcp); | 215 | mcp_host_unregister(mcp); |
| 217 | release_mem_region(0x80060000, 0x60); | 216 | release_mem_region(0x80060000, 0x60); |
| 218 | 217 | ||
| 219 | return 0; | 218 | return 0; |
| 220 | } | 219 | } |
| 221 | 220 | ||
| 222 | static int mcp_sa11x0_suspend(struct device *dev, pm_message_t state) | 221 | static int mcp_sa11x0_suspend(struct platform_device *dev, pm_message_t state) |
| 223 | { | 222 | { |
| 224 | struct mcp *mcp = dev_get_drvdata(dev); | 223 | struct mcp *mcp = platform_get_drvdata(dev); |
| 225 | 224 | ||
| 226 | priv(mcp)->mccr0 = Ser4MCCR0; | 225 | priv(mcp)->mccr0 = Ser4MCCR0; |
| 227 | priv(mcp)->mccr1 = Ser4MCCR1; | 226 | priv(mcp)->mccr1 = Ser4MCCR1; |
| @@ -230,9 +229,9 @@ static int mcp_sa11x0_suspend(struct device *dev, pm_message_t state) | |||
| 230 | return 0; | 229 | return 0; |
| 231 | } | 230 | } |
| 232 | 231 | ||
| 233 | static int mcp_sa11x0_resume(struct device *dev) | 232 | static int mcp_sa11x0_resume(struct platform_device *dev) |
| 234 | { | 233 | { |
| 235 | struct mcp *mcp = dev_get_drvdata(dev); | 234 | struct mcp *mcp = platform_get_drvdata(dev); |
| 236 | 235 | ||
| 237 | Ser4MCCR1 = priv(mcp)->mccr1; | 236 | Ser4MCCR1 = priv(mcp)->mccr1; |
| 238 | Ser4MCCR0 = priv(mcp)->mccr0; | 237 | Ser4MCCR0 = priv(mcp)->mccr0; |
| @@ -243,13 +242,14 @@ static int mcp_sa11x0_resume(struct device *dev) | |||
| 243 | /* | 242 | /* |
| 244 | * The driver for the SA11x0 MCP port. | 243 | * The driver for the SA11x0 MCP port. |
| 245 | */ | 244 | */ |
| 246 | static struct device_driver mcp_sa11x0_driver = { | 245 | static struct platform_driver mcp_sa11x0_driver = { |
| 247 | .name = "sa11x0-mcp", | ||
| 248 | .bus = &platform_bus_type, | ||
| 249 | .probe = mcp_sa11x0_probe, | 246 | .probe = mcp_sa11x0_probe, |
| 250 | .remove = mcp_sa11x0_remove, | 247 | .remove = mcp_sa11x0_remove, |
| 251 | .suspend = mcp_sa11x0_suspend, | 248 | .suspend = mcp_sa11x0_suspend, |
| 252 | .resume = mcp_sa11x0_resume, | 249 | .resume = mcp_sa11x0_resume, |
| 250 | .driver = { | ||
| 251 | .name = "sa11x0-mcp", | ||
| 252 | }, | ||
| 253 | }; | 253 | }; |
| 254 | 254 | ||
| 255 | /* | 255 | /* |
| @@ -257,12 +257,12 @@ static struct device_driver mcp_sa11x0_driver = { | |||
| 257 | */ | 257 | */ |
| 258 | static int __init mcp_sa11x0_init(void) | 258 | static int __init mcp_sa11x0_init(void) |
| 259 | { | 259 | { |
| 260 | return driver_register(&mcp_sa11x0_driver); | 260 | return platform_driver_register(&mcp_sa11x0_driver); |
| 261 | } | 261 | } |
| 262 | 262 | ||
| 263 | static void __exit mcp_sa11x0_exit(void) | 263 | static void __exit mcp_sa11x0_exit(void) |
| 264 | { | 264 | { |
| 265 | driver_unregister(&mcp_sa11x0_driver); | 265 | platform_driver_unregister(&mcp_sa11x0_driver); |
| 266 | } | 266 | } |
| 267 | 267 | ||
| 268 | module_init(mcp_sa11x0_init); | 268 | module_init(mcp_sa11x0_init); |
diff --git a/drivers/misc/hdpuftrs/hdpu_cpustate.c b/drivers/misc/hdpuftrs/hdpu_cpustate.c index bc2b72b32905..11a801be71c8 100644 --- a/drivers/misc/hdpuftrs/hdpu_cpustate.c +++ b/drivers/misc/hdpuftrs/hdpu_cpustate.c | |||
| @@ -26,8 +26,8 @@ | |||
| 26 | 26 | ||
| 27 | #define SKY_CPUSTATE_VERSION "1.1" | 27 | #define SKY_CPUSTATE_VERSION "1.1" |
| 28 | 28 | ||
| 29 | static int hdpu_cpustate_probe(struct device *ddev); | 29 | static int hdpu_cpustate_probe(struct platform_device *pdev); |
| 30 | static int hdpu_cpustate_remove(struct device *ddev); | 30 | static int hdpu_cpustate_remove(struct platform_device *pdev); |
| 31 | 31 | ||
| 32 | struct cpustate_t cpustate; | 32 | struct cpustate_t cpustate; |
| 33 | 33 | ||
| @@ -158,11 +158,12 @@ static int cpustate_read_proc(char *page, char **start, off_t off, | |||
| 158 | return len; | 158 | return len; |
| 159 | } | 159 | } |
| 160 | 160 | ||
| 161 | static struct device_driver hdpu_cpustate_driver = { | 161 | static struct platform_driver hdpu_cpustate_driver = { |
| 162 | .name = HDPU_CPUSTATE_NAME, | ||
| 163 | .bus = &platform_bus_type, | ||
| 164 | .probe = hdpu_cpustate_probe, | 162 | .probe = hdpu_cpustate_probe, |
| 165 | .remove = hdpu_cpustate_remove, | 163 | .remove = hdpu_cpustate_remove, |
| 164 | .driver = { | ||
| 165 | .name = HDPU_CPUSTATE_NAME, | ||
| 166 | }, | ||
| 166 | }; | 167 | }; |
| 167 | 168 | ||
| 168 | /* | 169 | /* |
| @@ -187,9 +188,8 @@ static struct miscdevice cpustate_dev = { | |||
| 187 | &cpustate_fops | 188 | &cpustate_fops |
| 188 | }; | 189 | }; |
| 189 | 190 | ||
| 190 | static int hdpu_cpustate_probe(struct device *ddev) | 191 | static int hdpu_cpustate_probe(struct platform_device *pdev) |
| 191 | { | 192 | { |
| 192 | struct platform_device *pdev = to_platform_device(ddev); | ||
| 193 | struct resource *res; | 193 | struct resource *res; |
| 194 | struct proc_dir_entry *proc_de; | 194 | struct proc_dir_entry *proc_de; |
| 195 | int ret; | 195 | int ret; |
| @@ -217,7 +217,7 @@ static int hdpu_cpustate_probe(struct device *ddev) | |||
| 217 | return 0; | 217 | return 0; |
| 218 | } | 218 | } |
| 219 | 219 | ||
| 220 | static int hdpu_cpustate_remove(struct device *ddev) | 220 | static int hdpu_cpustate_remove(struct platform_device *pdev) |
| 221 | { | 221 | { |
| 222 | 222 | ||
| 223 | cpustate.set_addr = NULL; | 223 | cpustate.set_addr = NULL; |
| @@ -232,13 +232,13 @@ static int hdpu_cpustate_remove(struct device *ddev) | |||
| 232 | static int __init cpustate_init(void) | 232 | static int __init cpustate_init(void) |
| 233 | { | 233 | { |
| 234 | int rc; | 234 | int rc; |
| 235 | rc = driver_register(&hdpu_cpustate_driver); | 235 | rc = platform_driver_register(&hdpu_cpustate_driver); |
| 236 | return rc; | 236 | return rc; |
| 237 | } | 237 | } |
| 238 | 238 | ||
| 239 | static void __exit cpustate_exit(void) | 239 | static void __exit cpustate_exit(void) |
| 240 | { | 240 | { |
| 241 | driver_unregister(&hdpu_cpustate_driver); | 241 | platform_driver_unregister(&hdpu_cpustate_driver); |
| 242 | } | 242 | } |
| 243 | 243 | ||
| 244 | module_init(cpustate_init); | 244 | module_init(cpustate_init); |
diff --git a/drivers/misc/hdpuftrs/hdpu_nexus.c b/drivers/misc/hdpuftrs/hdpu_nexus.c index 4bb461793851..ea9d5f233c83 100644 --- a/drivers/misc/hdpuftrs/hdpu_nexus.c +++ b/drivers/misc/hdpuftrs/hdpu_nexus.c | |||
| @@ -22,19 +22,20 @@ | |||
| 22 | 22 | ||
| 23 | #include <linux/platform_device.h> | 23 | #include <linux/platform_device.h> |
| 24 | 24 | ||
| 25 | static int hdpu_nexus_probe(struct device *ddev); | 25 | static int hdpu_nexus_probe(struct platform_device *pdev); |
| 26 | static int hdpu_nexus_remove(struct device *ddev); | 26 | static int hdpu_nexus_remove(struct platform_device *pdev); |
| 27 | 27 | ||
| 28 | static struct proc_dir_entry *hdpu_slot_id; | 28 | static struct proc_dir_entry *hdpu_slot_id; |
| 29 | static struct proc_dir_entry *hdpu_chassis_id; | 29 | static struct proc_dir_entry *hdpu_chassis_id; |
| 30 | static int slot_id = -1; | 30 | static int slot_id = -1; |
| 31 | static int chassis_id = -1; | 31 | static int chassis_id = -1; |
| 32 | 32 | ||
| 33 | static struct device_driver hdpu_nexus_driver = { | 33 | static struct platform_driver hdpu_nexus_driver = { |
| 34 | .name = HDPU_NEXUS_NAME, | ||
| 35 | .bus = &platform_bus_type, | ||
| 36 | .probe = hdpu_nexus_probe, | 34 | .probe = hdpu_nexus_probe, |
| 37 | .remove = hdpu_nexus_remove, | 35 | .remove = hdpu_nexus_remove, |
| 36 | .driver = { | ||
| 37 | .name = HDPU_NEXUS_NAME, | ||
| 38 | }, | ||
| 38 | }; | 39 | }; |
| 39 | 40 | ||
| 40 | int hdpu_slot_id_read(char *buffer, char **buffer_location, off_t offset, | 41 | int hdpu_slot_id_read(char *buffer, char **buffer_location, off_t offset, |
| @@ -55,9 +56,8 @@ int hdpu_chassis_id_read(char *buffer, char **buffer_location, off_t offset, | |||
| 55 | return sprintf(buffer, "%d\n", chassis_id); | 56 | return sprintf(buffer, "%d\n", chassis_id); |
| 56 | } | 57 | } |
| 57 | 58 | ||
| 58 | static int hdpu_nexus_probe(struct device *ddev) | 59 | static int hdpu_nexus_probe(struct platform_device *pdev) |
| 59 | { | 60 | { |
| 60 | struct platform_device *pdev = to_platform_device(ddev); | ||
| 61 | struct resource *res; | 61 | struct resource *res; |
| 62 | 62 | ||
| 63 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 63 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
| @@ -80,7 +80,7 @@ static int hdpu_nexus_probe(struct device *ddev) | |||
| 80 | return 0; | 80 | return 0; |
| 81 | } | 81 | } |
| 82 | 82 | ||
| 83 | static int hdpu_nexus_remove(struct device *ddev) | 83 | static int hdpu_nexus_remove(struct platform_device *pdev) |
| 84 | { | 84 | { |
| 85 | slot_id = -1; | 85 | slot_id = -1; |
| 86 | chassis_id = -1; | 86 | chassis_id = -1; |
| @@ -94,13 +94,13 @@ static int hdpu_nexus_remove(struct device *ddev) | |||
| 94 | static int __init nexus_init(void) | 94 | static int __init nexus_init(void) |
| 95 | { | 95 | { |
| 96 | int rc; | 96 | int rc; |
| 97 | rc = driver_register(&hdpu_nexus_driver); | 97 | rc = platform_driver_register(&hdpu_nexus_driver); |
| 98 | return rc; | 98 | return rc; |
| 99 | } | 99 | } |
| 100 | 100 | ||
| 101 | static void __exit nexus_exit(void) | 101 | static void __exit nexus_exit(void) |
| 102 | { | 102 | { |
| 103 | driver_unregister(&hdpu_nexus_driver); | 103 | platform_driver_unregister(&hdpu_nexus_driver); |
| 104 | } | 104 | } |
| 105 | 105 | ||
| 106 | module_init(nexus_init); | 106 | module_init(nexus_init); |
diff --git a/drivers/mmc/pxamci.c b/drivers/mmc/pxamci.c index f31e247b2cbe..ee8f8a0420d1 100644 --- a/drivers/mmc/pxamci.c +++ b/drivers/mmc/pxamci.c | |||
| @@ -428,9 +428,8 @@ static irqreturn_t pxamci_detect_irq(int irq, void *devid, struct pt_regs *regs) | |||
| 428 | return IRQ_HANDLED; | 428 | return IRQ_HANDLED; |
| 429 | } | 429 | } |
| 430 | 430 | ||
| 431 | static int pxamci_probe(struct device *dev) | 431 | static int pxamci_probe(struct platform_device *pdev) |
| 432 | { | 432 | { |
| 433 | struct platform_device *pdev = to_platform_device(dev); | ||
| 434 | struct mmc_host *mmc; | 433 | struct mmc_host *mmc; |
| 435 | struct pxamci_host *host = NULL; | 434 | struct pxamci_host *host = NULL; |
| 436 | struct resource *r; | 435 | struct resource *r; |
| @@ -445,7 +444,7 @@ static int pxamci_probe(struct device *dev) | |||
| 445 | if (!r) | 444 | if (!r) |
| 446 | return -EBUSY; | 445 | return -EBUSY; |
| 447 | 446 | ||
| 448 | mmc = mmc_alloc_host(sizeof(struct pxamci_host), dev); | 447 | mmc = mmc_alloc_host(sizeof(struct pxamci_host), &pdev->dev); |
| 449 | if (!mmc) { | 448 | if (!mmc) { |
| 450 | ret = -ENOMEM; | 449 | ret = -ENOMEM; |
| 451 | goto out; | 450 | goto out; |
| @@ -474,7 +473,7 @@ static int pxamci_probe(struct device *dev) | |||
| 474 | host->pdata->ocr_mask : | 473 | host->pdata->ocr_mask : |
| 475 | MMC_VDD_32_33|MMC_VDD_33_34; | 474 | MMC_VDD_32_33|MMC_VDD_33_34; |
| 476 | 475 | ||
| 477 | host->sg_cpu = dma_alloc_coherent(dev, PAGE_SIZE, &host->sg_dma, GFP_KERNEL); | 476 | host->sg_cpu = dma_alloc_coherent(&pdev->dev, PAGE_SIZE, &host->sg_dma, GFP_KERNEL); |
| 478 | if (!host->sg_cpu) { | 477 | if (!host->sg_cpu) { |
| 479 | ret = -ENOMEM; | 478 | ret = -ENOMEM; |
| 480 | goto out; | 479 | goto out; |
| @@ -511,10 +510,10 @@ static int pxamci_probe(struct device *dev) | |||
| 511 | if (ret) | 510 | if (ret) |
| 512 | goto out; | 511 | goto out; |
| 513 | 512 | ||
| 514 | dev_set_drvdata(dev, mmc); | 513 | platform_set_drvdata(pdev, mmc); |
| 515 | 514 | ||
| 516 | if (host->pdata && host->pdata->init) | 515 | if (host->pdata && host->pdata->init) |
| 517 | host->pdata->init(dev, pxamci_detect_irq, mmc); | 516 | host->pdata->init(&pdev->dev, pxamci_detect_irq, mmc); |
| 518 | 517 | ||
| 519 | mmc_add_host(mmc); | 518 | mmc_add_host(mmc); |
| 520 | 519 | ||
| @@ -527,7 +526,7 @@ static int pxamci_probe(struct device *dev) | |||
| 527 | if (host->base) | 526 | if (host->base) |
| 528 | iounmap(host->base); | 527 | iounmap(host->base); |
| 529 | if (host->sg_cpu) | 528 | if (host->sg_cpu) |
| 530 | dma_free_coherent(dev, PAGE_SIZE, host->sg_cpu, host->sg_dma); | 529 | dma_free_coherent(&pdev->dev, PAGE_SIZE, host->sg_cpu, host->sg_dma); |
| 531 | } | 530 | } |
| 532 | if (mmc) | 531 | if (mmc) |
| 533 | mmc_free_host(mmc); | 532 | mmc_free_host(mmc); |
| @@ -535,17 +534,17 @@ static int pxamci_probe(struct device *dev) | |||
| 535 | return ret; | 534 | return ret; |
| 536 | } | 535 | } |
| 537 | 536 | ||
| 538 | static int pxamci_remove(struct device *dev) | 537 | static int pxamci_remove(struct platform_device *pdev) |
| 539 | { | 538 | { |
| 540 | struct mmc_host *mmc = dev_get_drvdata(dev); | 539 | struct mmc_host *mmc = platform_get_drvdata(pdev); |
| 541 | 540 | ||
| 542 | dev_set_drvdata(dev, NULL); | 541 | platform_set_drvdata(pdev, NULL); |
| 543 | 542 | ||
| 544 | if (mmc) { | 543 | if (mmc) { |
| 545 | struct pxamci_host *host = mmc_priv(mmc); | 544 | struct pxamci_host *host = mmc_priv(mmc); |
| 546 | 545 | ||
| 547 | if (host->pdata && host->pdata->exit) | 546 | if (host->pdata && host->pdata->exit) |
| 548 | host->pdata->exit(dev, mmc); | 547 | host->pdata->exit(&pdev->dev, mmc); |
| 549 | 548 | ||
| 550 | mmc_remove_host(mmc); | 549 | mmc_remove_host(mmc); |
| 551 | 550 | ||
| @@ -560,7 +559,7 @@ static int pxamci_remove(struct device *dev) | |||
| 560 | free_irq(host->irq, host); | 559 | free_irq(host->irq, host); |
| 561 | pxa_free_dma(host->dma); | 560 | pxa_free_dma(host->dma); |
| 562 | iounmap(host->base); | 561 | iounmap(host->base); |
| 563 | dma_free_coherent(dev, PAGE_SIZE, host->sg_cpu, host->sg_dma); | 562 | dma_free_coherent(&pdev->dev, PAGE_SIZE, host->sg_cpu, host->sg_dma); |
| 564 | 563 | ||
| 565 | release_resource(host->res); | 564 | release_resource(host->res); |
| 566 | 565 | ||
| @@ -570,9 +569,9 @@ static int pxamci_remove(struct device *dev) | |||
| 570 | } | 569 | } |
| 571 | 570 | ||
| 572 | #ifdef CONFIG_PM | 571 | #ifdef CONFIG_PM |
| 573 | static int pxamci_suspend(struct device *dev, pm_message_t state) | 572 | static int pxamci_suspend(struct platform_device *dev, pm_message_t state) |
| 574 | { | 573 | { |
| 575 | struct mmc_host *mmc = dev_get_drvdata(dev); | 574 | struct mmc_host *mmc = platform_get_drvdata(dev); |
| 576 | int ret = 0; | 575 | int ret = 0; |
| 577 | 576 | ||
| 578 | if (mmc) | 577 | if (mmc) |
| @@ -581,9 +580,9 @@ static int pxamci_suspend(struct device *dev, pm_message_t state) | |||
| 581 | return ret; | 580 | return ret; |
| 582 | } | 581 | } |
| 583 | 582 | ||
| 584 | static int pxamci_resume(struct device *dev) | 583 | static int pxamci_resume(struct platform_device *dev) |
| 585 | { | 584 | { |
| 586 | struct mmc_host *mmc = dev_get_drvdata(dev); | 585 | struct mmc_host *mmc = platform_get_drvdata(dev); |
| 587 | int ret = 0; | 586 | int ret = 0; |
| 588 | 587 | ||
| 589 | if (mmc) | 588 | if (mmc) |
| @@ -596,23 +595,24 @@ static int pxamci_resume(struct device *dev) | |||
| 596 | #define pxamci_resume NULL | 595 | #define pxamci_resume NULL |
| 597 | #endif | 596 | #endif |
| 598 | 597 | ||
| 599 | static struct device_driver pxamci_driver = { | 598 | static struct platform_driver pxamci_driver = { |
| 600 | .name = DRIVER_NAME, | ||
| 601 | .bus = &platform_bus_type, | ||
| 602 | .probe = pxamci_probe, | 599 | .probe = pxamci_probe, |
| 603 | .remove = pxamci_remove, | 600 | .remove = pxamci_remove, |
| 604 | .suspend = pxamci_suspend, | 601 | .suspend = pxamci_suspend, |
| 605 | .resume = pxamci_resume, | 602 | .resume = pxamci_resume, |
| 603 | .driver = { | ||
| 604 | .name = DRIVER_NAME, | ||
| 605 | }, | ||
| 606 | }; | 606 | }; |
| 607 | 607 | ||
| 608 | static int __init pxamci_init(void) | 608 | static int __init pxamci_init(void) |
| 609 | { | 609 | { |
| 610 | return driver_register(&pxamci_driver); | 610 | return platform_driver_register(&pxamci_driver); |
| 611 | } | 611 | } |
| 612 | 612 | ||
| 613 | static void __exit pxamci_exit(void) | 613 | static void __exit pxamci_exit(void) |
| 614 | { | 614 | { |
| 615 | driver_unregister(&pxamci_driver); | 615 | platform_driver_unregister(&pxamci_driver); |
| 616 | } | 616 | } |
| 617 | 617 | ||
| 618 | module_init(pxamci_init); | 618 | module_init(pxamci_init); |
diff --git a/drivers/mmc/wbsd.c b/drivers/mmc/wbsd.c index e954b8354fef..c7eb7c269081 100644 --- a/drivers/mmc/wbsd.c +++ b/drivers/mmc/wbsd.c | |||
| @@ -42,7 +42,7 @@ | |||
| 42 | #include "wbsd.h" | 42 | #include "wbsd.h" |
| 43 | 43 | ||
| 44 | #define DRIVER_NAME "wbsd" | 44 | #define DRIVER_NAME "wbsd" |
| 45 | #define DRIVER_VERSION "1.4" | 45 | #define DRIVER_VERSION "1.5" |
| 46 | 46 | ||
| 47 | #ifdef CONFIG_MMC_DEBUG | 47 | #ifdef CONFIG_MMC_DEBUG |
| 48 | #define DBG(x...) \ | 48 | #define DBG(x...) \ |
| @@ -1932,14 +1932,14 @@ static void __devexit wbsd_shutdown(struct device* dev, int pnp) | |||
| 1932 | * Non-PnP | 1932 | * Non-PnP |
| 1933 | */ | 1933 | */ |
| 1934 | 1934 | ||
| 1935 | static int __devinit wbsd_probe(struct device* dev) | 1935 | static int __devinit wbsd_probe(struct platform_device* dev) |
| 1936 | { | 1936 | { |
| 1937 | return wbsd_init(dev, io, irq, dma, 0); | 1937 | return wbsd_init(&dev->dev, io, irq, dma, 0); |
| 1938 | } | 1938 | } |
| 1939 | 1939 | ||
| 1940 | static int __devexit wbsd_remove(struct device* dev) | 1940 | static int __devexit wbsd_remove(struct platform_device* dev) |
| 1941 | { | 1941 | { |
| 1942 | wbsd_shutdown(dev, 0); | 1942 | wbsd_shutdown(&dev->dev, 0); |
| 1943 | 1943 | ||
| 1944 | return 0; | 1944 | return 0; |
| 1945 | } | 1945 | } |
| @@ -1983,9 +1983,9 @@ static void __devexit wbsd_pnp_remove(struct pnp_dev * dev) | |||
| 1983 | 1983 | ||
| 1984 | #ifdef CONFIG_PM | 1984 | #ifdef CONFIG_PM |
| 1985 | 1985 | ||
| 1986 | static int wbsd_suspend(struct device *dev, pm_message_t state) | 1986 | static int wbsd_suspend(struct platform_device *dev, pm_message_t state) |
| 1987 | { | 1987 | { |
| 1988 | struct mmc_host *mmc = dev_get_drvdata(dev); | 1988 | struct mmc_host *mmc = platform_get_drvdata(dev); |
| 1989 | struct wbsd_host *host; | 1989 | struct wbsd_host *host; |
| 1990 | int ret; | 1990 | int ret; |
| 1991 | 1991 | ||
| @@ -2005,9 +2005,9 @@ static int wbsd_suspend(struct device *dev, pm_message_t state) | |||
| 2005 | return 0; | 2005 | return 0; |
| 2006 | } | 2006 | } |
| 2007 | 2007 | ||
| 2008 | static int wbsd_resume(struct device *dev) | 2008 | static int wbsd_resume(struct platform_device *dev) |
| 2009 | { | 2009 | { |
| 2010 | struct mmc_host *mmc = dev_get_drvdata(dev); | 2010 | struct mmc_host *mmc = platform_get_drvdata(dev); |
| 2011 | struct wbsd_host *host; | 2011 | struct wbsd_host *host; |
| 2012 | 2012 | ||
| 2013 | if (!mmc) | 2013 | if (!mmc) |
| @@ -2038,14 +2038,15 @@ static int wbsd_resume(struct device *dev) | |||
| 2038 | 2038 | ||
| 2039 | static struct platform_device *wbsd_device; | 2039 | static struct platform_device *wbsd_device; |
| 2040 | 2040 | ||
| 2041 | static struct device_driver wbsd_driver = { | 2041 | static struct platform_driver wbsd_driver = { |
| 2042 | .name = DRIVER_NAME, | ||
| 2043 | .bus = &platform_bus_type, | ||
| 2044 | .probe = wbsd_probe, | 2042 | .probe = wbsd_probe, |
| 2045 | .remove = wbsd_remove, | 2043 | .remove = __devexit_p(wbsd_remove), |
| 2046 | 2044 | ||
| 2047 | .suspend = wbsd_suspend, | 2045 | .suspend = wbsd_suspend, |
| 2048 | .resume = wbsd_resume, | 2046 | .resume = wbsd_resume, |
| 2047 | .driver = { | ||
| 2048 | .name = DRIVER_NAME, | ||
| 2049 | }, | ||
| 2049 | }; | 2050 | }; |
| 2050 | 2051 | ||
| 2051 | #ifdef CONFIG_PNP | 2052 | #ifdef CONFIG_PNP |
| @@ -2054,7 +2055,7 @@ static struct pnp_driver wbsd_pnp_driver = { | |||
| 2054 | .name = DRIVER_NAME, | 2055 | .name = DRIVER_NAME, |
| 2055 | .id_table = pnp_dev_table, | 2056 | .id_table = pnp_dev_table, |
| 2056 | .probe = wbsd_pnp_probe, | 2057 | .probe = wbsd_pnp_probe, |
| 2057 | .remove = wbsd_pnp_remove, | 2058 | .remove = __devexit_p(wbsd_pnp_remove), |
| 2058 | }; | 2059 | }; |
| 2059 | 2060 | ||
| 2060 | #endif /* CONFIG_PNP */ | 2061 | #endif /* CONFIG_PNP */ |
| @@ -2085,7 +2086,7 @@ static int __init wbsd_drv_init(void) | |||
| 2085 | 2086 | ||
| 2086 | if (nopnp) | 2087 | if (nopnp) |
| 2087 | { | 2088 | { |
| 2088 | result = driver_register(&wbsd_driver); | 2089 | result = platform_driver_register(&wbsd_driver); |
| 2089 | if (result < 0) | 2090 | if (result < 0) |
| 2090 | return result; | 2091 | return result; |
| 2091 | 2092 | ||
| @@ -2111,7 +2112,7 @@ static void __exit wbsd_drv_exit(void) | |||
| 2111 | { | 2112 | { |
| 2112 | platform_device_unregister(wbsd_device); | 2113 | platform_device_unregister(wbsd_device); |
| 2113 | 2114 | ||
| 2114 | driver_unregister(&wbsd_driver); | 2115 | platform_driver_unregister(&wbsd_driver); |
| 2115 | } | 2116 | } |
| 2116 | 2117 | ||
| 2117 | DBG("unloaded\n"); | 2118 | DBG("unloaded\n"); |
| @@ -2127,6 +2128,7 @@ module_param(irq, uint, 0444); | |||
| 2127 | module_param(dma, int, 0444); | 2128 | module_param(dma, int, 0444); |
| 2128 | 2129 | ||
| 2129 | MODULE_LICENSE("GPL"); | 2130 | MODULE_LICENSE("GPL"); |
| 2131 | MODULE_AUTHOR("Pierre Ossman <drzeus@drzeus.cx>"); | ||
| 2130 | MODULE_DESCRIPTION("Winbond W83L51xD SD/MMC card interface driver"); | 2132 | MODULE_DESCRIPTION("Winbond W83L51xD SD/MMC card interface driver"); |
| 2131 | MODULE_VERSION(DRIVER_VERSION); | 2133 | MODULE_VERSION(DRIVER_VERSION); |
| 2132 | 2134 | ||
diff --git a/drivers/mtd/maps/bast-flash.c b/drivers/mtd/maps/bast-flash.c index b7858eb93534..51f962dd7e31 100644 --- a/drivers/mtd/maps/bast-flash.c +++ b/drivers/mtd/maps/bast-flash.c | |||
| @@ -63,11 +63,6 @@ struct bast_flash_info { | |||
| 63 | 63 | ||
| 64 | static const char *probes[] = { "RedBoot", "cmdlinepart", NULL }; | 64 | static const char *probes[] = { "RedBoot", "cmdlinepart", NULL }; |
| 65 | 65 | ||
| 66 | static struct bast_flash_info *to_bast_info(struct device *dev) | ||
| 67 | { | ||
| 68 | return (struct bast_flash_info *)dev_get_drvdata(dev); | ||
| 69 | } | ||
| 70 | |||
| 71 | static void bast_flash_setrw(int to) | 66 | static void bast_flash_setrw(int to) |
| 72 | { | 67 | { |
| 73 | unsigned int val; | 68 | unsigned int val; |
| @@ -87,11 +82,11 @@ static void bast_flash_setrw(int to) | |||
| 87 | local_irq_restore(flags); | 82 | local_irq_restore(flags); |
| 88 | } | 83 | } |
| 89 | 84 | ||
| 90 | static int bast_flash_remove(struct device *dev) | 85 | static int bast_flash_remove(struct platform_device *pdev) |
| 91 | { | 86 | { |
| 92 | struct bast_flash_info *info = to_bast_info(dev); | 87 | struct bast_flash_info *info = platform_get_drvdata(pdev); |
| 93 | 88 | ||
| 94 | dev_set_drvdata(dev, NULL); | 89 | platform_set_drvdata(pdev, NULL); |
| 95 | 90 | ||
| 96 | if (info == NULL) | 91 | if (info == NULL) |
| 97 | return 0; | 92 | return 0; |
| @@ -116,9 +111,8 @@ static int bast_flash_remove(struct device *dev) | |||
| 116 | return 0; | 111 | return 0; |
| 117 | } | 112 | } |
| 118 | 113 | ||
| 119 | static int bast_flash_probe(struct device *dev) | 114 | static int bast_flash_probe(struct platform_device *pdev) |
| 120 | { | 115 | { |
| 121 | struct platform_device *pdev = to_platform_device(dev); | ||
| 122 | struct bast_flash_info *info; | 116 | struct bast_flash_info *info; |
| 123 | struct resource *res; | 117 | struct resource *res; |
| 124 | int err = 0; | 118 | int err = 0; |
| @@ -131,13 +125,13 @@ static int bast_flash_probe(struct device *dev) | |||
| 131 | } | 125 | } |
| 132 | 126 | ||
| 133 | memzero(info, sizeof(*info)); | 127 | memzero(info, sizeof(*info)); |
| 134 | dev_set_drvdata(dev, info); | 128 | platform_set_drvdata(pdev, info); |
| 135 | 129 | ||
| 136 | res = pdev->resource; /* assume that the flash has one resource */ | 130 | res = pdev->resource; /* assume that the flash has one resource */ |
| 137 | 131 | ||
| 138 | info->map.phys = res->start; | 132 | info->map.phys = res->start; |
| 139 | info->map.size = res->end - res->start + 1; | 133 | info->map.size = res->end - res->start + 1; |
| 140 | info->map.name = dev->bus_id; | 134 | info->map.name = pdev->dev.bus_id; |
| 141 | info->map.bankwidth = 2; | 135 | info->map.bankwidth = 2; |
| 142 | 136 | ||
| 143 | if (info->map.size > AREA_MAXSIZE) | 137 | if (info->map.size > AREA_MAXSIZE) |
| @@ -199,27 +193,28 @@ static int bast_flash_probe(struct device *dev) | |||
| 199 | /* fall through to exit error */ | 193 | /* fall through to exit error */ |
| 200 | 194 | ||
| 201 | exit_error: | 195 | exit_error: |
| 202 | bast_flash_remove(dev); | 196 | bast_flash_remove(pdev); |
| 203 | return err; | 197 | return err; |
| 204 | } | 198 | } |
| 205 | 199 | ||
| 206 | static struct device_driver bast_flash_driver = { | 200 | static struct platform_driver bast_flash_driver = { |
| 207 | .name = "bast-nor", | ||
| 208 | .owner = THIS_MODULE, | ||
| 209 | .bus = &platform_bus_type, | ||
| 210 | .probe = bast_flash_probe, | 201 | .probe = bast_flash_probe, |
| 211 | .remove = bast_flash_remove, | 202 | .remove = bast_flash_remove, |
| 203 | .driver = { | ||
| 204 | .name = "bast-nor", | ||
| 205 | .owner = THIS_MODULE, | ||
| 206 | }, | ||
| 212 | }; | 207 | }; |
| 213 | 208 | ||
| 214 | static int __init bast_flash_init(void) | 209 | static int __init bast_flash_init(void) |
| 215 | { | 210 | { |
| 216 | printk("BAST NOR-Flash Driver, (c) 2004 Simtec Electronics\n"); | 211 | printk("BAST NOR-Flash Driver, (c) 2004 Simtec Electronics\n"); |
| 217 | return driver_register(&bast_flash_driver); | 212 | return platform_driver_register(&bast_flash_driver); |
| 218 | } | 213 | } |
| 219 | 214 | ||
| 220 | static void __exit bast_flash_exit(void) | 215 | static void __exit bast_flash_exit(void) |
| 221 | { | 216 | { |
| 222 | driver_unregister(&bast_flash_driver); | 217 | platform_driver_unregister(&bast_flash_driver); |
| 223 | } | 218 | } |
| 224 | 219 | ||
| 225 | module_init(bast_flash_init); | 220 | module_init(bast_flash_init); |
diff --git a/drivers/mtd/maps/integrator-flash.c b/drivers/mtd/maps/integrator-flash.c index fe738fd8d6f8..a3ba52fbd868 100644 --- a/drivers/mtd/maps/integrator-flash.c +++ b/drivers/mtd/maps/integrator-flash.c | |||
| @@ -67,9 +67,8 @@ static void armflash_set_vpp(struct map_info *map, int on) | |||
| 67 | 67 | ||
| 68 | static const char *probes[] = { "cmdlinepart", "RedBoot", "afs", NULL }; | 68 | static const char *probes[] = { "cmdlinepart", "RedBoot", "afs", NULL }; |
| 69 | 69 | ||
| 70 | static int armflash_probe(struct device *_dev) | 70 | static int armflash_probe(struct platform_device *dev) |
| 71 | { | 71 | { |
| 72 | struct platform_device *dev = to_platform_device(_dev); | ||
| 73 | struct flash_platform_data *plat = dev->dev.platform_data; | 72 | struct flash_platform_data *plat = dev->dev.platform_data; |
| 74 | struct resource *res = dev->resource; | 73 | struct resource *res = dev->resource; |
| 75 | unsigned int size = res->end - res->start + 1; | 74 | unsigned int size = res->end - res->start + 1; |
| @@ -138,7 +137,7 @@ static int armflash_probe(struct device *_dev) | |||
| 138 | } | 137 | } |
| 139 | 138 | ||
| 140 | if (err == 0) | 139 | if (err == 0) |
| 141 | dev_set_drvdata(&dev->dev, info); | 140 | platform_set_drvdata(dev, info); |
| 142 | 141 | ||
| 143 | /* | 142 | /* |
| 144 | * If we got an error, free all resources. | 143 | * If we got an error, free all resources. |
| @@ -163,12 +162,11 @@ static int armflash_probe(struct device *_dev) | |||
| 163 | return err; | 162 | return err; |
| 164 | } | 163 | } |
| 165 | 164 | ||
| 166 | static int armflash_remove(struct device *_dev) | 165 | static int armflash_remove(struct platform_device *dev) |
| 167 | { | 166 | { |
| 168 | struct platform_device *dev = to_platform_device(_dev); | 167 | struct armflash_info *info = platform_get_drvdata(dev); |
| 169 | struct armflash_info *info = dev_get_drvdata(&dev->dev); | ||
| 170 | 168 | ||
| 171 | dev_set_drvdata(&dev->dev, NULL); | 169 | platform_set_drvdata(dev, NULL); |
| 172 | 170 | ||
| 173 | if (info) { | 171 | if (info) { |
| 174 | if (info->mtd) { | 172 | if (info->mtd) { |
| @@ -190,21 +188,22 @@ static int armflash_remove(struct device *_dev) | |||
| 190 | return 0; | 188 | return 0; |
| 191 | } | 189 | } |
| 192 | 190 | ||
| 193 | static struct device_driver armflash_driver = { | 191 | static struct platform_driver armflash_driver = { |
| 194 | .name = "armflash", | ||
| 195 | .bus = &platform_bus_type, | ||
| 196 | .probe = armflash_probe, | 192 | .probe = armflash_probe, |
| 197 | .remove = armflash_remove, | 193 | .remove = armflash_remove, |
| 194 | .driver = { | ||
| 195 | .name = "armflash", | ||
| 196 | }, | ||
| 198 | }; | 197 | }; |
| 199 | 198 | ||
| 200 | static int __init armflash_init(void) | 199 | static int __init armflash_init(void) |
| 201 | { | 200 | { |
| 202 | return driver_register(&armflash_driver); | 201 | return platform_driver_register(&armflash_driver); |
| 203 | } | 202 | } |
| 204 | 203 | ||
| 205 | static void __exit armflash_exit(void) | 204 | static void __exit armflash_exit(void) |
| 206 | { | 205 | { |
| 207 | driver_unregister(&armflash_driver); | 206 | platform_driver_unregister(&armflash_driver); |
| 208 | } | 207 | } |
| 209 | 208 | ||
| 210 | module_init(armflash_init); | 209 | module_init(armflash_init); |
diff --git a/drivers/mtd/maps/ixp2000.c b/drivers/mtd/maps/ixp2000.c index 641eb2b55e9f..fc7a78e31735 100644 --- a/drivers/mtd/maps/ixp2000.c +++ b/drivers/mtd/maps/ixp2000.c | |||
| @@ -111,13 +111,12 @@ static void ixp2000_flash_copy_to(struct map_info *map, unsigned long to, | |||
| 111 | } | 111 | } |
| 112 | 112 | ||
| 113 | 113 | ||
| 114 | static int ixp2000_flash_remove(struct device *_dev) | 114 | static int ixp2000_flash_remove(struct platform_device *dev) |
| 115 | { | 115 | { |
| 116 | struct platform_device *dev = to_platform_device(_dev); | ||
| 117 | struct flash_platform_data *plat = dev->dev.platform_data; | 116 | struct flash_platform_data *plat = dev->dev.platform_data; |
| 118 | struct ixp2000_flash_info *info = dev_get_drvdata(&dev->dev); | 117 | struct ixp2000_flash_info *info = platform_get_drvdata(dev); |
| 119 | 118 | ||
| 120 | dev_set_drvdata(&dev->dev, NULL); | 119 | platform_set_drvdata(dev, NULL); |
| 121 | 120 | ||
| 122 | if(!info) | 121 | if(!info) |
| 123 | return 0; | 122 | return 0; |
| @@ -143,10 +142,9 @@ static int ixp2000_flash_remove(struct device *_dev) | |||
| 143 | } | 142 | } |
| 144 | 143 | ||
| 145 | 144 | ||
| 146 | static int ixp2000_flash_probe(struct device *_dev) | 145 | static int ixp2000_flash_probe(struct platform_device *dev) |
| 147 | { | 146 | { |
| 148 | static const char *probes[] = { "RedBoot", "cmdlinepart", NULL }; | 147 | static const char *probes[] = { "RedBoot", "cmdlinepart", NULL }; |
| 149 | struct platform_device *dev = to_platform_device(_dev); | ||
| 150 | struct ixp2000_flash_data *ixp_data = dev->dev.platform_data; | 148 | struct ixp2000_flash_data *ixp_data = dev->dev.platform_data; |
| 151 | struct flash_platform_data *plat; | 149 | struct flash_platform_data *plat; |
| 152 | struct ixp2000_flash_info *info; | 150 | struct ixp2000_flash_info *info; |
| @@ -177,7 +175,7 @@ static int ixp2000_flash_probe(struct device *_dev) | |||
| 177 | } | 175 | } |
| 178 | memzero(info, sizeof(struct ixp2000_flash_info)); | 176 | memzero(info, sizeof(struct ixp2000_flash_info)); |
| 179 | 177 | ||
| 180 | dev_set_drvdata(&dev->dev, info); | 178 | platform_set_drvdata(dev, info); |
| 181 | 179 | ||
| 182 | /* | 180 | /* |
| 183 | * Tell the MTD layer we're not 1:1 mapped so that it does | 181 | * Tell the MTD layer we're not 1:1 mapped so that it does |
| @@ -248,25 +246,26 @@ static int ixp2000_flash_probe(struct device *_dev) | |||
| 248 | return 0; | 246 | return 0; |
| 249 | 247 | ||
| 250 | Error: | 248 | Error: |
| 251 | ixp2000_flash_remove(_dev); | 249 | ixp2000_flash_remove(dev); |
| 252 | return err; | 250 | return err; |
| 253 | } | 251 | } |
| 254 | 252 | ||
| 255 | static struct device_driver ixp2000_flash_driver = { | 253 | static struct platform_driver ixp2000_flash_driver = { |
| 256 | .name = "IXP2000-Flash", | ||
| 257 | .bus = &platform_bus_type, | ||
| 258 | .probe = &ixp2000_flash_probe, | 254 | .probe = &ixp2000_flash_probe, |
| 259 | .remove = &ixp2000_flash_remove | 255 | .remove = &ixp2000_flash_remove |
| 256 | .driver = { | ||
| 257 | .name = "IXP2000-Flash", | ||
| 258 | }, | ||
| 260 | }; | 259 | }; |
| 261 | 260 | ||
| 262 | static int __init ixp2000_flash_init(void) | 261 | static int __init ixp2000_flash_init(void) |
| 263 | { | 262 | { |
| 264 | return driver_register(&ixp2000_flash_driver); | 263 | return platform_driver_register(&ixp2000_flash_driver); |
| 265 | } | 264 | } |
| 266 | 265 | ||
| 267 | static void __exit ixp2000_flash_exit(void) | 266 | static void __exit ixp2000_flash_exit(void) |
| 268 | { | 267 | { |
| 269 | driver_unregister(&ixp2000_flash_driver); | 268 | platform_driver_unregister(&ixp2000_flash_driver); |
| 270 | } | 269 | } |
| 271 | 270 | ||
| 272 | module_init(ixp2000_flash_init); | 271 | module_init(ixp2000_flash_init); |
diff --git a/drivers/mtd/maps/ixp4xx.c b/drivers/mtd/maps/ixp4xx.c index 56b3a355bf7b..a59f8027903c 100644 --- a/drivers/mtd/maps/ixp4xx.c +++ b/drivers/mtd/maps/ixp4xx.c | |||
| @@ -99,13 +99,12 @@ struct ixp4xx_flash_info { | |||
| 99 | 99 | ||
| 100 | static const char *probes[] = { "RedBoot", "cmdlinepart", NULL }; | 100 | static const char *probes[] = { "RedBoot", "cmdlinepart", NULL }; |
| 101 | 101 | ||
| 102 | static int ixp4xx_flash_remove(struct device *_dev) | 102 | static int ixp4xx_flash_remove(struct platform_device *dev) |
| 103 | { | 103 | { |
| 104 | struct platform_device *dev = to_platform_device(_dev); | ||
| 105 | struct flash_platform_data *plat = dev->dev.platform_data; | 104 | struct flash_platform_data *plat = dev->dev.platform_data; |
| 106 | struct ixp4xx_flash_info *info = dev_get_drvdata(&dev->dev); | 105 | struct ixp4xx_flash_info *info = platform_get_drvdata(dev); |
| 107 | 106 | ||
| 108 | dev_set_drvdata(&dev->dev, NULL); | 107 | platform_set_drvdata(dev, NULL); |
| 109 | 108 | ||
| 110 | if(!info) | 109 | if(!info) |
| 111 | return 0; | 110 | return 0; |
| @@ -130,9 +129,8 @@ static int ixp4xx_flash_remove(struct device *_dev) | |||
| 130 | return 0; | 129 | return 0; |
| 131 | } | 130 | } |
| 132 | 131 | ||
| 133 | static int ixp4xx_flash_probe(struct device *_dev) | 132 | static int ixp4xx_flash_probe(struct platform_device *dev) |
| 134 | { | 133 | { |
| 135 | struct platform_device *dev = to_platform_device(_dev); | ||
| 136 | struct flash_platform_data *plat = dev->dev.platform_data; | 134 | struct flash_platform_data *plat = dev->dev.platform_data; |
| 137 | struct ixp4xx_flash_info *info; | 135 | struct ixp4xx_flash_info *info; |
| 138 | int err = -1; | 136 | int err = -1; |
| @@ -153,7 +151,7 @@ static int ixp4xx_flash_probe(struct device *_dev) | |||
| 153 | } | 151 | } |
| 154 | memzero(info, sizeof(struct ixp4xx_flash_info)); | 152 | memzero(info, sizeof(struct ixp4xx_flash_info)); |
| 155 | 153 | ||
| 156 | dev_set_drvdata(&dev->dev, info); | 154 | platform_set_drvdata(dev, info); |
| 157 | 155 | ||
| 158 | /* | 156 | /* |
| 159 | * Tell the MTD layer we're not 1:1 mapped so that it does | 157 | * Tell the MTD layer we're not 1:1 mapped so that it does |
| @@ -214,25 +212,26 @@ static int ixp4xx_flash_probe(struct device *_dev) | |||
| 214 | return 0; | 212 | return 0; |
| 215 | 213 | ||
| 216 | Error: | 214 | Error: |
| 217 | ixp4xx_flash_remove(_dev); | 215 | ixp4xx_flash_remove(dev); |
| 218 | return err; | 216 | return err; |
| 219 | } | 217 | } |
| 220 | 218 | ||
| 221 | static struct device_driver ixp4xx_flash_driver = { | 219 | static struct platform_driver ixp4xx_flash_driver = { |
| 222 | .name = "IXP4XX-Flash", | ||
| 223 | .bus = &platform_bus_type, | ||
| 224 | .probe = ixp4xx_flash_probe, | 220 | .probe = ixp4xx_flash_probe, |
| 225 | .remove = ixp4xx_flash_remove, | 221 | .remove = ixp4xx_flash_remove, |
| 222 | .driver = { | ||
| 223 | .name = "IXP4XX-Flash", | ||
| 224 | }, | ||
| 226 | }; | 225 | }; |
| 227 | 226 | ||
| 228 | static int __init ixp4xx_flash_init(void) | 227 | static int __init ixp4xx_flash_init(void) |
| 229 | { | 228 | { |
| 230 | return driver_register(&ixp4xx_flash_driver); | 229 | return platform_driver_register(&ixp4xx_flash_driver); |
| 231 | } | 230 | } |
| 232 | 231 | ||
| 233 | static void __exit ixp4xx_flash_exit(void) | 232 | static void __exit ixp4xx_flash_exit(void) |
| 234 | { | 233 | { |
| 235 | driver_unregister(&ixp4xx_flash_driver); | 234 | platform_driver_unregister(&ixp4xx_flash_driver); |
| 236 | } | 235 | } |
| 237 | 236 | ||
| 238 | 237 | ||
diff --git a/drivers/mtd/maps/omap_nor.c b/drivers/mtd/maps/omap_nor.c index fd3b4a5fc207..418afffb2d80 100644 --- a/drivers/mtd/maps/omap_nor.c +++ b/drivers/mtd/maps/omap_nor.c | |||
| @@ -70,11 +70,10 @@ static void omap_set_vpp(struct map_info *map, int enable) | |||
| 70 | } | 70 | } |
| 71 | } | 71 | } |
| 72 | 72 | ||
| 73 | static int __devinit omapflash_probe(struct device *dev) | 73 | static int __devinit omapflash_probe(struct platform_device *pdev) |
| 74 | { | 74 | { |
| 75 | int err; | 75 | int err; |
| 76 | struct omapflash_info *info; | 76 | struct omapflash_info *info; |
| 77 | struct platform_device *pdev = to_platform_device(dev); | ||
| 78 | struct flash_platform_data *pdata = pdev->dev.platform_data; | 77 | struct flash_platform_data *pdata = pdev->dev.platform_data; |
| 79 | struct resource *res = pdev->resource; | 78 | struct resource *res = pdev->resource; |
| 80 | unsigned long size = res->end - res->start + 1; | 79 | unsigned long size = res->end - res->start + 1; |
| @@ -119,7 +118,7 @@ static int __devinit omapflash_probe(struct device *dev) | |||
| 119 | #endif | 118 | #endif |
| 120 | add_mtd_device(info->mtd); | 119 | add_mtd_device(info->mtd); |
| 121 | 120 | ||
| 122 | dev_set_drvdata(&pdev->dev, info); | 121 | platform_set_drvdata(pdev, info); |
| 123 | 122 | ||
| 124 | return 0; | 123 | return 0; |
| 125 | 124 | ||
| @@ -133,12 +132,11 @@ out_free_info: | |||
| 133 | return err; | 132 | return err; |
| 134 | } | 133 | } |
| 135 | 134 | ||
| 136 | static int __devexit omapflash_remove(struct device *dev) | 135 | static int __devexit omapflash_remove(struct platform_device *pdev) |
| 137 | { | 136 | { |
| 138 | struct platform_device *pdev = to_platform_device(dev); | 137 | struct omapflash_info *info = platform_get_drvdata(pdev); |
| 139 | struct omapflash_info *info = dev_get_drvdata(&pdev->dev); | ||
| 140 | 138 | ||
| 141 | dev_set_drvdata(&pdev->dev, NULL); | 139 | platform_set_drvdata(pdev, NULL); |
| 142 | 140 | ||
| 143 | if (info) { | 141 | if (info) { |
| 144 | if (info->parts) { | 142 | if (info->parts) { |
| @@ -155,21 +153,22 @@ static int __devexit omapflash_remove(struct device *dev) | |||
| 155 | return 0; | 153 | return 0; |
| 156 | } | 154 | } |
| 157 | 155 | ||
| 158 | static struct device_driver omapflash_driver = { | 156 | static struct platform_driver omapflash_driver = { |
| 159 | .name = "omapflash", | ||
| 160 | .bus = &platform_bus_type, | ||
| 161 | .probe = omapflash_probe, | 157 | .probe = omapflash_probe, |
| 162 | .remove = __devexit_p(omapflash_remove), | 158 | .remove = __devexit_p(omapflash_remove), |
| 159 | .driver = { | ||
| 160 | .name = "omapflash", | ||
| 161 | }, | ||
| 163 | }; | 162 | }; |
| 164 | 163 | ||
| 165 | static int __init omapflash_init(void) | 164 | static int __init omapflash_init(void) |
| 166 | { | 165 | { |
| 167 | return driver_register(&omapflash_driver); | 166 | return platform_driver_register(&omapflash_driver); |
| 168 | } | 167 | } |
| 169 | 168 | ||
| 170 | static void __exit omapflash_exit(void) | 169 | static void __exit omapflash_exit(void) |
| 171 | { | 170 | { |
| 172 | driver_unregister(&omapflash_driver); | 171 | platform_driver_unregister(&omapflash_driver); |
| 173 | } | 172 | } |
| 174 | 173 | ||
| 175 | module_init(omapflash_init); | 174 | module_init(omapflash_init); |
diff --git a/drivers/mtd/maps/plat-ram.c b/drivers/mtd/maps/plat-ram.c index a02eed94a231..5d3c75451ca2 100644 --- a/drivers/mtd/maps/plat-ram.c +++ b/drivers/mtd/maps/plat-ram.c | |||
| @@ -56,9 +56,9 @@ struct platram_info { | |||
| 56 | * device private data to struct platram_info conversion | 56 | * device private data to struct platram_info conversion |
| 57 | */ | 57 | */ |
| 58 | 58 | ||
| 59 | static inline struct platram_info *to_platram_info(struct device *dev) | 59 | static inline struct platram_info *to_platram_info(struct platform_device *dev) |
| 60 | { | 60 | { |
| 61 | return (struct platram_info *)dev_get_drvdata(dev); | 61 | return (struct platram_info *)platform_get_drvdata(dev); |
| 62 | } | 62 | } |
| 63 | 63 | ||
| 64 | /* platram_setrw | 64 | /* platram_setrw |
| @@ -83,13 +83,13 @@ static inline void platram_setrw(struct platram_info *info, int to) | |||
| 83 | * called to remove the device from the driver's control | 83 | * called to remove the device from the driver's control |
| 84 | */ | 84 | */ |
| 85 | 85 | ||
| 86 | static int platram_remove(struct device *dev) | 86 | static int platram_remove(struct platform_device *pdev) |
| 87 | { | 87 | { |
| 88 | struct platram_info *info = to_platram_info(dev); | 88 | struct platram_info *info = to_platram_info(pdev); |
| 89 | 89 | ||
| 90 | dev_set_drvdata(dev, NULL); | 90 | platform_set_drvdata(pdev, NULL); |
| 91 | 91 | ||
| 92 | dev_dbg(dev, "removing device\n"); | 92 | dev_dbg(&pdev->dev, "removing device\n"); |
| 93 | 93 | ||
| 94 | if (info == NULL) | 94 | if (info == NULL) |
| 95 | return 0; | 95 | return 0; |
| @@ -130,61 +130,60 @@ static int platram_remove(struct device *dev) | |||
| 130 | * driver is found. | 130 | * driver is found. |
| 131 | */ | 131 | */ |
| 132 | 132 | ||
| 133 | static int platram_probe(struct device *dev) | 133 | static int platram_probe(struct platform_device *pdev) |
| 134 | { | 134 | { |
| 135 | struct platform_device *pd = to_platform_device(dev); | ||
| 136 | struct platdata_mtd_ram *pdata; | 135 | struct platdata_mtd_ram *pdata; |
| 137 | struct platram_info *info; | 136 | struct platram_info *info; |
| 138 | struct resource *res; | 137 | struct resource *res; |
| 139 | int err = 0; | 138 | int err = 0; |
| 140 | 139 | ||
| 141 | dev_dbg(dev, "probe entered\n"); | 140 | dev_dbg(&pdev->dev, "probe entered\n"); |
| 142 | 141 | ||
| 143 | if (dev->platform_data == NULL) { | 142 | if (pdev->dev.platform_data == NULL) { |
| 144 | dev_err(dev, "no platform data supplied\n"); | 143 | dev_err(&pdev->dev, "no platform data supplied\n"); |
| 145 | err = -ENOENT; | 144 | err = -ENOENT; |
| 146 | goto exit_error; | 145 | goto exit_error; |
| 147 | } | 146 | } |
| 148 | 147 | ||
| 149 | pdata = dev->platform_data; | 148 | pdata = pdev->dev.platform_data; |
| 150 | 149 | ||
| 151 | info = kmalloc(sizeof(*info), GFP_KERNEL); | 150 | info = kmalloc(sizeof(*info), GFP_KERNEL); |
| 152 | if (info == NULL) { | 151 | if (info == NULL) { |
| 153 | dev_err(dev, "no memory for flash info\n"); | 152 | dev_err(&pdev->dev, "no memory for flash info\n"); |
| 154 | err = -ENOMEM; | 153 | err = -ENOMEM; |
| 155 | goto exit_error; | 154 | goto exit_error; |
| 156 | } | 155 | } |
| 157 | 156 | ||
| 158 | memset(info, 0, sizeof(*info)); | 157 | memset(info, 0, sizeof(*info)); |
| 159 | dev_set_drvdata(dev, info); | 158 | platform_set_drvdata(pdev, info); |
| 160 | 159 | ||
| 161 | info->dev = dev; | 160 | info->dev = &pdev->dev; |
| 162 | info->pdata = pdata; | 161 | info->pdata = pdata; |
| 163 | 162 | ||
| 164 | /* get the resource for the memory mapping */ | 163 | /* get the resource for the memory mapping */ |
| 165 | 164 | ||
| 166 | res = platform_get_resource(pd, IORESOURCE_MEM, 0); | 165 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
| 167 | 166 | ||
| 168 | if (res == NULL) { | 167 | if (res == NULL) { |
| 169 | dev_err(dev, "no memory resource specified\n"); | 168 | dev_err(&pdev->dev, "no memory resource specified\n"); |
| 170 | err = -ENOENT; | 169 | err = -ENOENT; |
| 171 | goto exit_free; | 170 | goto exit_free; |
| 172 | } | 171 | } |
| 173 | 172 | ||
| 174 | dev_dbg(dev, "got platform resource %p (0x%lx)\n", res, res->start); | 173 | dev_dbg(&pdev->dev, "got platform resource %p (0x%lx)\n", res, res->start); |
| 175 | 174 | ||
| 176 | /* setup map parameters */ | 175 | /* setup map parameters */ |
| 177 | 176 | ||
| 178 | info->map.phys = res->start; | 177 | info->map.phys = res->start; |
| 179 | info->map.size = (res->end - res->start) + 1; | 178 | info->map.size = (res->end - res->start) + 1; |
| 180 | info->map.name = pdata->mapname != NULL ? pdata->mapname : (char *)pd->name; | 179 | info->map.name = pdata->mapname != NULL ? pdata->mapname : (char *)pdev->name; |
| 181 | info->map.bankwidth = pdata->bankwidth; | 180 | info->map.bankwidth = pdata->bankwidth; |
| 182 | 181 | ||
| 183 | /* register our usage of the memory area */ | 182 | /* register our usage of the memory area */ |
| 184 | 183 | ||
| 185 | info->area = request_mem_region(res->start, info->map.size, pd->name); | 184 | info->area = request_mem_region(res->start, info->map.size, pdev->name); |
| 186 | if (info->area == NULL) { | 185 | if (info->area == NULL) { |
| 187 | dev_err(dev, "failed to request memory region\n"); | 186 | dev_err(&pdev->dev, "failed to request memory region\n"); |
| 188 | err = -EIO; | 187 | err = -EIO; |
| 189 | goto exit_free; | 188 | goto exit_free; |
| 190 | } | 189 | } |
| @@ -192,23 +191,23 @@ static int platram_probe(struct device *dev) | |||
| 192 | /* remap the memory area */ | 191 | /* remap the memory area */ |
| 193 | 192 | ||
| 194 | info->map.virt = ioremap(res->start, info->map.size); | 193 | info->map.virt = ioremap(res->start, info->map.size); |
| 195 | dev_dbg(dev, "virt %p, %lu bytes\n", info->map.virt, info->map.size); | 194 | dev_dbg(&pdev->dev, "virt %p, %lu bytes\n", info->map.virt, info->map.size); |
| 196 | 195 | ||
| 197 | if (info->map.virt == NULL) { | 196 | if (info->map.virt == NULL) { |
| 198 | dev_err(dev, "failed to ioremap() region\n"); | 197 | dev_err(&pdev->dev, "failed to ioremap() region\n"); |
| 199 | err = -EIO; | 198 | err = -EIO; |
| 200 | goto exit_free; | 199 | goto exit_free; |
| 201 | } | 200 | } |
| 202 | 201 | ||
| 203 | simple_map_init(&info->map); | 202 | simple_map_init(&info->map); |
| 204 | 203 | ||
| 205 | dev_dbg(dev, "initialised map, probing for mtd\n"); | 204 | dev_dbg(&pdev->dev, "initialised map, probing for mtd\n"); |
| 206 | 205 | ||
| 207 | /* probe for the right mtd map driver */ | 206 | /* probe for the right mtd map driver */ |
| 208 | 207 | ||
| 209 | info->mtd = do_map_probe("map_ram" , &info->map); | 208 | info->mtd = do_map_probe("map_ram" , &info->map); |
| 210 | if (info->mtd == NULL) { | 209 | if (info->mtd == NULL) { |
| 211 | dev_err(dev, "failed to probe for map_ram\n"); | 210 | dev_err(&pdev->dev, "failed to probe for map_ram\n"); |
| 212 | err = -ENOMEM; | 211 | err = -ENOMEM; |
| 213 | goto exit_free; | 212 | goto exit_free; |
| 214 | } | 213 | } |
| @@ -237,27 +236,28 @@ static int platram_probe(struct device *dev) | |||
| 237 | #endif /* CONFIG_MTD_PARTITIONS */ | 236 | #endif /* CONFIG_MTD_PARTITIONS */ |
| 238 | 237 | ||
| 239 | if (add_mtd_device(info->mtd)) { | 238 | if (add_mtd_device(info->mtd)) { |
| 240 | dev_err(dev, "add_mtd_device() failed\n"); | 239 | dev_err(&pdev->dev, "add_mtd_device() failed\n"); |
| 241 | err = -ENOMEM; | 240 | err = -ENOMEM; |
| 242 | } | 241 | } |
| 243 | 242 | ||
| 244 | dev_info(dev, "registered mtd device\n"); | 243 | dev_info(&pdev->dev, "registered mtd device\n"); |
| 245 | return err; | 244 | return err; |
| 246 | 245 | ||
| 247 | exit_free: | 246 | exit_free: |
| 248 | platram_remove(dev); | 247 | platram_remove(pdev); |
| 249 | exit_error: | 248 | exit_error: |
| 250 | return err; | 249 | return err; |
| 251 | } | 250 | } |
| 252 | 251 | ||
| 253 | /* device driver info */ | 252 | /* device driver info */ |
| 254 | 253 | ||
| 255 | static struct device_driver platram_driver = { | 254 | static struct platform_driver platram_driver = { |
| 256 | .name = "mtd-ram", | ||
| 257 | .owner = THIS_MODULE, | ||
| 258 | .bus = &platform_bus_type, | ||
| 259 | .probe = platram_probe, | 255 | .probe = platram_probe, |
| 260 | .remove = platram_remove, | 256 | .remove = platram_remove, |
| 257 | .driver = { | ||
| 258 | .name = "mtd-ram", | ||
| 259 | .owner = THIS_MODULE, | ||
| 260 | }, | ||
| 261 | }; | 261 | }; |
| 262 | 262 | ||
| 263 | /* module init/exit */ | 263 | /* module init/exit */ |
| @@ -265,12 +265,12 @@ static struct device_driver platram_driver = { | |||
| 265 | static int __init platram_init(void) | 265 | static int __init platram_init(void) |
| 266 | { | 266 | { |
| 267 | printk("Generic platform RAM MTD, (c) 2004 Simtec Electronics\n"); | 267 | printk("Generic platform RAM MTD, (c) 2004 Simtec Electronics\n"); |
| 268 | return driver_register(&platram_driver); | 268 | return platform_driver_register(&platram_driver); |
| 269 | } | 269 | } |
| 270 | 270 | ||
| 271 | static void __exit platram_exit(void) | 271 | static void __exit platram_exit(void) |
| 272 | { | 272 | { |
| 273 | driver_unregister(&platram_driver); | 273 | platform_driver_unregister(&platram_driver); |
| 274 | } | 274 | } |
| 275 | 275 | ||
| 276 | module_init(platram_init); | 276 | module_init(platram_init); |
diff --git a/drivers/mtd/maps/sa1100-flash.c b/drivers/mtd/maps/sa1100-flash.c index 9e8bb1782be0..5cefb015633c 100644 --- a/drivers/mtd/maps/sa1100-flash.c +++ b/drivers/mtd/maps/sa1100-flash.c | |||
| @@ -356,9 +356,8 @@ sa1100_setup_mtd(struct platform_device *pdev, struct flash_platform_data *plat) | |||
| 356 | 356 | ||
| 357 | static const char *part_probes[] = { "cmdlinepart", "RedBoot", NULL }; | 357 | static const char *part_probes[] = { "cmdlinepart", "RedBoot", NULL }; |
| 358 | 358 | ||
| 359 | static int __init sa1100_mtd_probe(struct device *dev) | 359 | static int __init sa1100_mtd_probe(struct platform_device *pdev) |
| 360 | { | 360 | { |
| 361 | struct platform_device *pdev = to_platform_device(dev); | ||
| 362 | struct flash_platform_data *plat = pdev->dev.platform_data; | 361 | struct flash_platform_data *plat = pdev->dev.platform_data; |
| 363 | struct mtd_partition *parts; | 362 | struct mtd_partition *parts; |
| 364 | const char *part_type = NULL; | 363 | const char *part_type = NULL; |
| @@ -402,28 +401,28 @@ static int __init sa1100_mtd_probe(struct device *dev) | |||
| 402 | 401 | ||
| 403 | info->nr_parts = nr_parts; | 402 | info->nr_parts = nr_parts; |
| 404 | 403 | ||
| 405 | dev_set_drvdata(dev, info); | 404 | platform_set_drvdata(pdev, info); |
| 406 | err = 0; | 405 | err = 0; |
| 407 | 406 | ||
| 408 | out: | 407 | out: |
| 409 | return err; | 408 | return err; |
| 410 | } | 409 | } |
| 411 | 410 | ||
| 412 | static int __exit sa1100_mtd_remove(struct device *dev) | 411 | static int __exit sa1100_mtd_remove(struct platform_device *pdev) |
| 413 | { | 412 | { |
| 414 | struct sa_info *info = dev_get_drvdata(dev); | 413 | struct sa_info *info = platform_get_drvdata(pdev); |
| 415 | struct flash_platform_data *plat = dev->platform_data; | 414 | struct flash_platform_data *plat = pdev->dev.platform_data; |
| 416 | 415 | ||
| 417 | dev_set_drvdata(dev, NULL); | 416 | platform_set_drvdata(pdev, NULL); |
| 418 | sa1100_destroy(info, plat); | 417 | sa1100_destroy(info, plat); |
| 419 | 418 | ||
| 420 | return 0; | 419 | return 0; |
| 421 | } | 420 | } |
| 422 | 421 | ||
| 423 | #ifdef CONFIG_PM | 422 | #ifdef CONFIG_PM |
| 424 | static int sa1100_mtd_suspend(struct device *dev, pm_message_t state) | 423 | static int sa1100_mtd_suspend(struct platform_device *dev, pm_message_t state) |
| 425 | { | 424 | { |
| 426 | struct sa_info *info = dev_get_drvdata(dev); | 425 | struct sa_info *info = platform_get_drvdata(dev); |
| 427 | int ret = 0; | 426 | int ret = 0; |
| 428 | 427 | ||
| 429 | if (info) | 428 | if (info) |
| @@ -432,17 +431,17 @@ static int sa1100_mtd_suspend(struct device *dev, pm_message_t state) | |||
| 432 | return ret; | 431 | return ret; |
| 433 | } | 432 | } |
| 434 | 433 | ||
| 435 | static int sa1100_mtd_resume(struct device *dev) | 434 | static int sa1100_mtd_resume(struct platform_device *dev) |
| 436 | { | 435 | { |
| 437 | struct sa_info *info = dev_get_drvdata(dev); | 436 | struct sa_info *info = platform_get_drvdata(dev); |
| 438 | if (info) | 437 | if (info) |
| 439 | info->mtd->resume(info->mtd); | 438 | info->mtd->resume(info->mtd); |
| 440 | return 0; | 439 | return 0; |
| 441 | } | 440 | } |
| 442 | 441 | ||
| 443 | static void sa1100_mtd_shutdown(struct device *dev) | 442 | static void sa1100_mtd_shutdown(struct platform_device *dev) |
| 444 | { | 443 | { |
| 445 | struct sa_info *info = dev_get_drvdata(dev); | 444 | struct sa_info *info = platform_get_drvdata(dev); |
| 446 | if (info && info->mtd->suspend(info->mtd) == 0) | 445 | if (info && info->mtd->suspend(info->mtd) == 0) |
| 447 | info->mtd->resume(info->mtd); | 446 | info->mtd->resume(info->mtd); |
| 448 | } | 447 | } |
| @@ -452,24 +451,25 @@ static void sa1100_mtd_shutdown(struct device *dev) | |||
| 452 | #define sa1100_mtd_shutdown NULL | 451 | #define sa1100_mtd_shutdown NULL |
| 453 | #endif | 452 | #endif |
| 454 | 453 | ||
| 455 | static struct device_driver sa1100_mtd_driver = { | 454 | static struct platform_driver sa1100_mtd_driver = { |
| 456 | .name = "flash", | ||
| 457 | .bus = &platform_bus_type, | ||
| 458 | .probe = sa1100_mtd_probe, | 455 | .probe = sa1100_mtd_probe, |
| 459 | .remove = __exit_p(sa1100_mtd_remove), | 456 | .remove = __exit_p(sa1100_mtd_remove), |
| 460 | .suspend = sa1100_mtd_suspend, | 457 | .suspend = sa1100_mtd_suspend, |
| 461 | .resume = sa1100_mtd_resume, | 458 | .resume = sa1100_mtd_resume, |
| 462 | .shutdown = sa1100_mtd_shutdown, | 459 | .shutdown = sa1100_mtd_shutdown, |
| 460 | .driver = { | ||
| 461 | .name = "flash", | ||
| 462 | }, | ||
| 463 | }; | 463 | }; |
| 464 | 464 | ||
| 465 | static int __init sa1100_mtd_init(void) | 465 | static int __init sa1100_mtd_init(void) |
| 466 | { | 466 | { |
| 467 | return driver_register(&sa1100_mtd_driver); | 467 | return platform_driver_register(&sa1100_mtd_driver); |
| 468 | } | 468 | } |
| 469 | 469 | ||
| 470 | static void __exit sa1100_mtd_exit(void) | 470 | static void __exit sa1100_mtd_exit(void) |
| 471 | { | 471 | { |
| 472 | driver_unregister(&sa1100_mtd_driver); | 472 | platform_driver_unregister(&sa1100_mtd_driver); |
| 473 | } | 473 | } |
| 474 | 474 | ||
| 475 | module_init(sa1100_mtd_init); | 475 | module_init(sa1100_mtd_init); |
diff --git a/drivers/mtd/nand/s3c2410.c b/drivers/mtd/nand/s3c2410.c index 97e9b7892d29..d209214b1318 100644 --- a/drivers/mtd/nand/s3c2410.c +++ b/drivers/mtd/nand/s3c2410.c | |||
| @@ -125,14 +125,14 @@ static struct s3c2410_nand_info *s3c2410_nand_mtd_toinfo(struct mtd_info *mtd) | |||
| 125 | return s3c2410_nand_mtd_toours(mtd)->info; | 125 | return s3c2410_nand_mtd_toours(mtd)->info; |
| 126 | } | 126 | } |
| 127 | 127 | ||
| 128 | static struct s3c2410_nand_info *to_nand_info(struct device *dev) | 128 | static struct s3c2410_nand_info *to_nand_info(struct platform_device *dev) |
| 129 | { | 129 | { |
| 130 | return dev_get_drvdata(dev); | 130 | return platform_get_drvdata(dev); |
| 131 | } | 131 | } |
| 132 | 132 | ||
| 133 | static struct s3c2410_platform_nand *to_nand_plat(struct device *dev) | 133 | static struct s3c2410_platform_nand *to_nand_plat(struct platform_device *dev) |
| 134 | { | 134 | { |
| 135 | return dev->platform_data; | 135 | return dev->dev.platform_data; |
| 136 | } | 136 | } |
| 137 | 137 | ||
| 138 | /* timing calculations */ | 138 | /* timing calculations */ |
| @@ -165,9 +165,9 @@ static int s3c2410_nand_calc_rate(int wanted, unsigned long clk, int max) | |||
| 165 | /* controller setup */ | 165 | /* controller setup */ |
| 166 | 166 | ||
| 167 | static int s3c2410_nand_inithw(struct s3c2410_nand_info *info, | 167 | static int s3c2410_nand_inithw(struct s3c2410_nand_info *info, |
| 168 | struct device *dev) | 168 | struct platform_device *pdev) |
| 169 | { | 169 | { |
| 170 | struct s3c2410_platform_nand *plat = to_nand_plat(dev); | 170 | struct s3c2410_platform_nand *plat = to_nand_plat(pdev); |
| 171 | unsigned long clkrate = clk_get_rate(info->clk); | 171 | unsigned long clkrate = clk_get_rate(info->clk); |
| 172 | int tacls, twrph0, twrph1; | 172 | int tacls, twrph0, twrph1; |
| 173 | unsigned long cfg; | 173 | unsigned long cfg; |
| @@ -430,11 +430,11 @@ static void s3c2410_nand_write_buf(struct mtd_info *mtd, | |||
| 430 | 430 | ||
| 431 | /* device management functions */ | 431 | /* device management functions */ |
| 432 | 432 | ||
| 433 | static int s3c2410_nand_remove(struct device *dev) | 433 | static int s3c2410_nand_remove(struct platform_device *pdev) |
| 434 | { | 434 | { |
| 435 | struct s3c2410_nand_info *info = to_nand_info(dev); | 435 | struct s3c2410_nand_info *info = to_nand_info(pdev); |
| 436 | 436 | ||
| 437 | dev_set_drvdata(dev, NULL); | 437 | platform_set_drvdata(pdev, NULL); |
| 438 | 438 | ||
| 439 | if (info == NULL) | 439 | if (info == NULL) |
| 440 | return 0; | 440 | return 0; |
| @@ -562,10 +562,9 @@ static void s3c2410_nand_init_chip(struct s3c2410_nand_info *info, | |||
| 562 | * nand layer to look for devices | 562 | * nand layer to look for devices |
| 563 | */ | 563 | */ |
| 564 | 564 | ||
| 565 | static int s3c24xx_nand_probe(struct device *dev, int is_s3c2440) | 565 | static int s3c24xx_nand_probe(struct platform_device *pdev, int is_s3c2440) |
| 566 | { | 566 | { |
| 567 | struct platform_device *pdev = to_platform_device(dev); | 567 | struct s3c2410_platform_nand *plat = to_nand_plat(pdev); |
| 568 | struct s3c2410_platform_nand *plat = to_nand_plat(dev); | ||
| 569 | struct s3c2410_nand_info *info; | 568 | struct s3c2410_nand_info *info; |
| 570 | struct s3c2410_nand_mtd *nmtd; | 569 | struct s3c2410_nand_mtd *nmtd; |
| 571 | struct s3c2410_nand_set *sets; | 570 | struct s3c2410_nand_set *sets; |
| @@ -575,26 +574,26 @@ static int s3c24xx_nand_probe(struct device *dev, int is_s3c2440) | |||
| 575 | int nr_sets; | 574 | int nr_sets; |
| 576 | int setno; | 575 | int setno; |
| 577 | 576 | ||
| 578 | pr_debug("s3c2410_nand_probe(%p)\n", dev); | 577 | pr_debug("s3c2410_nand_probe(%p)\n", pdev); |
| 579 | 578 | ||
| 580 | info = kmalloc(sizeof(*info), GFP_KERNEL); | 579 | info = kmalloc(sizeof(*info), GFP_KERNEL); |
| 581 | if (info == NULL) { | 580 | if (info == NULL) { |
| 582 | dev_err(dev, "no memory for flash info\n"); | 581 | dev_err(&pdev->dev, "no memory for flash info\n"); |
| 583 | err = -ENOMEM; | 582 | err = -ENOMEM; |
| 584 | goto exit_error; | 583 | goto exit_error; |
| 585 | } | 584 | } |
| 586 | 585 | ||
| 587 | memzero(info, sizeof(*info)); | 586 | memzero(info, sizeof(*info)); |
| 588 | dev_set_drvdata(dev, info); | 587 | platform_set_drvdata(pdev, info); |
| 589 | 588 | ||
| 590 | spin_lock_init(&info->controller.lock); | 589 | spin_lock_init(&info->controller.lock); |
| 591 | init_waitqueue_head(&info->controller.wq); | 590 | init_waitqueue_head(&info->controller.wq); |
| 592 | 591 | ||
| 593 | /* get the clock source and enable it */ | 592 | /* get the clock source and enable it */ |
| 594 | 593 | ||
| 595 | info->clk = clk_get(dev, "nand"); | 594 | info->clk = clk_get(&pdev->dev, "nand"); |
| 596 | if (IS_ERR(info->clk)) { | 595 | if (IS_ERR(info->clk)) { |
| 597 | dev_err(dev, "failed to get clock"); | 596 | dev_err(&pdev->dev, "failed to get clock"); |
| 598 | err = -ENOENT; | 597 | err = -ENOENT; |
| 599 | goto exit_error; | 598 | goto exit_error; |
| 600 | } | 599 | } |
| @@ -611,27 +610,27 @@ static int s3c24xx_nand_probe(struct device *dev, int is_s3c2440) | |||
| 611 | info->area = request_mem_region(res->start, size, pdev->name); | 610 | info->area = request_mem_region(res->start, size, pdev->name); |
| 612 | 611 | ||
| 613 | if (info->area == NULL) { | 612 | if (info->area == NULL) { |
| 614 | dev_err(dev, "cannot reserve register region\n"); | 613 | dev_err(&pdev->dev, "cannot reserve register region\n"); |
| 615 | err = -ENOENT; | 614 | err = -ENOENT; |
| 616 | goto exit_error; | 615 | goto exit_error; |
| 617 | } | 616 | } |
| 618 | 617 | ||
| 619 | info->device = dev; | 618 | info->device = &pdev->dev; |
| 620 | info->platform = plat; | 619 | info->platform = plat; |
| 621 | info->regs = ioremap(res->start, size); | 620 | info->regs = ioremap(res->start, size); |
| 622 | info->is_s3c2440 = is_s3c2440; | 621 | info->is_s3c2440 = is_s3c2440; |
| 623 | 622 | ||
| 624 | if (info->regs == NULL) { | 623 | if (info->regs == NULL) { |
| 625 | dev_err(dev, "cannot reserve register region\n"); | 624 | dev_err(&pdev->dev, "cannot reserve register region\n"); |
| 626 | err = -EIO; | 625 | err = -EIO; |
| 627 | goto exit_error; | 626 | goto exit_error; |
| 628 | } | 627 | } |
| 629 | 628 | ||
| 630 | dev_dbg(dev, "mapped registers at %p\n", info->regs); | 629 | dev_dbg(&pdev->dev, "mapped registers at %p\n", info->regs); |
| 631 | 630 | ||
| 632 | /* initialise the hardware */ | 631 | /* initialise the hardware */ |
| 633 | 632 | ||
| 634 | err = s3c2410_nand_inithw(info, dev); | 633 | err = s3c2410_nand_inithw(info, pdev); |
| 635 | if (err != 0) | 634 | if (err != 0) |
| 636 | goto exit_error; | 635 | goto exit_error; |
| 637 | 636 | ||
| @@ -645,7 +644,7 @@ static int s3c24xx_nand_probe(struct device *dev, int is_s3c2440) | |||
| 645 | size = nr_sets * sizeof(*info->mtds); | 644 | size = nr_sets * sizeof(*info->mtds); |
| 646 | info->mtds = kmalloc(size, GFP_KERNEL); | 645 | info->mtds = kmalloc(size, GFP_KERNEL); |
| 647 | if (info->mtds == NULL) { | 646 | if (info->mtds == NULL) { |
| 648 | dev_err(dev, "failed to allocate mtd storage\n"); | 647 | dev_err(&pdev->dev, "failed to allocate mtd storage\n"); |
| 649 | err = -ENOMEM; | 648 | err = -ENOMEM; |
| 650 | goto exit_error; | 649 | goto exit_error; |
| 651 | } | 650 | } |
| @@ -677,7 +676,7 @@ static int s3c24xx_nand_probe(struct device *dev, int is_s3c2440) | |||
| 677 | return 0; | 676 | return 0; |
| 678 | 677 | ||
| 679 | exit_error: | 678 | exit_error: |
| 680 | s3c2410_nand_remove(dev); | 679 | s3c2410_nand_remove(pdev); |
| 681 | 680 | ||
| 682 | if (err == 0) | 681 | if (err == 0) |
| 683 | err = -EINVAL; | 682 | err = -EINVAL; |
| @@ -686,44 +685,46 @@ static int s3c24xx_nand_probe(struct device *dev, int is_s3c2440) | |||
| 686 | 685 | ||
| 687 | /* driver device registration */ | 686 | /* driver device registration */ |
| 688 | 687 | ||
| 689 | static int s3c2410_nand_probe(struct device *dev) | 688 | static int s3c2410_nand_probe(struct platform_device *dev) |
| 690 | { | 689 | { |
| 691 | return s3c24xx_nand_probe(dev, 0); | 690 | return s3c24xx_nand_probe(dev, 0); |
| 692 | } | 691 | } |
| 693 | 692 | ||
| 694 | static int s3c2440_nand_probe(struct device *dev) | 693 | static int s3c2440_nand_probe(struct platform_device *dev) |
| 695 | { | 694 | { |
| 696 | return s3c24xx_nand_probe(dev, 1); | 695 | return s3c24xx_nand_probe(dev, 1); |
| 697 | } | 696 | } |
| 698 | 697 | ||
| 699 | static struct device_driver s3c2410_nand_driver = { | 698 | static struct platform_driver s3c2410_nand_driver = { |
| 700 | .name = "s3c2410-nand", | ||
| 701 | .owner = THIS_MODULE, | ||
| 702 | .bus = &platform_bus_type, | ||
| 703 | .probe = s3c2410_nand_probe, | 699 | .probe = s3c2410_nand_probe, |
| 704 | .remove = s3c2410_nand_remove, | 700 | .remove = s3c2410_nand_remove, |
| 701 | .driver = { | ||
| 702 | .name = "s3c2410-nand", | ||
| 703 | .owner = THIS_MODULE, | ||
| 704 | }, | ||
| 705 | }; | 705 | }; |
| 706 | 706 | ||
| 707 | static struct device_driver s3c2440_nand_driver = { | 707 | static struct platform_driver s3c2440_nand_driver = { |
| 708 | .name = "s3c2440-nand", | ||
| 709 | .owner = THIS_MODULE, | ||
| 710 | .bus = &platform_bus_type, | ||
| 711 | .probe = s3c2440_nand_probe, | 708 | .probe = s3c2440_nand_probe, |
| 712 | .remove = s3c2410_nand_remove, | 709 | .remove = s3c2410_nand_remove, |
| 710 | .driver = { | ||
| 711 | .name = "s3c2440-nand", | ||
| 712 | .owner = THIS_MODULE, | ||
| 713 | }, | ||
| 713 | }; | 714 | }; |
| 714 | 715 | ||
| 715 | static int __init s3c2410_nand_init(void) | 716 | static int __init s3c2410_nand_init(void) |
| 716 | { | 717 | { |
| 717 | printk("S3C24XX NAND Driver, (c) 2004 Simtec Electronics\n"); | 718 | printk("S3C24XX NAND Driver, (c) 2004 Simtec Electronics\n"); |
| 718 | 719 | ||
| 719 | driver_register(&s3c2440_nand_driver); | 720 | platform_driver_register(&s3c2440_nand_driver); |
| 720 | return driver_register(&s3c2410_nand_driver); | 721 | return platform_driver_register(&s3c2410_nand_driver); |
| 721 | } | 722 | } |
| 722 | 723 | ||
| 723 | static void __exit s3c2410_nand_exit(void) | 724 | static void __exit s3c2410_nand_exit(void) |
| 724 | { | 725 | { |
| 725 | driver_unregister(&s3c2440_nand_driver); | 726 | platform_driver_unregister(&s3c2440_nand_driver); |
| 726 | driver_unregister(&s3c2410_nand_driver); | 727 | platform_driver_unregister(&s3c2410_nand_driver); |
| 727 | } | 728 | } |
| 728 | 729 | ||
| 729 | module_init(s3c2410_nand_init); | 730 | module_init(s3c2410_nand_init); |
diff --git a/drivers/net/depca.c b/drivers/net/depca.c index 0d33a93df96b..03804cc38be0 100644 --- a/drivers/net/depca.c +++ b/drivers/net/depca.c | |||
| @@ -398,13 +398,19 @@ static struct mca_driver depca_mca_driver = { | |||
| 398 | }; | 398 | }; |
| 399 | #endif | 399 | #endif |
| 400 | 400 | ||
| 401 | static int depca_isa_probe (struct device *); | 401 | static int depca_isa_probe (struct platform_device *); |
| 402 | 402 | ||
| 403 | static struct device_driver depca_isa_driver = { | 403 | static int __devexit depca_isa_remove(struct platform_device *pdev) |
| 404 | .name = depca_string, | 404 | { |
| 405 | .bus = &platform_bus_type, | 405 | return depca_device_remove(&pdev->dev); |
| 406 | } | ||
| 407 | |||
| 408 | static struct platform_driver depca_isa_driver = { | ||
| 406 | .probe = depca_isa_probe, | 409 | .probe = depca_isa_probe, |
| 407 | .remove = __devexit_p(depca_device_remove), | 410 | .remove = __devexit_p(depca_isa_remove), |
| 411 | .driver = { | ||
| 412 | .name = depca_string, | ||
| 413 | }, | ||
| 408 | }; | 414 | }; |
| 409 | 415 | ||
| 410 | /* | 416 | /* |
| @@ -1525,7 +1531,7 @@ static enum depca_type __init depca_shmem_probe (ulong *mem_start) | |||
| 1525 | return adapter; | 1531 | return adapter; |
| 1526 | } | 1532 | } |
| 1527 | 1533 | ||
| 1528 | static int __init depca_isa_probe (struct device *device) | 1534 | static int __init depca_isa_probe (struct platform_device *device) |
| 1529 | { | 1535 | { |
| 1530 | struct net_device *dev; | 1536 | struct net_device *dev; |
| 1531 | struct depca_private *lp; | 1537 | struct depca_private *lp; |
| @@ -1533,7 +1539,7 @@ static int __init depca_isa_probe (struct device *device) | |||
| 1533 | enum depca_type adapter = unknown; | 1539 | enum depca_type adapter = unknown; |
| 1534 | int status = 0; | 1540 | int status = 0; |
| 1535 | 1541 | ||
| 1536 | ioaddr = (u_long) device->platform_data; | 1542 | ioaddr = (u_long) device->dev.platform_data; |
| 1537 | 1543 | ||
| 1538 | if ((status = depca_common_init (ioaddr, &dev))) | 1544 | if ((status = depca_common_init (ioaddr, &dev))) |
| 1539 | goto out; | 1545 | goto out; |
| @@ -1553,7 +1559,7 @@ static int __init depca_isa_probe (struct device *device) | |||
| 1553 | lp->adapter = adapter; | 1559 | lp->adapter = adapter; |
| 1554 | lp->mem_start = mem_start; | 1560 | lp->mem_start = mem_start; |
| 1555 | 1561 | ||
| 1556 | if ((status = depca_hw_init(dev, device))) | 1562 | if ((status = depca_hw_init(dev, &device->dev))) |
| 1557 | goto out_free; | 1563 | goto out_free; |
| 1558 | 1564 | ||
| 1559 | return 0; | 1565 | return 0; |
| @@ -2082,7 +2088,7 @@ static int __init depca_module_init (void) | |||
| 2082 | #ifdef CONFIG_EISA | 2088 | #ifdef CONFIG_EISA |
| 2083 | err |= eisa_driver_register (&depca_eisa_driver); | 2089 | err |= eisa_driver_register (&depca_eisa_driver); |
| 2084 | #endif | 2090 | #endif |
| 2085 | err |= driver_register (&depca_isa_driver); | 2091 | err |= platform_driver_register (&depca_isa_driver); |
| 2086 | depca_platform_probe (); | 2092 | depca_platform_probe (); |
| 2087 | 2093 | ||
| 2088 | return err; | 2094 | return err; |
| @@ -2097,7 +2103,7 @@ static void __exit depca_module_exit (void) | |||
| 2097 | #ifdef CONFIG_EISA | 2103 | #ifdef CONFIG_EISA |
| 2098 | eisa_driver_unregister (&depca_eisa_driver); | 2104 | eisa_driver_unregister (&depca_eisa_driver); |
| 2099 | #endif | 2105 | #endif |
| 2100 | driver_unregister (&depca_isa_driver); | 2106 | platform_driver_unregister (&depca_isa_driver); |
| 2101 | 2107 | ||
| 2102 | for (i = 0; depca_io_ports[i].iobase; i++) { | 2108 | for (i = 0; depca_io_ports[i].iobase; i++) { |
| 2103 | if (depca_io_ports[i].device) { | 2109 | if (depca_io_ports[i].device) { |
diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c index f8c9bcdab68b..24996da4c1c4 100644 --- a/drivers/net/dm9000.c +++ b/drivers/net/dm9000.c | |||
| @@ -148,7 +148,7 @@ typedef struct board_info { | |||
| 148 | } board_info_t; | 148 | } board_info_t; |
| 149 | 149 | ||
| 150 | /* function declaration ------------------------------------- */ | 150 | /* function declaration ------------------------------------- */ |
| 151 | static int dm9000_probe(struct device *); | 151 | static int dm9000_probe(struct platform_device *); |
| 152 | static int dm9000_open(struct net_device *); | 152 | static int dm9000_open(struct net_device *); |
| 153 | static int dm9000_start_xmit(struct sk_buff *, struct net_device *); | 153 | static int dm9000_start_xmit(struct sk_buff *, struct net_device *); |
| 154 | static int dm9000_stop(struct net_device *); | 154 | static int dm9000_stop(struct net_device *); |
| @@ -378,9 +378,8 @@ dm9000_release_board(struct platform_device *pdev, struct board_info *db) | |||
| 378 | * Search DM9000 board, allocate space and register it | 378 | * Search DM9000 board, allocate space and register it |
| 379 | */ | 379 | */ |
| 380 | static int | 380 | static int |
| 381 | dm9000_probe(struct device *dev) | 381 | dm9000_probe(struct platform_device *pdev) |
| 382 | { | 382 | { |
| 383 | struct platform_device *pdev = to_platform_device(dev); | ||
| 384 | struct dm9000_plat_data *pdata = pdev->dev.platform_data; | 383 | struct dm9000_plat_data *pdata = pdev->dev.platform_data; |
| 385 | struct board_info *db; /* Point a board information structure */ | 384 | struct board_info *db; /* Point a board information structure */ |
| 386 | struct net_device *ndev; | 385 | struct net_device *ndev; |
| @@ -398,7 +397,7 @@ dm9000_probe(struct device *dev) | |||
| 398 | } | 397 | } |
| 399 | 398 | ||
| 400 | SET_MODULE_OWNER(ndev); | 399 | SET_MODULE_OWNER(ndev); |
| 401 | SET_NETDEV_DEV(ndev, dev); | 400 | SET_NETDEV_DEV(ndev, &pdev->dev); |
| 402 | 401 | ||
| 403 | PRINTK2("dm9000_probe()"); | 402 | PRINTK2("dm9000_probe()"); |
| 404 | 403 | ||
| @@ -569,7 +568,7 @@ dm9000_probe(struct device *dev) | |||
| 569 | printk("%s: Invalid ethernet MAC address. Please " | 568 | printk("%s: Invalid ethernet MAC address. Please " |
| 570 | "set using ifconfig\n", ndev->name); | 569 | "set using ifconfig\n", ndev->name); |
| 571 | 570 | ||
| 572 | dev_set_drvdata(dev, ndev); | 571 | platform_set_drvdata(pdev, ndev); |
| 573 | ret = register_netdev(ndev); | 572 | ret = register_netdev(ndev); |
| 574 | 573 | ||
| 575 | if (ret == 0) { | 574 | if (ret == 0) { |
| @@ -1140,9 +1139,9 @@ dm9000_phy_write(struct net_device *dev, int phyaddr_unused, int reg, int value) | |||
| 1140 | } | 1139 | } |
| 1141 | 1140 | ||
| 1142 | static int | 1141 | static int |
| 1143 | dm9000_drv_suspend(struct device *dev, pm_message_t state) | 1142 | dm9000_drv_suspend(struct platform_device *dev, pm_message_t state) |
| 1144 | { | 1143 | { |
| 1145 | struct net_device *ndev = dev_get_drvdata(dev); | 1144 | struct net_device *ndev = platform_get_drvdata(dev); |
| 1146 | 1145 | ||
| 1147 | if (ndev) { | 1146 | if (ndev) { |
| 1148 | if (netif_running(ndev)) { | 1147 | if (netif_running(ndev)) { |
| @@ -1154,9 +1153,9 @@ dm9000_drv_suspend(struct device *dev, pm_message_t state) | |||
| 1154 | } | 1153 | } |
| 1155 | 1154 | ||
| 1156 | static int | 1155 | static int |
| 1157 | dm9000_drv_resume(struct device *dev) | 1156 | dm9000_drv_resume(struct platform_device *dev) |
| 1158 | { | 1157 | { |
| 1159 | struct net_device *ndev = dev_get_drvdata(dev); | 1158 | struct net_device *ndev = platform_get_drvdata(dev); |
| 1160 | board_info_t *db = (board_info_t *) ndev->priv; | 1159 | board_info_t *db = (board_info_t *) ndev->priv; |
| 1161 | 1160 | ||
| 1162 | if (ndev) { | 1161 | if (ndev) { |
| @@ -1172,12 +1171,11 @@ dm9000_drv_resume(struct device *dev) | |||
| 1172 | } | 1171 | } |
| 1173 | 1172 | ||
| 1174 | static int | 1173 | static int |
| 1175 | dm9000_drv_remove(struct device *dev) | 1174 | dm9000_drv_remove(struct platform_device *pdev) |
| 1176 | { | 1175 | { |
| 1177 | struct platform_device *pdev = to_platform_device(dev); | 1176 | struct net_device *ndev = platform_get_drvdata(pdev); |
| 1178 | struct net_device *ndev = dev_get_drvdata(dev); | ||
| 1179 | 1177 | ||
| 1180 | dev_set_drvdata(dev, NULL); | 1178 | platform_set_drvdata(pdev, NULL); |
| 1181 | 1179 | ||
| 1182 | unregister_netdev(ndev); | 1180 | unregister_netdev(ndev); |
| 1183 | dm9000_release_board(pdev, (board_info_t *) ndev->priv); | 1181 | dm9000_release_board(pdev, (board_info_t *) ndev->priv); |
| @@ -1188,13 +1186,14 @@ dm9000_drv_remove(struct device *dev) | |||
| 1188 | return 0; | 1186 | return 0; |
| 1189 | } | 1187 | } |
| 1190 | 1188 | ||
| 1191 | static struct device_driver dm9000_driver = { | 1189 | static struct platform_driver dm9000_driver = { |
| 1192 | .name = "dm9000", | ||
| 1193 | .bus = &platform_bus_type, | ||
| 1194 | .probe = dm9000_probe, | 1190 | .probe = dm9000_probe, |
| 1195 | .remove = dm9000_drv_remove, | 1191 | .remove = dm9000_drv_remove, |
| 1196 | .suspend = dm9000_drv_suspend, | 1192 | .suspend = dm9000_drv_suspend, |
| 1197 | .resume = dm9000_drv_resume, | 1193 | .resume = dm9000_drv_resume, |
| 1194 | .driver = { | ||
| 1195 | .name = "dm9000", | ||
| 1196 | }, | ||
| 1198 | }; | 1197 | }; |
| 1199 | 1198 | ||
| 1200 | static int __init | 1199 | static int __init |
| @@ -1202,13 +1201,13 @@ dm9000_init(void) | |||
| 1202 | { | 1201 | { |
| 1203 | printk(KERN_INFO "%s Ethernet Driver\n", CARDNAME); | 1202 | printk(KERN_INFO "%s Ethernet Driver\n", CARDNAME); |
| 1204 | 1203 | ||
| 1205 | return driver_register(&dm9000_driver); /* search board and register */ | 1204 | return platform_driver_register(&dm9000_driver); /* search board and register */ |
| 1206 | } | 1205 | } |
| 1207 | 1206 | ||
| 1208 | static void __exit | 1207 | static void __exit |
| 1209 | dm9000_cleanup(void) | 1208 | dm9000_cleanup(void) |
| 1210 | { | 1209 | { |
| 1211 | driver_unregister(&dm9000_driver); | 1210 | platform_driver_unregister(&dm9000_driver); |
| 1212 | } | 1211 | } |
| 1213 | 1212 | ||
| 1214 | module_init(dm9000_init); | 1213 | module_init(dm9000_init); |
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c index 54d294ad6df5..e3a329539f1c 100644 --- a/drivers/net/gianfar.c +++ b/drivers/net/gianfar.c | |||
| @@ -126,8 +126,8 @@ static irqreturn_t gfar_interrupt(int irq, void *dev_id, struct pt_regs *regs); | |||
| 126 | static void adjust_link(struct net_device *dev); | 126 | static void adjust_link(struct net_device *dev); |
| 127 | static void init_registers(struct net_device *dev); | 127 | static void init_registers(struct net_device *dev); |
| 128 | static int init_phy(struct net_device *dev); | 128 | static int init_phy(struct net_device *dev); |
| 129 | static int gfar_probe(struct device *device); | 129 | static int gfar_probe(struct platform_device *pdev); |
| 130 | static int gfar_remove(struct device *device); | 130 | static int gfar_remove(struct platform_device *pdev); |
| 131 | static void free_skb_resources(struct gfar_private *priv); | 131 | static void free_skb_resources(struct gfar_private *priv); |
| 132 | static void gfar_set_multi(struct net_device *dev); | 132 | static void gfar_set_multi(struct net_device *dev); |
| 133 | static void gfar_set_hash_for_addr(struct net_device *dev, u8 *addr); | 133 | static void gfar_set_hash_for_addr(struct net_device *dev, u8 *addr); |
| @@ -156,12 +156,11 @@ int gfar_uses_fcb(struct gfar_private *priv) | |||
| 156 | 156 | ||
| 157 | /* Set up the ethernet device structure, private data, | 157 | /* Set up the ethernet device structure, private data, |
| 158 | * and anything else we need before we start */ | 158 | * and anything else we need before we start */ |
| 159 | static int gfar_probe(struct device *device) | 159 | static int gfar_probe(struct platform_device *pdev) |
| 160 | { | 160 | { |
| 161 | u32 tempval; | 161 | u32 tempval; |
| 162 | struct net_device *dev = NULL; | 162 | struct net_device *dev = NULL; |
| 163 | struct gfar_private *priv = NULL; | 163 | struct gfar_private *priv = NULL; |
| 164 | struct platform_device *pdev = to_platform_device(device); | ||
| 165 | struct gianfar_platform_data *einfo; | 164 | struct gianfar_platform_data *einfo; |
| 166 | struct resource *r; | 165 | struct resource *r; |
| 167 | int idx; | 166 | int idx; |
| @@ -208,7 +207,7 @@ static int gfar_probe(struct device *device) | |||
| 208 | 207 | ||
| 209 | spin_lock_init(&priv->lock); | 208 | spin_lock_init(&priv->lock); |
| 210 | 209 | ||
| 211 | dev_set_drvdata(device, dev); | 210 | platform_set_drvdata(pdev, dev); |
| 212 | 211 | ||
| 213 | /* Stop the DMA engine now, in case it was running before */ | 212 | /* Stop the DMA engine now, in case it was running before */ |
| 214 | /* (The firmware could have used it, and left it running). */ | 213 | /* (The firmware could have used it, and left it running). */ |
| @@ -245,7 +244,7 @@ static int gfar_probe(struct device *device) | |||
| 245 | dev->base_addr = (unsigned long) (priv->regs); | 244 | dev->base_addr = (unsigned long) (priv->regs); |
| 246 | 245 | ||
| 247 | SET_MODULE_OWNER(dev); | 246 | SET_MODULE_OWNER(dev); |
| 248 | SET_NETDEV_DEV(dev, device); | 247 | SET_NETDEV_DEV(dev, &pdev->dev); |
| 249 | 248 | ||
| 250 | /* Fill in the dev structure */ | 249 | /* Fill in the dev structure */ |
| 251 | dev->open = gfar_enet_open; | 250 | dev->open = gfar_enet_open; |
| @@ -377,12 +376,12 @@ regs_fail: | |||
| 377 | return err; | 376 | return err; |
| 378 | } | 377 | } |
| 379 | 378 | ||
| 380 | static int gfar_remove(struct device *device) | 379 | static int gfar_remove(struct platform_device *pdev) |
| 381 | { | 380 | { |
| 382 | struct net_device *dev = dev_get_drvdata(device); | 381 | struct net_device *dev = platform_get_drvdata(pdev); |
| 383 | struct gfar_private *priv = netdev_priv(dev); | 382 | struct gfar_private *priv = netdev_priv(dev); |
| 384 | 383 | ||
| 385 | dev_set_drvdata(device, NULL); | 384 | platform_set_drvdata(pdev, NULL); |
| 386 | 385 | ||
| 387 | iounmap((void *) priv->regs); | 386 | iounmap((void *) priv->regs); |
| 388 | free_netdev(dev); | 387 | free_netdev(dev); |
| @@ -1861,11 +1860,12 @@ static irqreturn_t gfar_error(int irq, void *dev_id, struct pt_regs *regs) | |||
| 1861 | } | 1860 | } |
| 1862 | 1861 | ||
| 1863 | /* Structure for a device driver */ | 1862 | /* Structure for a device driver */ |
| 1864 | static struct device_driver gfar_driver = { | 1863 | static struct platform_driver gfar_driver = { |
| 1865 | .name = "fsl-gianfar", | ||
| 1866 | .bus = &platform_bus_type, | ||
| 1867 | .probe = gfar_probe, | 1864 | .probe = gfar_probe, |
| 1868 | .remove = gfar_remove, | 1865 | .remove = gfar_remove, |
| 1866 | .driver = { | ||
| 1867 | .name = "fsl-gianfar", | ||
| 1868 | }, | ||
| 1869 | }; | 1869 | }; |
| 1870 | 1870 | ||
| 1871 | static int __init gfar_init(void) | 1871 | static int __init gfar_init(void) |
| @@ -1875,7 +1875,7 @@ static int __init gfar_init(void) | |||
| 1875 | if (err) | 1875 | if (err) |
| 1876 | return err; | 1876 | return err; |
| 1877 | 1877 | ||
| 1878 | err = driver_register(&gfar_driver); | 1878 | err = platform_driver_register(&gfar_driver); |
| 1879 | 1879 | ||
| 1880 | if (err) | 1880 | if (err) |
| 1881 | gfar_mdio_exit(); | 1881 | gfar_mdio_exit(); |
| @@ -1885,7 +1885,7 @@ static int __init gfar_init(void) | |||
| 1885 | 1885 | ||
| 1886 | static void __exit gfar_exit(void) | 1886 | static void __exit gfar_exit(void) |
| 1887 | { | 1887 | { |
| 1888 | driver_unregister(&gfar_driver); | 1888 | platform_driver_unregister(&gfar_driver); |
| 1889 | gfar_mdio_exit(); | 1889 | gfar_mdio_exit(); |
| 1890 | } | 1890 | } |
| 1891 | 1891 | ||
diff --git a/drivers/net/irda/sa1100_ir.c b/drivers/net/irda/sa1100_ir.c index 76e0b9fb5e96..63d38fbbd04e 100644 --- a/drivers/net/irda/sa1100_ir.c +++ b/drivers/net/irda/sa1100_ir.c | |||
| @@ -291,9 +291,9 @@ static void sa1100_irda_shutdown(struct sa1100_irda *si) | |||
| 291 | /* | 291 | /* |
| 292 | * Suspend the IrDA interface. | 292 | * Suspend the IrDA interface. |
| 293 | */ | 293 | */ |
| 294 | static int sa1100_irda_suspend(struct device *_dev, pm_message_t state) | 294 | static int sa1100_irda_suspend(struct platform_device *pdev, pm_message_t state) |
| 295 | { | 295 | { |
| 296 | struct net_device *dev = dev_get_drvdata(_dev); | 296 | struct net_device *dev = platform_get_drvdata(pdev); |
| 297 | struct sa1100_irda *si; | 297 | struct sa1100_irda *si; |
| 298 | 298 | ||
| 299 | if (!dev) | 299 | if (!dev) |
| @@ -316,9 +316,9 @@ static int sa1100_irda_suspend(struct device *_dev, pm_message_t state) | |||
| 316 | /* | 316 | /* |
| 317 | * Resume the IrDA interface. | 317 | * Resume the IrDA interface. |
| 318 | */ | 318 | */ |
| 319 | static int sa1100_irda_resume(struct device *_dev) | 319 | static int sa1100_irda_resume(struct platform_device *pdev) |
| 320 | { | 320 | { |
| 321 | struct net_device *dev = dev_get_drvdata(_dev); | 321 | struct net_device *dev = platform_get_drvdata(pdev); |
| 322 | struct sa1100_irda *si; | 322 | struct sa1100_irda *si; |
| 323 | 323 | ||
| 324 | if (!dev) | 324 | if (!dev) |
| @@ -886,9 +886,8 @@ static int sa1100_irda_init_iobuf(iobuff_t *io, int size) | |||
| 886 | return io->head ? 0 : -ENOMEM; | 886 | return io->head ? 0 : -ENOMEM; |
| 887 | } | 887 | } |
| 888 | 888 | ||
| 889 | static int sa1100_irda_probe(struct device *_dev) | 889 | static int sa1100_irda_probe(struct platform_device *pdev) |
| 890 | { | 890 | { |
| 891 | struct platform_device *pdev = to_platform_device(_dev); | ||
| 892 | struct net_device *dev; | 891 | struct net_device *dev; |
| 893 | struct sa1100_irda *si; | 892 | struct sa1100_irda *si; |
| 894 | unsigned int baudrate_mask; | 893 | unsigned int baudrate_mask; |
| @@ -967,7 +966,7 @@ static int sa1100_irda_probe(struct device *_dev) | |||
| 967 | 966 | ||
| 968 | err = register_netdev(dev); | 967 | err = register_netdev(dev); |
| 969 | if (err == 0) | 968 | if (err == 0) |
| 970 | dev_set_drvdata(&pdev->dev, dev); | 969 | platform_set_drvdata(pdev, dev); |
| 971 | 970 | ||
| 972 | if (err) { | 971 | if (err) { |
| 973 | err_mem_5: | 972 | err_mem_5: |
| @@ -985,9 +984,9 @@ static int sa1100_irda_probe(struct device *_dev) | |||
| 985 | return err; | 984 | return err; |
| 986 | } | 985 | } |
| 987 | 986 | ||
| 988 | static int sa1100_irda_remove(struct device *_dev) | 987 | static int sa1100_irda_remove(struct platform_device *pdev) |
| 989 | { | 988 | { |
| 990 | struct net_device *dev = dev_get_drvdata(_dev); | 989 | struct net_device *dev = platform_get_drvdata(pdev); |
| 991 | 990 | ||
| 992 | if (dev) { | 991 | if (dev) { |
| 993 | struct sa1100_irda *si = dev->priv; | 992 | struct sa1100_irda *si = dev->priv; |
| @@ -1004,13 +1003,14 @@ static int sa1100_irda_remove(struct device *_dev) | |||
| 1004 | return 0; | 1003 | return 0; |
| 1005 | } | 1004 | } |
| 1006 | 1005 | ||
| 1007 | static struct device_driver sa1100ir_driver = { | 1006 | static struct platform_driver sa1100ir_driver = { |
| 1008 | .name = "sa11x0-ir", | ||
| 1009 | .bus = &platform_bus_type, | ||
| 1010 | .probe = sa1100_irda_probe, | 1007 | .probe = sa1100_irda_probe, |
| 1011 | .remove = sa1100_irda_remove, | 1008 | .remove = sa1100_irda_remove, |
| 1012 | .suspend = sa1100_irda_suspend, | 1009 | .suspend = sa1100_irda_suspend, |
| 1013 | .resume = sa1100_irda_resume, | 1010 | .resume = sa1100_irda_resume, |
| 1011 | .driver = { | ||
| 1012 | .name = "sa11x0-ir", | ||
| 1013 | }, | ||
| 1014 | }; | 1014 | }; |
| 1015 | 1015 | ||
| 1016 | static int __init sa1100_irda_init(void) | 1016 | static int __init sa1100_irda_init(void) |
| @@ -1023,12 +1023,12 @@ static int __init sa1100_irda_init(void) | |||
| 1023 | if (power_level > 3) | 1023 | if (power_level > 3) |
| 1024 | power_level = 3; | 1024 | power_level = 3; |
| 1025 | 1025 | ||
| 1026 | return driver_register(&sa1100ir_driver); | 1026 | return platform_driver_register(&sa1100ir_driver); |
| 1027 | } | 1027 | } |
| 1028 | 1028 | ||
| 1029 | static void __exit sa1100_irda_exit(void) | 1029 | static void __exit sa1100_irda_exit(void) |
| 1030 | { | 1030 | { |
| 1031 | driver_unregister(&sa1100ir_driver); | 1031 | platform_driver_unregister(&sa1100ir_driver); |
| 1032 | } | 1032 | } |
| 1033 | 1033 | ||
| 1034 | module_init(sa1100_irda_init); | 1034 | module_init(sa1100_irda_init); |
diff --git a/drivers/net/irda/smsc-ircc2.c b/drivers/net/irda/smsc-ircc2.c index a1d207f2fa68..ec94ecdb103d 100644 --- a/drivers/net/irda/smsc-ircc2.c +++ b/drivers/net/irda/smsc-ircc2.c | |||
| @@ -214,14 +214,15 @@ static int smsc_ircc_probe_transceiver_smsc_ircc_atc(int fir_base); | |||
| 214 | 214 | ||
| 215 | /* Power Management */ | 215 | /* Power Management */ |
| 216 | 216 | ||
| 217 | static int smsc_ircc_suspend(struct device *dev, pm_message_t state); | 217 | static int smsc_ircc_suspend(struct platform_device *dev, pm_message_t state); |
| 218 | static int smsc_ircc_resume(struct device *dev); | 218 | static int smsc_ircc_resume(struct platform_device *dev); |
| 219 | 219 | ||
| 220 | static struct device_driver smsc_ircc_driver = { | 220 | static struct platform_driver smsc_ircc_driver = { |
| 221 | .name = SMSC_IRCC2_DRIVER_NAME, | ||
| 222 | .bus = &platform_bus_type, | ||
| 223 | .suspend = smsc_ircc_suspend, | 221 | .suspend = smsc_ircc_suspend, |
| 224 | .resume = smsc_ircc_resume, | 222 | .resume = smsc_ircc_resume, |
| 223 | .driver = { | ||
| 224 | .name = SMSC_IRCC2_DRIVER_NAME, | ||
| 225 | }, | ||
| 225 | }; | 226 | }; |
| 226 | 227 | ||
| 227 | /* Transceivers for SMSC-ircc */ | 228 | /* Transceivers for SMSC-ircc */ |
| @@ -346,7 +347,7 @@ static int __init smsc_ircc_init(void) | |||
| 346 | 347 | ||
| 347 | IRDA_DEBUG(1, "%s\n", __FUNCTION__); | 348 | IRDA_DEBUG(1, "%s\n", __FUNCTION__); |
| 348 | 349 | ||
| 349 | ret = driver_register(&smsc_ircc_driver); | 350 | ret = platform_driver_register(&smsc_ircc_driver); |
| 350 | if (ret) { | 351 | if (ret) { |
| 351 | IRDA_ERROR("%s, Can't register driver!\n", driver_name); | 352 | IRDA_ERROR("%s, Can't register driver!\n", driver_name); |
| 352 | return ret; | 353 | return ret; |
| @@ -378,7 +379,7 @@ static int __init smsc_ircc_init(void) | |||
| 378 | } | 379 | } |
| 379 | 380 | ||
| 380 | if (ret) | 381 | if (ret) |
| 381 | driver_unregister(&smsc_ircc_driver); | 382 | platform_driver_unregister(&smsc_ircc_driver); |
| 382 | 383 | ||
| 383 | return ret; | 384 | return ret; |
| 384 | } | 385 | } |
| @@ -491,7 +492,7 @@ static int __init smsc_ircc_open(unsigned int fir_base, unsigned int sir_base, u | |||
| 491 | err = PTR_ERR(self->pldev); | 492 | err = PTR_ERR(self->pldev); |
| 492 | goto err_out5; | 493 | goto err_out5; |
| 493 | } | 494 | } |
| 494 | dev_set_drvdata(&self->pldev->dev, self); | 495 | platform_set_drvdata(self->pldev, self); |
| 495 | 496 | ||
| 496 | IRDA_MESSAGE("IrDA: Registered device %s\n", dev->name); | 497 | IRDA_MESSAGE("IrDA: Registered device %s\n", dev->name); |
| 497 | dev_count++; | 498 | dev_count++; |
| @@ -1685,9 +1686,9 @@ static int smsc_ircc_net_close(struct net_device *dev) | |||
| 1685 | return 0; | 1686 | return 0; |
| 1686 | } | 1687 | } |
| 1687 | 1688 | ||
| 1688 | static int smsc_ircc_suspend(struct device *dev, pm_message_t state) | 1689 | static int smsc_ircc_suspend(struct platform_device *dev, pm_message_t state) |
| 1689 | { | 1690 | { |
| 1690 | struct smsc_ircc_cb *self = dev_get_drvdata(dev); | 1691 | struct smsc_ircc_cb *self = platform_get_drvdata(dev); |
| 1691 | 1692 | ||
| 1692 | if (!self->io.suspended) { | 1693 | if (!self->io.suspended) { |
| 1693 | IRDA_DEBUG(1, "%s, Suspending\n", driver_name); | 1694 | IRDA_DEBUG(1, "%s, Suspending\n", driver_name); |
| @@ -1706,9 +1707,9 @@ static int smsc_ircc_suspend(struct device *dev, pm_message_t state) | |||
| 1706 | return 0; | 1707 | return 0; |
| 1707 | } | 1708 | } |
| 1708 | 1709 | ||
| 1709 | static int smsc_ircc_resume(struct device *dev) | 1710 | static int smsc_ircc_resume(struct platform_device *dev) |
| 1710 | { | 1711 | { |
| 1711 | struct smsc_ircc_cb *self = dev_get_drvdata(dev); | 1712 | struct smsc_ircc_cb *self = platform_get_drvdata(dev); |
| 1712 | 1713 | ||
| 1713 | if (self->io.suspended) { | 1714 | if (self->io.suspended) { |
| 1714 | IRDA_DEBUG(1, "%s, Waking up\n", driver_name); | 1715 | IRDA_DEBUG(1, "%s, Waking up\n", driver_name); |
| @@ -1788,7 +1789,7 @@ static void __exit smsc_ircc_cleanup(void) | |||
| 1788 | smsc_ircc_close(dev_self[i]); | 1789 | smsc_ircc_close(dev_self[i]); |
| 1789 | } | 1790 | } |
| 1790 | 1791 | ||
| 1791 | driver_unregister(&smsc_ircc_driver); | 1792 | platform_driver_unregister(&smsc_ircc_driver); |
| 1792 | } | 1793 | } |
| 1793 | 1794 | ||
| 1794 | /* | 1795 | /* |
diff --git a/drivers/net/jazzsonic.c b/drivers/net/jazzsonic.c index 2fb3101cb33e..b039bd89ceb9 100644 --- a/drivers/net/jazzsonic.c +++ b/drivers/net/jazzsonic.c | |||
| @@ -194,7 +194,7 @@ out: | |||
| 194 | * Probe for a SONIC ethernet controller on a Mips Jazz board. | 194 | * Probe for a SONIC ethernet controller on a Mips Jazz board. |
| 195 | * Actually probing is superfluous but we're paranoid. | 195 | * Actually probing is superfluous but we're paranoid. |
| 196 | */ | 196 | */ |
| 197 | static int __init jazz_sonic_probe(struct device *device) | 197 | static int __init jazz_sonic_probe(struct platform_device *pdev) |
| 198 | { | 198 | { |
| 199 | struct net_device *dev; | 199 | struct net_device *dev; |
| 200 | struct sonic_local *lp; | 200 | struct sonic_local *lp; |
| @@ -212,8 +212,8 @@ static int __init jazz_sonic_probe(struct device *device) | |||
| 212 | return -ENOMEM; | 212 | return -ENOMEM; |
| 213 | 213 | ||
| 214 | lp = netdev_priv(dev); | 214 | lp = netdev_priv(dev); |
| 215 | lp->device = device; | 215 | lp->device = &pdev->dev; |
| 216 | SET_NETDEV_DEV(dev, device); | 216 | SET_NETDEV_DEV(dev, &pdev->dev); |
| 217 | SET_MODULE_OWNER(dev); | 217 | SET_MODULE_OWNER(dev); |
| 218 | 218 | ||
| 219 | netdev_boot_setup_check(dev); | 219 | netdev_boot_setup_check(dev); |
| @@ -264,9 +264,9 @@ MODULE_PARM_DESC(sonic_debug, "jazzsonic debug level (1-4)"); | |||
| 264 | 264 | ||
| 265 | #include "sonic.c" | 265 | #include "sonic.c" |
| 266 | 266 | ||
| 267 | static int __devexit jazz_sonic_device_remove (struct device *device) | 267 | static int __devexit jazz_sonic_device_remove (struct platform_device *pdev) |
| 268 | { | 268 | { |
| 269 | struct net_device *dev = device->driver_data; | 269 | struct net_device *dev = platform_get_drvdata(pdev); |
| 270 | struct sonic_local* lp = netdev_priv(dev); | 270 | struct sonic_local* lp = netdev_priv(dev); |
| 271 | 271 | ||
| 272 | unregister_netdev (dev); | 272 | unregister_netdev (dev); |
| @@ -278,18 +278,19 @@ static int __devexit jazz_sonic_device_remove (struct device *device) | |||
| 278 | return 0; | 278 | return 0; |
| 279 | } | 279 | } |
| 280 | 280 | ||
| 281 | static struct device_driver jazz_sonic_driver = { | 281 | static struct platform_driver jazz_sonic_driver = { |
| 282 | .name = jazz_sonic_string, | ||
| 283 | .bus = &platform_bus_type, | ||
| 284 | .probe = jazz_sonic_probe, | 282 | .probe = jazz_sonic_probe, |
| 285 | .remove = __devexit_p(jazz_sonic_device_remove), | 283 | .remove = __devexit_p(jazz_sonic_device_remove), |
| 284 | .driver = { | ||
| 285 | .name = jazz_sonic_string, | ||
| 286 | }, | ||
| 286 | }; | 287 | }; |
| 287 | 288 | ||
| 288 | static int __init jazz_sonic_init_module(void) | 289 | static int __init jazz_sonic_init_module(void) |
| 289 | { | 290 | { |
| 290 | int err; | 291 | int err; |
| 291 | 292 | ||
| 292 | if ((err = driver_register(&jazz_sonic_driver))) { | 293 | if ((err = platform_driver_register(&jazz_sonic_driver))) { |
| 293 | printk(KERN_ERR "Driver registration failed\n"); | 294 | printk(KERN_ERR "Driver registration failed\n"); |
| 294 | return err; | 295 | return err; |
| 295 | } | 296 | } |
| @@ -313,7 +314,7 @@ out_unregister: | |||
| 313 | 314 | ||
| 314 | static void __exit jazz_sonic_cleanup_module(void) | 315 | static void __exit jazz_sonic_cleanup_module(void) |
| 315 | { | 316 | { |
| 316 | driver_unregister(&jazz_sonic_driver); | 317 | platform_driver_unregister(&jazz_sonic_driver); |
| 317 | 318 | ||
| 318 | if (jazz_sonic_device) { | 319 | if (jazz_sonic_device) { |
| 319 | platform_device_unregister(jazz_sonic_device); | 320 | platform_device_unregister(jazz_sonic_device); |
diff --git a/drivers/net/macsonic.c b/drivers/net/macsonic.c index 9ef4592aca03..02d5c6822733 100644 --- a/drivers/net/macsonic.c +++ b/drivers/net/macsonic.c | |||
| @@ -525,7 +525,7 @@ int __init mac_nubus_sonic_probe(struct net_device* dev) | |||
| 525 | return macsonic_init(dev); | 525 | return macsonic_init(dev); |
| 526 | } | 526 | } |
| 527 | 527 | ||
| 528 | static int __init mac_sonic_probe(struct device *device) | 528 | static int __init mac_sonic_probe(struct platform_device *device) |
| 529 | { | 529 | { |
| 530 | struct net_device *dev; | 530 | struct net_device *dev; |
| 531 | struct sonic_local *lp; | 531 | struct sonic_local *lp; |
| @@ -537,8 +537,8 @@ static int __init mac_sonic_probe(struct device *device) | |||
| 537 | return -ENOMEM; | 537 | return -ENOMEM; |
| 538 | 538 | ||
| 539 | lp = netdev_priv(dev); | 539 | lp = netdev_priv(dev); |
| 540 | lp->device = device; | 540 | lp->device = &device->dev; |
| 541 | SET_NETDEV_DEV(dev, device); | 541 | SET_NETDEV_DEV(dev, &device->dev); |
| 542 | SET_MODULE_OWNER(dev); | 542 | SET_MODULE_OWNER(dev); |
| 543 | 543 | ||
| 544 | /* This will catch fatal stuff like -ENOMEM as well as success */ | 544 | /* This will catch fatal stuff like -ENOMEM as well as success */ |
| @@ -579,9 +579,9 @@ MODULE_PARM_DESC(sonic_debug, "macsonic debug level (1-4)"); | |||
| 579 | 579 | ||
| 580 | #include "sonic.c" | 580 | #include "sonic.c" |
| 581 | 581 | ||
| 582 | static int __devexit mac_sonic_device_remove (struct device *device) | 582 | static int __devexit mac_sonic_device_remove (struct platform_device *device) |
| 583 | { | 583 | { |
| 584 | struct net_device *dev = device->driver_data; | 584 | struct net_device *dev = platform_get_drvdata(device); |
| 585 | struct sonic_local* lp = netdev_priv(dev); | 585 | struct sonic_local* lp = netdev_priv(dev); |
| 586 | 586 | ||
| 587 | unregister_netdev (dev); | 587 | unregister_netdev (dev); |
| @@ -592,18 +592,19 @@ static int __devexit mac_sonic_device_remove (struct device *device) | |||
| 592 | return 0; | 592 | return 0; |
| 593 | } | 593 | } |
| 594 | 594 | ||
| 595 | static struct device_driver mac_sonic_driver = { | 595 | static struct platform_driver mac_sonic_driver = { |
| 596 | .name = mac_sonic_string, | ||
| 597 | .bus = &platform_bus_type, | ||
| 598 | .probe = mac_sonic_probe, | 596 | .probe = mac_sonic_probe, |
| 599 | .remove = __devexit_p(mac_sonic_device_remove), | 597 | .remove = __devexit_p(mac_sonic_device_remove), |
| 598 | .driver = { | ||
| 599 | .name = mac_sonic_string, | ||
| 600 | }, | ||
| 600 | }; | 601 | }; |
| 601 | 602 | ||
| 602 | static int __init mac_sonic_init_module(void) | 603 | static int __init mac_sonic_init_module(void) |
| 603 | { | 604 | { |
| 604 | int err; | 605 | int err; |
| 605 | 606 | ||
| 606 | if ((err = driver_register(&mac_sonic_driver))) { | 607 | if ((err = platform_driver_register(&mac_sonic_driver))) { |
| 607 | printk(KERN_ERR "Driver registration failed\n"); | 608 | printk(KERN_ERR "Driver registration failed\n"); |
| 608 | return err; | 609 | return err; |
| 609 | } | 610 | } |
| @@ -628,7 +629,7 @@ out_unregister: | |||
| 628 | 629 | ||
| 629 | static void __exit mac_sonic_cleanup_module(void) | 630 | static void __exit mac_sonic_cleanup_module(void) |
| 630 | { | 631 | { |
| 631 | driver_unregister(&mac_sonic_driver); | 632 | platform_driver_unregister(&mac_sonic_driver); |
| 632 | 633 | ||
| 633 | if (mac_sonic_device) { | 634 | if (mac_sonic_device) { |
| 634 | platform_device_unregister(mac_sonic_device); | 635 | platform_device_unregister(mac_sonic_device); |
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c index 71f2c6705bc3..3cb9b3fe0cf1 100644 --- a/drivers/net/mv643xx_eth.c +++ b/drivers/net/mv643xx_eth.c | |||
| @@ -1387,9 +1387,8 @@ static void mv643xx_netpoll(struct net_device *netdev) | |||
| 1387 | * Input : struct device * | 1387 | * Input : struct device * |
| 1388 | * Output : -ENOMEM if failed , 0 if success | 1388 | * Output : -ENOMEM if failed , 0 if success |
| 1389 | */ | 1389 | */ |
| 1390 | static int mv643xx_eth_probe(struct device *ddev) | 1390 | static int mv643xx_eth_probe(struct platform_device *pdev) |
| 1391 | { | 1391 | { |
| 1392 | struct platform_device *pdev = to_platform_device(ddev); | ||
| 1393 | struct mv643xx_eth_platform_data *pd; | 1392 | struct mv643xx_eth_platform_data *pd; |
| 1394 | int port_num = pdev->id; | 1393 | int port_num = pdev->id; |
| 1395 | struct mv643xx_private *mp; | 1394 | struct mv643xx_private *mp; |
| @@ -1402,7 +1401,7 @@ static int mv643xx_eth_probe(struct device *ddev) | |||
| 1402 | if (!dev) | 1401 | if (!dev) |
| 1403 | return -ENOMEM; | 1402 | return -ENOMEM; |
| 1404 | 1403 | ||
| 1405 | dev_set_drvdata(ddev, dev); | 1404 | platform_set_drvdata(pdev, dev); |
| 1406 | 1405 | ||
| 1407 | mp = netdev_priv(dev); | 1406 | mp = netdev_priv(dev); |
| 1408 | 1407 | ||
| @@ -1546,21 +1545,20 @@ out: | |||
| 1546 | return err; | 1545 | return err; |
| 1547 | } | 1546 | } |
| 1548 | 1547 | ||
| 1549 | static int mv643xx_eth_remove(struct device *ddev) | 1548 | static int mv643xx_eth_remove(struct platform_device *pdev) |
| 1550 | { | 1549 | { |
| 1551 | struct net_device *dev = dev_get_drvdata(ddev); | 1550 | struct net_device *dev = platform_get_drvdata(pdev); |
| 1552 | 1551 | ||
| 1553 | unregister_netdev(dev); | 1552 | unregister_netdev(dev); |
| 1554 | flush_scheduled_work(); | 1553 | flush_scheduled_work(); |
| 1555 | 1554 | ||
| 1556 | free_netdev(dev); | 1555 | free_netdev(dev); |
| 1557 | dev_set_drvdata(ddev, NULL); | 1556 | platform_set_drvdata(pdev, NULL); |
| 1558 | return 0; | 1557 | return 0; |
| 1559 | } | 1558 | } |
| 1560 | 1559 | ||
| 1561 | static int mv643xx_eth_shared_probe(struct device *ddev) | 1560 | static int mv643xx_eth_shared_probe(struct platform_device *pdev) |
| 1562 | { | 1561 | { |
| 1563 | struct platform_device *pdev = to_platform_device(ddev); | ||
| 1564 | struct resource *res; | 1562 | struct resource *res; |
| 1565 | 1563 | ||
| 1566 | printk(KERN_NOTICE "MV-643xx 10/100/1000 Ethernet Driver\n"); | 1564 | printk(KERN_NOTICE "MV-643xx 10/100/1000 Ethernet Driver\n"); |
| @@ -1578,7 +1576,7 @@ static int mv643xx_eth_shared_probe(struct device *ddev) | |||
| 1578 | 1576 | ||
| 1579 | } | 1577 | } |
| 1580 | 1578 | ||
| 1581 | static int mv643xx_eth_shared_remove(struct device *ddev) | 1579 | static int mv643xx_eth_shared_remove(struct platform_device *pdev) |
| 1582 | { | 1580 | { |
| 1583 | iounmap(mv643xx_eth_shared_base); | 1581 | iounmap(mv643xx_eth_shared_base); |
| 1584 | mv643xx_eth_shared_base = NULL; | 1582 | mv643xx_eth_shared_base = NULL; |
| @@ -1586,18 +1584,20 @@ static int mv643xx_eth_shared_remove(struct device *ddev) | |||
| 1586 | return 0; | 1584 | return 0; |
| 1587 | } | 1585 | } |
| 1588 | 1586 | ||
| 1589 | static struct device_driver mv643xx_eth_driver = { | 1587 | static struct platform_driver mv643xx_eth_driver = { |
| 1590 | .name = MV643XX_ETH_NAME, | ||
| 1591 | .bus = &platform_bus_type, | ||
| 1592 | .probe = mv643xx_eth_probe, | 1588 | .probe = mv643xx_eth_probe, |
| 1593 | .remove = mv643xx_eth_remove, | 1589 | .remove = mv643xx_eth_remove, |
| 1590 | .driver = { | ||
| 1591 | .name = MV643XX_ETH_NAME, | ||
| 1592 | }, | ||
| 1594 | }; | 1593 | }; |
| 1595 | 1594 | ||
| 1596 | static struct device_driver mv643xx_eth_shared_driver = { | 1595 | static struct platform_driver mv643xx_eth_shared_driver = { |
| 1597 | .name = MV643XX_ETH_SHARED_NAME, | ||
| 1598 | .bus = &platform_bus_type, | ||
| 1599 | .probe = mv643xx_eth_shared_probe, | 1596 | .probe = mv643xx_eth_shared_probe, |
| 1600 | .remove = mv643xx_eth_shared_remove, | 1597 | .remove = mv643xx_eth_shared_remove, |
| 1598 | .driver = { | ||
| 1599 | .name = MV643XX_ETH_SHARED_NAME, | ||
| 1600 | }, | ||
| 1601 | }; | 1601 | }; |
| 1602 | 1602 | ||
| 1603 | /* | 1603 | /* |
| @@ -1613,11 +1613,11 @@ static int __init mv643xx_init_module(void) | |||
| 1613 | { | 1613 | { |
| 1614 | int rc; | 1614 | int rc; |
| 1615 | 1615 | ||
| 1616 | rc = driver_register(&mv643xx_eth_shared_driver); | 1616 | rc = platform_driver_register(&mv643xx_eth_shared_driver); |
| 1617 | if (!rc) { | 1617 | if (!rc) { |
| 1618 | rc = driver_register(&mv643xx_eth_driver); | 1618 | rc = platform_driver_register(&mv643xx_eth_driver); |
| 1619 | if (rc) | 1619 | if (rc) |
| 1620 | driver_unregister(&mv643xx_eth_shared_driver); | 1620 | platform_driver_unregister(&mv643xx_eth_shared_driver); |
| 1621 | } | 1621 | } |
| 1622 | return rc; | 1622 | return rc; |
| 1623 | } | 1623 | } |
| @@ -1633,8 +1633,8 @@ static int __init mv643xx_init_module(void) | |||
| 1633 | */ | 1633 | */ |
| 1634 | static void __exit mv643xx_cleanup_module(void) | 1634 | static void __exit mv643xx_cleanup_module(void) |
| 1635 | { | 1635 | { |
| 1636 | driver_unregister(&mv643xx_eth_driver); | 1636 | platform_driver_unregister(&mv643xx_eth_driver); |
| 1637 | driver_unregister(&mv643xx_eth_shared_driver); | 1637 | platform_driver_unregister(&mv643xx_eth_shared_driver); |
| 1638 | } | 1638 | } |
| 1639 | 1639 | ||
| 1640 | module_init(mv643xx_init_module); | 1640 | module_init(mv643xx_init_module); |
diff --git a/drivers/net/smc91x.c b/drivers/net/smc91x.c index 74d5f1a6fdea..c91e2e81f131 100644 --- a/drivers/net/smc91x.c +++ b/drivers/net/smc91x.c | |||
| @@ -2183,9 +2183,8 @@ static void smc_release_datacs(struct platform_device *pdev, struct net_device * | |||
| 2183 | * 0 --> there is a device | 2183 | * 0 --> there is a device |
| 2184 | * anything else, error | 2184 | * anything else, error |
| 2185 | */ | 2185 | */ |
| 2186 | static int smc_drv_probe(struct device *dev) | 2186 | static int smc_drv_probe(struct platform_device *pdev) |
| 2187 | { | 2187 | { |
| 2188 | struct platform_device *pdev = to_platform_device(dev); | ||
| 2189 | struct net_device *ndev; | 2188 | struct net_device *ndev; |
| 2190 | struct resource *res; | 2189 | struct resource *res; |
| 2191 | unsigned int __iomem *addr; | 2190 | unsigned int __iomem *addr; |
| @@ -2212,7 +2211,7 @@ static int smc_drv_probe(struct device *dev) | |||
| 2212 | goto out_release_io; | 2211 | goto out_release_io; |
| 2213 | } | 2212 | } |
| 2214 | SET_MODULE_OWNER(ndev); | 2213 | SET_MODULE_OWNER(ndev); |
| 2215 | SET_NETDEV_DEV(ndev, dev); | 2214 | SET_NETDEV_DEV(ndev, &pdev->dev); |
| 2216 | 2215 | ||
| 2217 | ndev->dma = (unsigned char)-1; | 2216 | ndev->dma = (unsigned char)-1; |
| 2218 | ndev->irq = platform_get_irq(pdev, 0); | 2217 | ndev->irq = platform_get_irq(pdev, 0); |
| @@ -2233,7 +2232,7 @@ static int smc_drv_probe(struct device *dev) | |||
| 2233 | goto out_release_attrib; | 2232 | goto out_release_attrib; |
| 2234 | } | 2233 | } |
| 2235 | 2234 | ||
| 2236 | dev_set_drvdata(dev, ndev); | 2235 | platform_set_drvdata(pdev, ndev); |
| 2237 | ret = smc_probe(ndev, addr); | 2236 | ret = smc_probe(ndev, addr); |
| 2238 | if (ret != 0) | 2237 | if (ret != 0) |
| 2239 | goto out_iounmap; | 2238 | goto out_iounmap; |
| @@ -2249,7 +2248,7 @@ static int smc_drv_probe(struct device *dev) | |||
| 2249 | return 0; | 2248 | return 0; |
| 2250 | 2249 | ||
| 2251 | out_iounmap: | 2250 | out_iounmap: |
| 2252 | dev_set_drvdata(dev, NULL); | 2251 | platform_set_drvdata(pdev, NULL); |
| 2253 | iounmap(addr); | 2252 | iounmap(addr); |
| 2254 | out_release_attrib: | 2253 | out_release_attrib: |
| 2255 | smc_release_attrib(pdev); | 2254 | smc_release_attrib(pdev); |
| @@ -2263,14 +2262,13 @@ static int smc_drv_probe(struct device *dev) | |||
| 2263 | return ret; | 2262 | return ret; |
| 2264 | } | 2263 | } |
| 2265 | 2264 | ||
| 2266 | static int smc_drv_remove(struct device *dev) | 2265 | static int smc_drv_remove(struct platform_device *pdev) |
| 2267 | { | 2266 | { |
| 2268 | struct platform_device *pdev = to_platform_device(dev); | 2267 | struct net_device *ndev = platform_get_drvdata(pdev); |
| 2269 | struct net_device *ndev = dev_get_drvdata(dev); | ||
| 2270 | struct smc_local *lp = netdev_priv(ndev); | 2268 | struct smc_local *lp = netdev_priv(ndev); |
| 2271 | struct resource *res; | 2269 | struct resource *res; |
| 2272 | 2270 | ||
| 2273 | dev_set_drvdata(dev, NULL); | 2271 | platform_set_drvdata(pdev, NULL); |
| 2274 | 2272 | ||
| 2275 | unregister_netdev(ndev); | 2273 | unregister_netdev(ndev); |
| 2276 | 2274 | ||
| @@ -2295,9 +2293,9 @@ static int smc_drv_remove(struct device *dev) | |||
| 2295 | return 0; | 2293 | return 0; |
| 2296 | } | 2294 | } |
| 2297 | 2295 | ||
| 2298 | static int smc_drv_suspend(struct device *dev, pm_message_t state) | 2296 | static int smc_drv_suspend(struct platform_device *dev, pm_message_t state) |
| 2299 | { | 2297 | { |
| 2300 | struct net_device *ndev = dev_get_drvdata(dev); | 2298 | struct net_device *ndev = platform_get_drvdata(dev); |
| 2301 | 2299 | ||
| 2302 | if (ndev) { | 2300 | if (ndev) { |
| 2303 | if (netif_running(ndev)) { | 2301 | if (netif_running(ndev)) { |
| @@ -2309,14 +2307,13 @@ static int smc_drv_suspend(struct device *dev, pm_message_t state) | |||
| 2309 | return 0; | 2307 | return 0; |
| 2310 | } | 2308 | } |
| 2311 | 2309 | ||
| 2312 | static int smc_drv_resume(struct device *dev) | 2310 | static int smc_drv_resume(struct platform_device *dev) |
| 2313 | { | 2311 | { |
| 2314 | struct platform_device *pdev = to_platform_device(dev); | 2312 | struct net_device *ndev = platform_get_drvdata(dev); |
| 2315 | struct net_device *ndev = dev_get_drvdata(dev); | ||
| 2316 | 2313 | ||
| 2317 | if (ndev) { | 2314 | if (ndev) { |
| 2318 | struct smc_local *lp = netdev_priv(ndev); | 2315 | struct smc_local *lp = netdev_priv(ndev); |
| 2319 | smc_enable_device(pdev); | 2316 | smc_enable_device(dev); |
| 2320 | if (netif_running(ndev)) { | 2317 | if (netif_running(ndev)) { |
| 2321 | smc_reset(ndev); | 2318 | smc_reset(ndev); |
| 2322 | smc_enable(ndev); | 2319 | smc_enable(ndev); |
| @@ -2328,13 +2325,14 @@ static int smc_drv_resume(struct device *dev) | |||
| 2328 | return 0; | 2325 | return 0; |
| 2329 | } | 2326 | } |
| 2330 | 2327 | ||
| 2331 | static struct device_driver smc_driver = { | 2328 | static struct platform_driver smc_driver = { |
| 2332 | .name = CARDNAME, | ||
| 2333 | .bus = &platform_bus_type, | ||
| 2334 | .probe = smc_drv_probe, | 2329 | .probe = smc_drv_probe, |
| 2335 | .remove = smc_drv_remove, | 2330 | .remove = smc_drv_remove, |
| 2336 | .suspend = smc_drv_suspend, | 2331 | .suspend = smc_drv_suspend, |
| 2337 | .resume = smc_drv_resume, | 2332 | .resume = smc_drv_resume, |
| 2333 | .driver = { | ||
| 2334 | .name = CARDNAME, | ||
| 2335 | }, | ||
| 2338 | }; | 2336 | }; |
| 2339 | 2337 | ||
| 2340 | static int __init smc_init(void) | 2338 | static int __init smc_init(void) |
| @@ -2348,12 +2346,12 @@ static int __init smc_init(void) | |||
| 2348 | #endif | 2346 | #endif |
| 2349 | #endif | 2347 | #endif |
| 2350 | 2348 | ||
| 2351 | return driver_register(&smc_driver); | 2349 | return platform_driver_register(&smc_driver); |
| 2352 | } | 2350 | } |
| 2353 | 2351 | ||
| 2354 | static void __exit smc_cleanup(void) | 2352 | static void __exit smc_cleanup(void) |
| 2355 | { | 2353 | { |
| 2356 | driver_unregister(&smc_driver); | 2354 | platform_driver_unregister(&smc_driver); |
| 2357 | } | 2355 | } |
| 2358 | 2356 | ||
| 2359 | module_init(smc_init); | 2357 | module_init(smc_init); |
diff --git a/drivers/net/tokenring/proteon.c b/drivers/net/tokenring/proteon.c index d04c918ebef8..4f756960db2a 100644 --- a/drivers/net/tokenring/proteon.c +++ b/drivers/net/tokenring/proteon.c | |||
| @@ -344,9 +344,10 @@ module_param_array(dma, int, NULL, 0); | |||
| 344 | 344 | ||
| 345 | static struct platform_device *proteon_dev[ISATR_MAX_ADAPTERS]; | 345 | static struct platform_device *proteon_dev[ISATR_MAX_ADAPTERS]; |
| 346 | 346 | ||
| 347 | static struct device_driver proteon_driver = { | 347 | static struct platform_driver proteon_driver = { |
| 348 | .name = "proteon", | 348 | .driver = { |
| 349 | .bus = &platform_bus_type, | 349 | .name = "proteon", |
| 350 | }, | ||
| 350 | }; | 351 | }; |
| 351 | 352 | ||
| 352 | static int __init proteon_init(void) | 353 | static int __init proteon_init(void) |
| @@ -355,7 +356,7 @@ static int __init proteon_init(void) | |||
| 355 | struct platform_device *pdev; | 356 | struct platform_device *pdev; |
| 356 | int i, num = 0, err = 0; | 357 | int i, num = 0, err = 0; |
| 357 | 358 | ||
| 358 | err = driver_register(&proteon_driver); | 359 | err = platform_driver_register(&proteon_driver); |
| 359 | if (err) | 360 | if (err) |
| 360 | return err; | 361 | return err; |
| 361 | 362 | ||
| @@ -372,7 +373,7 @@ static int __init proteon_init(void) | |||
| 372 | err = setup_card(dev, &pdev->dev); | 373 | err = setup_card(dev, &pdev->dev); |
| 373 | if (!err) { | 374 | if (!err) { |
| 374 | proteon_dev[i] = pdev; | 375 | proteon_dev[i] = pdev; |
| 375 | dev_set_drvdata(&pdev->dev, dev); | 376 | platform_set_drvdata(pdev, dev); |
| 376 | ++num; | 377 | ++num; |
| 377 | } else { | 378 | } else { |
| 378 | platform_device_unregister(pdev); | 379 | platform_device_unregister(pdev); |
| @@ -399,17 +400,17 @@ static void __exit proteon_cleanup(void) | |||
| 399 | 400 | ||
| 400 | if (!pdev) | 401 | if (!pdev) |
| 401 | continue; | 402 | continue; |
| 402 | dev = dev_get_drvdata(&pdev->dev); | 403 | dev = platform_get_drvdata(pdev); |
| 403 | unregister_netdev(dev); | 404 | unregister_netdev(dev); |
| 404 | release_region(dev->base_addr, PROTEON_IO_EXTENT); | 405 | release_region(dev->base_addr, PROTEON_IO_EXTENT); |
| 405 | free_irq(dev->irq, dev); | 406 | free_irq(dev->irq, dev); |
| 406 | free_dma(dev->dma); | 407 | free_dma(dev->dma); |
| 407 | tmsdev_term(dev); | 408 | tmsdev_term(dev); |
| 408 | free_netdev(dev); | 409 | free_netdev(dev); |
| 409 | dev_set_drvdata(&pdev->dev, NULL); | 410 | platform_set_drvdata(pdev, NULL); |
| 410 | platform_device_unregister(pdev); | 411 | platform_device_unregister(pdev); |
| 411 | } | 412 | } |
| 412 | driver_unregister(&proteon_driver); | 413 | platform_driver_unregister(&proteon_driver); |
| 413 | } | 414 | } |
| 414 | 415 | ||
| 415 | module_init(proteon_init); | 416 | module_init(proteon_init); |
diff --git a/drivers/net/tokenring/skisa.c b/drivers/net/tokenring/skisa.c index 72cf708396be..d6ba41cf3110 100644 --- a/drivers/net/tokenring/skisa.c +++ b/drivers/net/tokenring/skisa.c | |||
| @@ -354,9 +354,10 @@ module_param_array(dma, int, NULL, 0); | |||
| 354 | 354 | ||
| 355 | static struct platform_device *sk_isa_dev[ISATR_MAX_ADAPTERS]; | 355 | static struct platform_device *sk_isa_dev[ISATR_MAX_ADAPTERS]; |
| 356 | 356 | ||
| 357 | static struct device_driver sk_isa_driver = { | 357 | static struct platform_driver sk_isa_driver = { |
| 358 | .name = "skisa", | 358 | .driver = { |
| 359 | .bus = &platform_bus_type, | 359 | .name = "skisa", |
| 360 | }, | ||
| 360 | }; | 361 | }; |
| 361 | 362 | ||
| 362 | static int __init sk_isa_init(void) | 363 | static int __init sk_isa_init(void) |
| @@ -365,7 +366,7 @@ static int __init sk_isa_init(void) | |||
| 365 | struct platform_device *pdev; | 366 | struct platform_device *pdev; |
| 366 | int i, num = 0, err = 0; | 367 | int i, num = 0, err = 0; |
| 367 | 368 | ||
| 368 | err = driver_register(&sk_isa_driver); | 369 | err = platform_driver_register(&sk_isa_driver); |
| 369 | if (err) | 370 | if (err) |
| 370 | return err; | 371 | return err; |
| 371 | 372 | ||
| @@ -382,7 +383,7 @@ static int __init sk_isa_init(void) | |||
| 382 | err = setup_card(dev, &pdev->dev); | 383 | err = setup_card(dev, &pdev->dev); |
| 383 | if (!err) { | 384 | if (!err) { |
| 384 | sk_isa_dev[i] = pdev; | 385 | sk_isa_dev[i] = pdev; |
| 385 | dev_set_drvdata(&sk_isa_dev[i]->dev, dev); | 386 | platform_set_drvdata(sk_isa_dev[i], dev); |
| 386 | ++num; | 387 | ++num; |
| 387 | } else { | 388 | } else { |
| 388 | platform_device_unregister(pdev); | 389 | platform_device_unregister(pdev); |
| @@ -409,17 +410,17 @@ static void __exit sk_isa_cleanup(void) | |||
| 409 | 410 | ||
| 410 | if (!pdev) | 411 | if (!pdev) |
| 411 | continue; | 412 | continue; |
| 412 | dev = dev_get_drvdata(&pdev->dev); | 413 | dev = platform_get_drvdata(pdev); |
| 413 | unregister_netdev(dev); | 414 | unregister_netdev(dev); |
| 414 | release_region(dev->base_addr, SK_ISA_IO_EXTENT); | 415 | release_region(dev->base_addr, SK_ISA_IO_EXTENT); |
| 415 | free_irq(dev->irq, dev); | 416 | free_irq(dev->irq, dev); |
| 416 | free_dma(dev->dma); | 417 | free_dma(dev->dma); |
| 417 | tmsdev_term(dev); | 418 | tmsdev_term(dev); |
| 418 | free_netdev(dev); | 419 | free_netdev(dev); |
| 419 | dev_set_drvdata(&pdev->dev, NULL); | 420 | platform_set_drvdata(pdev, NULL); |
| 420 | platform_device_unregister(pdev); | 421 | platform_device_unregister(pdev); |
| 421 | } | 422 | } |
| 422 | driver_unregister(&sk_isa_driver); | 423 | platform_driver_unregister(&sk_isa_driver); |
| 423 | } | 424 | } |
| 424 | 425 | ||
| 425 | module_init(sk_isa_init); | 426 | module_init(sk_isa_init); |
diff --git a/drivers/scsi/ahci.c b/drivers/scsi/ahci.c index 10c470e7d316..57ef7ae387d9 100644 --- a/drivers/scsi/ahci.c +++ b/drivers/scsi/ahci.c | |||
| @@ -255,7 +255,7 @@ static struct ata_port_info ahci_port_info[] = { | |||
| 255 | }, | 255 | }, |
| 256 | }; | 256 | }; |
| 257 | 257 | ||
| 258 | static struct pci_device_id ahci_pci_tbl[] = { | 258 | static const struct pci_device_id ahci_pci_tbl[] = { |
| 259 | { PCI_VENDOR_ID_INTEL, 0x2652, PCI_ANY_ID, PCI_ANY_ID, 0, 0, | 259 | { PCI_VENDOR_ID_INTEL, 0x2652, PCI_ANY_ID, PCI_ANY_ID, 0, 0, |
| 260 | board_ahci }, /* ICH6 */ | 260 | board_ahci }, /* ICH6 */ |
| 261 | { PCI_VENDOR_ID_INTEL, 0x2653, PCI_ANY_ID, PCI_ANY_ID, 0, 0, | 261 | { PCI_VENDOR_ID_INTEL, 0x2653, PCI_ANY_ID, PCI_ANY_ID, 0, 0, |
diff --git a/drivers/scsi/ata_piix.c b/drivers/scsi/ata_piix.c index a1bd8d95623c..855428ff37e9 100644 --- a/drivers/scsi/ata_piix.c +++ b/drivers/scsi/ata_piix.c | |||
| @@ -95,7 +95,7 @@ static void piix_set_dmamode (struct ata_port *ap, struct ata_device *adev); | |||
| 95 | 95 | ||
| 96 | static unsigned int in_module_init = 1; | 96 | static unsigned int in_module_init = 1; |
| 97 | 97 | ||
| 98 | static struct pci_device_id piix_pci_tbl[] = { | 98 | static const struct pci_device_id piix_pci_tbl[] = { |
| 99 | #ifdef ATA_ENABLE_PATA | 99 | #ifdef ATA_ENABLE_PATA |
| 100 | { 0x8086, 0x7111, PCI_ANY_ID, PCI_ANY_ID, 0, 0, piix4_pata }, | 100 | { 0x8086, 0x7111, PCI_ANY_ID, PCI_ANY_ID, 0, 0, piix4_pata }, |
| 101 | { 0x8086, 0x24db, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich5_pata }, | 101 | { 0x8086, 0x24db, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich5_pata }, |
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c index a74b4071a662..e51d9a8a2796 100644 --- a/drivers/scsi/libata-core.c +++ b/drivers/scsi/libata-core.c | |||
| @@ -4563,6 +4563,7 @@ ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port, int | |||
| 4563 | 4563 | ||
| 4564 | probe_ent->irq = pdev->irq; | 4564 | probe_ent->irq = pdev->irq; |
| 4565 | probe_ent->irq_flags = SA_SHIRQ; | 4565 | probe_ent->irq_flags = SA_SHIRQ; |
| 4566 | probe_ent->private_data = port[0]->private_data; | ||
| 4566 | 4567 | ||
| 4567 | if (ports & ATA_PORT_PRIMARY) { | 4568 | if (ports & ATA_PORT_PRIMARY) { |
| 4568 | probe_ent->port[p].cmd_addr = pci_resource_start(pdev, 0); | 4569 | probe_ent->port[p].cmd_addr = pci_resource_start(pdev, 0); |
| @@ -4599,6 +4600,7 @@ static struct ata_probe_ent *ata_pci_init_legacy_port(struct pci_dev *pdev, stru | |||
| 4599 | probe_ent->legacy_mode = 1; | 4600 | probe_ent->legacy_mode = 1; |
| 4600 | probe_ent->n_ports = 1; | 4601 | probe_ent->n_ports = 1; |
| 4601 | probe_ent->hard_port_no = port_num; | 4602 | probe_ent->hard_port_no = port_num; |
| 4603 | probe_ent->private_data = port->private_data; | ||
| 4602 | 4604 | ||
| 4603 | switch(port_num) | 4605 | switch(port_num) |
| 4604 | { | 4606 | { |
diff --git a/drivers/scsi/libata-scsi.c b/drivers/scsi/libata-scsi.c index bb30fcdc9297..7e37f488f591 100644 --- a/drivers/scsi/libata-scsi.c +++ b/drivers/scsi/libata-scsi.c | |||
| @@ -1129,6 +1129,8 @@ static unsigned int ata_scsi_rw_xlat(struct ata_queued_cmd *qc, const u8 *scsicm | |||
| 1129 | * length 0 means transfer 0 block of data. | 1129 | * length 0 means transfer 0 block of data. |
| 1130 | * However, for ATA R/W commands, sector count 0 means | 1130 | * However, for ATA R/W commands, sector count 0 means |
| 1131 | * 256 or 65536 sectors, not 0 sectors as in SCSI. | 1131 | * 256 or 65536 sectors, not 0 sectors as in SCSI. |
| 1132 | * | ||
| 1133 | * WARNING: one or two older ATA drives treat 0 as 0... | ||
| 1132 | */ | 1134 | */ |
| 1133 | goto nothing_to_do; | 1135 | goto nothing_to_do; |
| 1134 | 1136 | ||
diff --git a/drivers/scsi/pdc_adma.c b/drivers/scsi/pdc_adma.c index 78b4ff117af6..f557f17ca00c 100644 --- a/drivers/scsi/pdc_adma.c +++ b/drivers/scsi/pdc_adma.c | |||
| @@ -190,7 +190,7 @@ static struct ata_port_info adma_port_info[] = { | |||
| 190 | }, | 190 | }, |
| 191 | }; | 191 | }; |
| 192 | 192 | ||
| 193 | static struct pci_device_id adma_ata_pci_tbl[] = { | 193 | static const struct pci_device_id adma_ata_pci_tbl[] = { |
| 194 | { PCI_VENDOR_ID_PDC, 0x1841, PCI_ANY_ID, PCI_ANY_ID, 0, 0, | 194 | { PCI_VENDOR_ID_PDC, 0x1841, PCI_ANY_ID, PCI_ANY_ID, 0, 0, |
| 195 | board_1841_idx }, | 195 | board_1841_idx }, |
| 196 | 196 | ||
diff --git a/drivers/scsi/sata_mv.c b/drivers/scsi/sata_mv.c index 93d55233af7b..257c128f4aaa 100644 --- a/drivers/scsi/sata_mv.c +++ b/drivers/scsi/sata_mv.c | |||
| @@ -349,7 +349,7 @@ static struct ata_port_info mv_port_info[] = { | |||
| 349 | }, | 349 | }, |
| 350 | }; | 350 | }; |
| 351 | 351 | ||
| 352 | static struct pci_device_id mv_pci_tbl[] = { | 352 | static const struct pci_device_id mv_pci_tbl[] = { |
| 353 | {PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x5040), 0, 0, chip_504x}, | 353 | {PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x5040), 0, 0, chip_504x}, |
| 354 | {PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x5041), 0, 0, chip_504x}, | 354 | {PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x5041), 0, 0, chip_504x}, |
| 355 | {PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x5080), 0, 0, chip_508x}, | 355 | {PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x5080), 0, 0, chip_508x}, |
| @@ -359,6 +359,8 @@ static struct pci_device_id mv_pci_tbl[] = { | |||
| 359 | {PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x6041), 0, 0, chip_604x}, | 359 | {PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x6041), 0, 0, chip_604x}, |
| 360 | {PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x6080), 0, 0, chip_608x}, | 360 | {PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x6080), 0, 0, chip_608x}, |
| 361 | {PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x6081), 0, 0, chip_608x}, | 361 | {PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x6081), 0, 0, chip_608x}, |
| 362 | |||
| 363 | {PCI_DEVICE(PCI_VENDOR_ID_ADAPTEC2, 0x0241), 0, 0, chip_604x}, | ||
| 362 | {} /* terminate list */ | 364 | {} /* terminate list */ |
| 363 | }; | 365 | }; |
| 364 | 366 | ||
diff --git a/drivers/scsi/sata_nv.c b/drivers/scsi/sata_nv.c index 37a4fae95ed4..4954896dfdb9 100644 --- a/drivers/scsi/sata_nv.c +++ b/drivers/scsi/sata_nv.c | |||
| @@ -137,7 +137,7 @@ enum nv_host_type | |||
| 137 | CK804 | 137 | CK804 |
| 138 | }; | 138 | }; |
| 139 | 139 | ||
| 140 | static struct pci_device_id nv_pci_tbl[] = { | 140 | static const struct pci_device_id nv_pci_tbl[] = { |
| 141 | { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2S_SATA, | 141 | { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2S_SATA, |
| 142 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, NFORCE2 }, | 142 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, NFORCE2 }, |
| 143 | { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA, | 143 | { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA, |
diff --git a/drivers/scsi/sata_promise.c b/drivers/scsi/sata_promise.c index 9edc9d91efc3..242d906987ad 100644 --- a/drivers/scsi/sata_promise.c +++ b/drivers/scsi/sata_promise.c | |||
| @@ -193,7 +193,7 @@ static struct ata_port_info pdc_port_info[] = { | |||
| 193 | }, | 193 | }, |
| 194 | }; | 194 | }; |
| 195 | 195 | ||
| 196 | static struct pci_device_id pdc_ata_pci_tbl[] = { | 196 | static const struct pci_device_id pdc_ata_pci_tbl[] = { |
| 197 | { PCI_VENDOR_ID_PROMISE, 0x3371, PCI_ANY_ID, PCI_ANY_ID, 0, 0, | 197 | { PCI_VENDOR_ID_PROMISE, 0x3371, PCI_ANY_ID, PCI_ANY_ID, 0, 0, |
| 198 | board_2037x }, | 198 | board_2037x }, |
| 199 | { PCI_VENDOR_ID_PROMISE, 0x3570, PCI_ANY_ID, PCI_ANY_ID, 0, 0, | 199 | { PCI_VENDOR_ID_PROMISE, 0x3570, PCI_ANY_ID, PCI_ANY_ID, 0, 0, |
diff --git a/drivers/scsi/sata_qstor.c b/drivers/scsi/sata_qstor.c index d274ab235781..b2f6324a2eb2 100644 --- a/drivers/scsi/sata_qstor.c +++ b/drivers/scsi/sata_qstor.c | |||
| @@ -184,7 +184,7 @@ static struct ata_port_info qs_port_info[] = { | |||
| 184 | }, | 184 | }, |
| 185 | }; | 185 | }; |
| 186 | 186 | ||
| 187 | static struct pci_device_id qs_ata_pci_tbl[] = { | 187 | static const struct pci_device_id qs_ata_pci_tbl[] = { |
| 188 | { PCI_VENDOR_ID_PDC, 0x2068, PCI_ANY_ID, PCI_ANY_ID, 0, 0, | 188 | { PCI_VENDOR_ID_PDC, 0x2068, PCI_ANY_ID, PCI_ANY_ID, 0, 0, |
| 189 | board_2068_idx }, | 189 | board_2068_idx }, |
| 190 | 190 | ||
diff --git a/drivers/scsi/sata_sil.c b/drivers/scsi/sata_sil.c index d0e3c3c6c25f..36091868560d 100644 --- a/drivers/scsi/sata_sil.c +++ b/drivers/scsi/sata_sil.c | |||
| @@ -87,7 +87,7 @@ static void sil_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val); | |||
| 87 | static void sil_post_set_mode (struct ata_port *ap); | 87 | static void sil_post_set_mode (struct ata_port *ap); |
| 88 | 88 | ||
| 89 | 89 | ||
| 90 | static struct pci_device_id sil_pci_tbl[] = { | 90 | static const struct pci_device_id sil_pci_tbl[] = { |
| 91 | { 0x1095, 0x3112, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sil_3112_m15w }, | 91 | { 0x1095, 0x3112, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sil_3112_m15w }, |
| 92 | { 0x1095, 0x0240, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sil_3112_m15w }, | 92 | { 0x1095, 0x0240, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sil_3112_m15w }, |
| 93 | { 0x1095, 0x3512, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sil_3112 }, | 93 | { 0x1095, 0x3512, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sil_3112 }, |
diff --git a/drivers/scsi/sata_sil24.c b/drivers/scsi/sata_sil24.c index 4682a50650b4..d3198d9a72c1 100644 --- a/drivers/scsi/sata_sil24.c +++ b/drivers/scsi/sata_sil24.c | |||
| @@ -240,7 +240,7 @@ static void sil24_port_stop(struct ata_port *ap); | |||
| 240 | static void sil24_host_stop(struct ata_host_set *host_set); | 240 | static void sil24_host_stop(struct ata_host_set *host_set); |
| 241 | static int sil24_init_one(struct pci_dev *pdev, const struct pci_device_id *ent); | 241 | static int sil24_init_one(struct pci_dev *pdev, const struct pci_device_id *ent); |
| 242 | 242 | ||
| 243 | static struct pci_device_id sil24_pci_tbl[] = { | 243 | static const struct pci_device_id sil24_pci_tbl[] = { |
| 244 | { 0x1095, 0x3124, PCI_ANY_ID, PCI_ANY_ID, 0, 0, BID_SIL3124 }, | 244 | { 0x1095, 0x3124, PCI_ANY_ID, PCI_ANY_ID, 0, 0, BID_SIL3124 }, |
| 245 | { 0x1095, 0x3132, PCI_ANY_ID, PCI_ANY_ID, 0, 0, BID_SIL3132 }, | 245 | { 0x1095, 0x3132, PCI_ANY_ID, PCI_ANY_ID, 0, 0, BID_SIL3132 }, |
| 246 | { 0x1095, 0x3131, PCI_ANY_ID, PCI_ANY_ID, 0, 0, BID_SIL3131 }, | 246 | { 0x1095, 0x3131, PCI_ANY_ID, PCI_ANY_ID, 0, 0, BID_SIL3131 }, |
diff --git a/drivers/scsi/sata_sis.c b/drivers/scsi/sata_sis.c index 42d7c4e92501..32e12620b162 100644 --- a/drivers/scsi/sata_sis.c +++ b/drivers/scsi/sata_sis.c | |||
| @@ -67,7 +67,7 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent); | |||
| 67 | static u32 sis_scr_read (struct ata_port *ap, unsigned int sc_reg); | 67 | static u32 sis_scr_read (struct ata_port *ap, unsigned int sc_reg); |
| 68 | static void sis_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val); | 68 | static void sis_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val); |
| 69 | 69 | ||
| 70 | static struct pci_device_id sis_pci_tbl[] = { | 70 | static const struct pci_device_id sis_pci_tbl[] = { |
| 71 | { PCI_VENDOR_ID_SI, 0x180, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sis_180 }, | 71 | { PCI_VENDOR_ID_SI, 0x180, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sis_180 }, |
| 72 | { PCI_VENDOR_ID_SI, 0x181, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sis_180 }, | 72 | { PCI_VENDOR_ID_SI, 0x181, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sis_180 }, |
| 73 | { PCI_VENDOR_ID_SI, 0x182, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sis_180 }, | 73 | { PCI_VENDOR_ID_SI, 0x182, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sis_180 }, |
diff --git a/drivers/scsi/sata_svw.c b/drivers/scsi/sata_svw.c index 9895d1caefcf..57e5a9d964c3 100644 --- a/drivers/scsi/sata_svw.c +++ b/drivers/scsi/sata_svw.c | |||
| @@ -466,7 +466,7 @@ err_out: | |||
| 466 | * 0x24a is device ID for BCM5785 (aka HT1000) HT southbridge integrated SATA | 466 | * 0x24a is device ID for BCM5785 (aka HT1000) HT southbridge integrated SATA |
| 467 | * controller | 467 | * controller |
| 468 | * */ | 468 | * */ |
| 469 | static struct pci_device_id k2_sata_pci_tbl[] = { | 469 | static const struct pci_device_id k2_sata_pci_tbl[] = { |
| 470 | { 0x1166, 0x0240, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4 }, | 470 | { 0x1166, 0x0240, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4 }, |
| 471 | { 0x1166, 0x0241, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4 }, | 471 | { 0x1166, 0x0241, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4 }, |
| 472 | { 0x1166, 0x0242, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 8 }, | 472 | { 0x1166, 0x0242, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 8 }, |
diff --git a/drivers/scsi/sata_sx4.c b/drivers/scsi/sata_sx4.c index d5a38784352b..b4bbe48acab0 100644 --- a/drivers/scsi/sata_sx4.c +++ b/drivers/scsi/sata_sx4.c | |||
| @@ -229,7 +229,7 @@ static struct ata_port_info pdc_port_info[] = { | |||
| 229 | 229 | ||
| 230 | }; | 230 | }; |
| 231 | 231 | ||
| 232 | static struct pci_device_id pdc_sata_pci_tbl[] = { | 232 | static const struct pci_device_id pdc_sata_pci_tbl[] = { |
| 233 | { PCI_VENDOR_ID_PROMISE, 0x6622, PCI_ANY_ID, PCI_ANY_ID, 0, 0, | 233 | { PCI_VENDOR_ID_PROMISE, 0x6622, PCI_ANY_ID, PCI_ANY_ID, 0, 0, |
| 234 | board_20621 }, | 234 | board_20621 }, |
| 235 | { } /* terminate list */ | 235 | { } /* terminate list */ |
diff --git a/drivers/scsi/sata_uli.c b/drivers/scsi/sata_uli.c index cf0baaa4e045..b2422a0f25c8 100644 --- a/drivers/scsi/sata_uli.c +++ b/drivers/scsi/sata_uli.c | |||
| @@ -55,7 +55,7 @@ static int uli_init_one (struct pci_dev *pdev, const struct pci_device_id *ent); | |||
| 55 | static u32 uli_scr_read (struct ata_port *ap, unsigned int sc_reg); | 55 | static u32 uli_scr_read (struct ata_port *ap, unsigned int sc_reg); |
| 56 | static void uli_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val); | 56 | static void uli_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val); |
| 57 | 57 | ||
| 58 | static struct pci_device_id uli_pci_tbl[] = { | 58 | static const struct pci_device_id uli_pci_tbl[] = { |
| 59 | { PCI_VENDOR_ID_AL, 0x5289, PCI_ANY_ID, PCI_ANY_ID, 0, 0, uli_5289 }, | 59 | { PCI_VENDOR_ID_AL, 0x5289, PCI_ANY_ID, PCI_ANY_ID, 0, 0, uli_5289 }, |
| 60 | { PCI_VENDOR_ID_AL, 0x5287, PCI_ANY_ID, PCI_ANY_ID, 0, 0, uli_5287 }, | 60 | { PCI_VENDOR_ID_AL, 0x5287, PCI_ANY_ID, PCI_ANY_ID, 0, 0, uli_5287 }, |
| 61 | { PCI_VENDOR_ID_AL, 0x5281, PCI_ANY_ID, PCI_ANY_ID, 0, 0, uli_5281 }, | 61 | { PCI_VENDOR_ID_AL, 0x5281, PCI_ANY_ID, PCI_ANY_ID, 0, 0, uli_5281 }, |
diff --git a/drivers/scsi/sata_via.c b/drivers/scsi/sata_via.c index ab19d2ba2a4b..c76215692da2 100644 --- a/drivers/scsi/sata_via.c +++ b/drivers/scsi/sata_via.c | |||
| @@ -75,7 +75,7 @@ static int svia_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) | |||
| 75 | static u32 svia_scr_read (struct ata_port *ap, unsigned int sc_reg); | 75 | static u32 svia_scr_read (struct ata_port *ap, unsigned int sc_reg); |
| 76 | static void svia_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val); | 76 | static void svia_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val); |
| 77 | 77 | ||
| 78 | static struct pci_device_id svia_pci_tbl[] = { | 78 | static const struct pci_device_id svia_pci_tbl[] = { |
| 79 | { 0x1106, 0x3149, PCI_ANY_ID, PCI_ANY_ID, 0, 0, vt6420 }, | 79 | { 0x1106, 0x3149, PCI_ANY_ID, PCI_ANY_ID, 0, 0, vt6420 }, |
| 80 | { 0x1106, 0x3249, PCI_ANY_ID, PCI_ANY_ID, 0, 0, vt6421 }, | 80 | { 0x1106, 0x3249, PCI_ANY_ID, PCI_ANY_ID, 0, 0, vt6421 }, |
| 81 | 81 | ||
diff --git a/drivers/scsi/sata_vsc.c b/drivers/scsi/sata_vsc.c index ce8a2fd7da84..77a6e4b9262d 100644 --- a/drivers/scsi/sata_vsc.c +++ b/drivers/scsi/sata_vsc.c | |||
| @@ -400,7 +400,7 @@ err_out: | |||
| 400 | * 0x8086/0x3200 is the Intel 31244, which is supposed to be identical | 400 | * 0x8086/0x3200 is the Intel 31244, which is supposed to be identical |
| 401 | * compatibility is untested as of yet | 401 | * compatibility is untested as of yet |
| 402 | */ | 402 | */ |
| 403 | static struct pci_device_id vsc_sata_pci_tbl[] = { | 403 | static const struct pci_device_id vsc_sata_pci_tbl[] = { |
| 404 | { 0x1725, 0x7174, PCI_ANY_ID, PCI_ANY_ID, 0x10600, 0xFFFFFF, 0 }, | 404 | { 0x1725, 0x7174, PCI_ANY_ID, PCI_ANY_ID, 0x10600, 0xFFFFFF, 0 }, |
| 405 | { 0x8086, 0x3200, PCI_ANY_ID, PCI_ANY_ID, 0x10600, 0xFFFFFF, 0 }, | 405 | { 0x8086, 0x3200, PCI_ANY_ID, PCI_ANY_ID, 0x10600, 0xFFFFFF, 0 }, |
| 406 | { } | 406 | { } |
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index 98820603e75f..3742753241ee 100644 --- a/drivers/serial/8250.c +++ b/drivers/serial/8250.c | |||
| @@ -2381,9 +2381,9 @@ void serial8250_resume_port(int line) | |||
| 2381 | * list is terminated with a zero flags entry, which means we expect | 2381 | * list is terminated with a zero flags entry, which means we expect |
| 2382 | * all entries to have at least UPF_BOOT_AUTOCONF set. | 2382 | * all entries to have at least UPF_BOOT_AUTOCONF set. |
| 2383 | */ | 2383 | */ |
| 2384 | static int __devinit serial8250_probe(struct device *dev) | 2384 | static int __devinit serial8250_probe(struct platform_device *dev) |
| 2385 | { | 2385 | { |
| 2386 | struct plat_serial8250_port *p = dev->platform_data; | 2386 | struct plat_serial8250_port *p = dev->dev.platform_data; |
| 2387 | struct uart_port port; | 2387 | struct uart_port port; |
| 2388 | int ret, i; | 2388 | int ret, i; |
| 2389 | 2389 | ||
| @@ -2399,12 +2399,12 @@ static int __devinit serial8250_probe(struct device *dev) | |||
| 2399 | port.flags = p->flags; | 2399 | port.flags = p->flags; |
| 2400 | port.mapbase = p->mapbase; | 2400 | port.mapbase = p->mapbase; |
| 2401 | port.hub6 = p->hub6; | 2401 | port.hub6 = p->hub6; |
| 2402 | port.dev = dev; | 2402 | port.dev = &dev->dev; |
| 2403 | if (share_irqs) | 2403 | if (share_irqs) |
| 2404 | port.flags |= UPF_SHARE_IRQ; | 2404 | port.flags |= UPF_SHARE_IRQ; |
| 2405 | ret = serial8250_register_port(&port); | 2405 | ret = serial8250_register_port(&port); |
| 2406 | if (ret < 0) { | 2406 | if (ret < 0) { |
| 2407 | dev_err(dev, "unable to register port at index %d " | 2407 | dev_err(&dev->dev, "unable to register port at index %d " |
| 2408 | "(IO%lx MEM%lx IRQ%d): %d\n", i, | 2408 | "(IO%lx MEM%lx IRQ%d): %d\n", i, |
| 2409 | p->iobase, p->mapbase, p->irq, ret); | 2409 | p->iobase, p->mapbase, p->irq, ret); |
| 2410 | } | 2410 | } |
| @@ -2415,54 +2415,55 @@ static int __devinit serial8250_probe(struct device *dev) | |||
| 2415 | /* | 2415 | /* |
| 2416 | * Remove serial ports registered against a platform device. | 2416 | * Remove serial ports registered against a platform device. |
| 2417 | */ | 2417 | */ |
| 2418 | static int __devexit serial8250_remove(struct device *dev) | 2418 | static int __devexit serial8250_remove(struct platform_device *dev) |
| 2419 | { | 2419 | { |
| 2420 | int i; | 2420 | int i; |
| 2421 | 2421 | ||
| 2422 | for (i = 0; i < UART_NR; i++) { | 2422 | for (i = 0; i < UART_NR; i++) { |
| 2423 | struct uart_8250_port *up = &serial8250_ports[i]; | 2423 | struct uart_8250_port *up = &serial8250_ports[i]; |
| 2424 | 2424 | ||
| 2425 | if (up->port.dev == dev) | 2425 | if (up->port.dev == &dev->dev) |
| 2426 | serial8250_unregister_port(i); | 2426 | serial8250_unregister_port(i); |
| 2427 | } | 2427 | } |
| 2428 | return 0; | 2428 | return 0; |
| 2429 | } | 2429 | } |
| 2430 | 2430 | ||
| 2431 | static int serial8250_suspend(struct device *dev, pm_message_t state) | 2431 | static int serial8250_suspend(struct platform_device *dev, pm_message_t state) |
| 2432 | { | 2432 | { |
| 2433 | int i; | 2433 | int i; |
| 2434 | 2434 | ||
| 2435 | for (i = 0; i < UART_NR; i++) { | 2435 | for (i = 0; i < UART_NR; i++) { |
| 2436 | struct uart_8250_port *up = &serial8250_ports[i]; | 2436 | struct uart_8250_port *up = &serial8250_ports[i]; |
| 2437 | 2437 | ||
| 2438 | if (up->port.type != PORT_UNKNOWN && up->port.dev == dev) | 2438 | if (up->port.type != PORT_UNKNOWN && up->port.dev == &dev->dev) |
| 2439 | uart_suspend_port(&serial8250_reg, &up->port); | 2439 | uart_suspend_port(&serial8250_reg, &up->port); |
| 2440 | } | 2440 | } |
| 2441 | 2441 | ||
| 2442 | return 0; | 2442 | return 0; |
| 2443 | } | 2443 | } |
| 2444 | 2444 | ||
| 2445 | static int serial8250_resume(struct device *dev) | 2445 | static int serial8250_resume(struct platform_device *dev) |
| 2446 | { | 2446 | { |
| 2447 | int i; | 2447 | int i; |
| 2448 | 2448 | ||
| 2449 | for (i = 0; i < UART_NR; i++) { | 2449 | for (i = 0; i < UART_NR; i++) { |
| 2450 | struct uart_8250_port *up = &serial8250_ports[i]; | 2450 | struct uart_8250_port *up = &serial8250_ports[i]; |
| 2451 | 2451 | ||
| 2452 | if (up->port.type != PORT_UNKNOWN && up->port.dev == dev) | 2452 | if (up->port.type != PORT_UNKNOWN && up->port.dev == &dev->dev) |
| 2453 | uart_resume_port(&serial8250_reg, &up->port); | 2453 | uart_resume_port(&serial8250_reg, &up->port); |
| 2454 | } | 2454 | } |
| 2455 | 2455 | ||
| 2456 | return 0; | 2456 | return 0; |
| 2457 | } | 2457 | } |
| 2458 | 2458 | ||
| 2459 | static struct device_driver serial8250_isa_driver = { | 2459 | static struct platform_driver serial8250_isa_driver = { |
| 2460 | .name = "serial8250", | ||
| 2461 | .bus = &platform_bus_type, | ||
| 2462 | .probe = serial8250_probe, | 2460 | .probe = serial8250_probe, |
| 2463 | .remove = __devexit_p(serial8250_remove), | 2461 | .remove = __devexit_p(serial8250_remove), |
| 2464 | .suspend = serial8250_suspend, | 2462 | .suspend = serial8250_suspend, |
| 2465 | .resume = serial8250_resume, | 2463 | .resume = serial8250_resume, |
| 2464 | .driver = { | ||
| 2465 | .name = "serial8250", | ||
| 2466 | }, | ||
| 2466 | }; | 2467 | }; |
| 2467 | 2468 | ||
| 2468 | /* | 2469 | /* |
| @@ -2608,7 +2609,7 @@ static int __init serial8250_init(void) | |||
| 2608 | 2609 | ||
| 2609 | serial8250_register_ports(&serial8250_reg, &serial8250_isa_devs->dev); | 2610 | serial8250_register_ports(&serial8250_reg, &serial8250_isa_devs->dev); |
| 2610 | 2611 | ||
| 2611 | ret = driver_register(&serial8250_isa_driver); | 2612 | ret = platform_driver_register(&serial8250_isa_driver); |
| 2612 | if (ret == 0) | 2613 | if (ret == 0) |
| 2613 | goto out; | 2614 | goto out; |
| 2614 | 2615 | ||
| @@ -2630,7 +2631,7 @@ static void __exit serial8250_exit(void) | |||
| 2630 | */ | 2631 | */ |
| 2631 | serial8250_isa_devs = NULL; | 2632 | serial8250_isa_devs = NULL; |
| 2632 | 2633 | ||
| 2633 | driver_unregister(&serial8250_isa_driver); | 2634 | platform_driver_unregister(&serial8250_isa_driver); |
| 2634 | platform_device_unregister(isa_dev); | 2635 | platform_device_unregister(isa_dev); |
| 2635 | 2636 | ||
| 2636 | uart_unregister_driver(&serial8250_reg); | 2637 | uart_unregister_driver(&serial8250_reg); |
diff --git a/drivers/serial/imx.c b/drivers/serial/imx.c index 4a54ff584700..355cd93a8a87 100644 --- a/drivers/serial/imx.c +++ b/drivers/serial/imx.c | |||
| @@ -921,9 +921,9 @@ static struct uart_driver imx_reg = { | |||
| 921 | .cons = IMX_CONSOLE, | 921 | .cons = IMX_CONSOLE, |
| 922 | }; | 922 | }; |
| 923 | 923 | ||
| 924 | static int serial_imx_suspend(struct device *_dev, pm_message_t state) | 924 | static int serial_imx_suspend(struct platform_device *dev, pm_message_t state) |
| 925 | { | 925 | { |
| 926 | struct imx_port *sport = dev_get_drvdata(_dev); | 926 | struct imx_port *sport = platform_get_drvdata(dev); |
| 927 | 927 | ||
| 928 | if (sport) | 928 | if (sport) |
| 929 | uart_suspend_port(&imx_reg, &sport->port); | 929 | uart_suspend_port(&imx_reg, &sport->port); |
| @@ -931,9 +931,9 @@ static int serial_imx_suspend(struct device *_dev, pm_message_t state) | |||
| 931 | return 0; | 931 | return 0; |
| 932 | } | 932 | } |
| 933 | 933 | ||
| 934 | static int serial_imx_resume(struct device *_dev) | 934 | static int serial_imx_resume(struct platform_device *dev) |
| 935 | { | 935 | { |
| 936 | struct imx_port *sport = dev_get_drvdata(_dev); | 936 | struct imx_port *sport = platform_get_drvdata(dev); |
| 937 | 937 | ||
| 938 | if (sport) | 938 | if (sport) |
| 939 | uart_resume_port(&imx_reg, &sport->port); | 939 | uart_resume_port(&imx_reg, &sport->port); |
| @@ -941,21 +941,19 @@ static int serial_imx_resume(struct device *_dev) | |||
| 941 | return 0; | 941 | return 0; |
| 942 | } | 942 | } |
| 943 | 943 | ||
| 944 | static int serial_imx_probe(struct device *_dev) | 944 | static int serial_imx_probe(struct platform_device *dev) |
| 945 | { | 945 | { |
| 946 | struct platform_device *dev = to_platform_device(_dev); | 946 | imx_ports[dev->id].port.dev = &dev->dev; |
| 947 | |||
| 948 | imx_ports[dev->id].port.dev = _dev; | ||
| 949 | uart_add_one_port(&imx_reg, &imx_ports[dev->id].port); | 947 | uart_add_one_port(&imx_reg, &imx_ports[dev->id].port); |
| 950 | dev_set_drvdata(_dev, &imx_ports[dev->id]); | 948 | platform_set_drvdata(dev, &imx_ports[dev->id]); |
| 951 | return 0; | 949 | return 0; |
| 952 | } | 950 | } |
| 953 | 951 | ||
| 954 | static int serial_imx_remove(struct device *_dev) | 952 | static int serial_imx_remove(struct platform_device *dev) |
| 955 | { | 953 | { |
| 956 | struct imx_port *sport = dev_get_drvdata(_dev); | 954 | struct imx_port *sport = platform_get_drvdata(dev); |
| 957 | 955 | ||
| 958 | dev_set_drvdata(_dev, NULL); | 956 | platform_set_drvdata(dev, NULL); |
| 959 | 957 | ||
| 960 | if (sport) | 958 | if (sport) |
| 961 | uart_remove_one_port(&imx_reg, &sport->port); | 959 | uart_remove_one_port(&imx_reg, &sport->port); |
| @@ -963,14 +961,15 @@ static int serial_imx_remove(struct device *_dev) | |||
| 963 | return 0; | 961 | return 0; |
| 964 | } | 962 | } |
| 965 | 963 | ||
| 966 | static struct device_driver serial_imx_driver = { | 964 | static struct platform_driver serial_imx_driver = { |
| 967 | .name = "imx-uart", | ||
| 968 | .bus = &platform_bus_type, | ||
| 969 | .probe = serial_imx_probe, | 965 | .probe = serial_imx_probe, |
| 970 | .remove = serial_imx_remove, | 966 | .remove = serial_imx_remove, |
| 971 | 967 | ||
| 972 | .suspend = serial_imx_suspend, | 968 | .suspend = serial_imx_suspend, |
| 973 | .resume = serial_imx_resume, | 969 | .resume = serial_imx_resume, |
| 970 | .driver = { | ||
| 971 | .name = "imx-uart", | ||
| 972 | }, | ||
| 974 | }; | 973 | }; |
| 975 | 974 | ||
| 976 | static int __init imx_serial_init(void) | 975 | static int __init imx_serial_init(void) |
| @@ -985,7 +984,7 @@ static int __init imx_serial_init(void) | |||
| 985 | if (ret) | 984 | if (ret) |
| 986 | return ret; | 985 | return ret; |
| 987 | 986 | ||
| 988 | ret = driver_register(&serial_imx_driver); | 987 | ret = platform_driver_register(&serial_imx_driver); |
| 989 | if (ret != 0) | 988 | if (ret != 0) |
| 990 | uart_unregister_driver(&imx_reg); | 989 | uart_unregister_driver(&imx_reg); |
| 991 | 990 | ||
diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c index 0dd08a09e7e6..5d3cb8486447 100644 --- a/drivers/serial/mpc52xx_uart.c +++ b/drivers/serial/mpc52xx_uart.c | |||
| @@ -717,10 +717,9 @@ 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; |
| @@ -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,9 +780,9 @@ 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) | 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) | 787 | if (sport) |
| 789 | uart_suspend_port(&mpc52xx_uart_driver, port); | 788 | uart_suspend_port(&mpc52xx_uart_driver, port); |
| @@ -792,9 +791,9 @@ mpc52xx_uart_suspend(struct device *dev, pm_message_t state) | |||
| 792 | } | 791 | } |
| 793 | 792 | ||
| 794 | static int | 793 | static int |
| 795 | mpc52xx_uart_resume(struct device *dev) | 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) | 798 | if (port) |
| 800 | uart_resume_port(&mpc52xx_uart_driver, port); | 799 | uart_resume_port(&mpc52xx_uart_driver, port); |
| @@ -803,15 +802,16 @@ mpc52xx_uart_resume(struct device *dev) | |||
| 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 | ||
diff --git a/drivers/serial/mpsc.c b/drivers/serial/mpsc.c index ba8838b234da..8f83e4007ecd 100644 --- a/drivers/serial/mpsc.c +++ b/drivers/serial/mpsc.c | |||
| @@ -1551,15 +1551,14 @@ mpsc_shared_unmap_regs(void) | |||
| 1551 | } | 1551 | } |
| 1552 | 1552 | ||
| 1553 | static int | 1553 | static int |
| 1554 | mpsc_shared_drv_probe(struct device *dev) | 1554 | mpsc_shared_drv_probe(struct platform_device *dev) |
| 1555 | { | 1555 | { |
| 1556 | struct platform_device *pd = to_platform_device(dev); | ||
| 1557 | struct mpsc_shared_pdata *pdata; | 1556 | struct mpsc_shared_pdata *pdata; |
| 1558 | int rc = -ENODEV; | 1557 | int rc = -ENODEV; |
| 1559 | 1558 | ||
| 1560 | if (pd->id == 0) { | 1559 | if (dev->id == 0) { |
| 1561 | if (!(rc = mpsc_shared_map_regs(pd))) { | 1560 | if (!(rc = mpsc_shared_map_regs(dev))) { |
| 1562 | pdata = (struct mpsc_shared_pdata *)dev->platform_data; | 1561 | pdata = (struct mpsc_shared_pdata *)dev->dev.platform_data; |
| 1563 | 1562 | ||
| 1564 | mpsc_shared_regs.MPSC_MRR_m = pdata->mrr_val; | 1563 | mpsc_shared_regs.MPSC_MRR_m = pdata->mrr_val; |
| 1565 | mpsc_shared_regs.MPSC_RCRR_m= pdata->rcrr_val; | 1564 | mpsc_shared_regs.MPSC_RCRR_m= pdata->rcrr_val; |
| @@ -1577,12 +1576,11 @@ mpsc_shared_drv_probe(struct device *dev) | |||
| 1577 | } | 1576 | } |
| 1578 | 1577 | ||
| 1579 | static int | 1578 | static int |
| 1580 | mpsc_shared_drv_remove(struct device *dev) | 1579 | mpsc_shared_drv_remove(struct platform_device *dev) |
| 1581 | { | 1580 | { |
| 1582 | struct platform_device *pd = to_platform_device(dev); | ||
| 1583 | int rc = -ENODEV; | 1581 | int rc = -ENODEV; |
| 1584 | 1582 | ||
| 1585 | if (pd->id == 0) { | 1583 | if (dev->id == 0) { |
| 1586 | mpsc_shared_unmap_regs(); | 1584 | mpsc_shared_unmap_regs(); |
| 1587 | mpsc_shared_regs.MPSC_MRR_m = 0; | 1585 | mpsc_shared_regs.MPSC_MRR_m = 0; |
| 1588 | mpsc_shared_regs.MPSC_RCRR_m = 0; | 1586 | mpsc_shared_regs.MPSC_RCRR_m = 0; |
| @@ -1595,11 +1593,12 @@ mpsc_shared_drv_remove(struct device *dev) | |||
| 1595 | return rc; | 1593 | return rc; |
| 1596 | } | 1594 | } |
| 1597 | 1595 | ||
| 1598 | static struct device_driver mpsc_shared_driver = { | 1596 | static struct platform_driver mpsc_shared_driver = { |
| 1599 | .name = MPSC_SHARED_NAME, | ||
| 1600 | .bus = &platform_bus_type, | ||
| 1601 | .probe = mpsc_shared_drv_probe, | 1597 | .probe = mpsc_shared_drv_probe, |
| 1602 | .remove = mpsc_shared_drv_remove, | 1598 | .remove = mpsc_shared_drv_remove, |
| 1599 | .driver = { | ||
| 1600 | .name = MPSC_SHARED_NAME, | ||
| 1601 | }, | ||
| 1603 | }; | 1602 | }; |
| 1604 | 1603 | ||
| 1605 | /* | 1604 | /* |
| @@ -1732,19 +1731,18 @@ mpsc_drv_get_platform_data(struct mpsc_port_info *pi, | |||
| 1732 | } | 1731 | } |
| 1733 | 1732 | ||
| 1734 | static int | 1733 | static int |
| 1735 | mpsc_drv_probe(struct device *dev) | 1734 | mpsc_drv_probe(struct platform_device *dev) |
| 1736 | { | 1735 | { |
| 1737 | struct platform_device *pd = to_platform_device(dev); | ||
| 1738 | struct mpsc_port_info *pi; | 1736 | struct mpsc_port_info *pi; |
| 1739 | int rc = -ENODEV; | 1737 | int rc = -ENODEV; |
| 1740 | 1738 | ||
| 1741 | pr_debug("mpsc_drv_probe: Adding MPSC %d\n", pd->id); | 1739 | pr_debug("mpsc_drv_probe: Adding MPSC %d\n", dev->id); |
| 1742 | 1740 | ||
| 1743 | if (pd->id < MPSC_NUM_CTLRS) { | 1741 | if (dev->id < MPSC_NUM_CTLRS) { |
| 1744 | pi = &mpsc_ports[pd->id]; | 1742 | pi = &mpsc_ports[dev->id]; |
| 1745 | 1743 | ||
| 1746 | if (!(rc = mpsc_drv_map_regs(pi, pd))) { | 1744 | if (!(rc = mpsc_drv_map_regs(pi, dev))) { |
| 1747 | mpsc_drv_get_platform_data(pi, pd, pd->id); | 1745 | mpsc_drv_get_platform_data(pi, dev, dev->id); |
| 1748 | 1746 | ||
| 1749 | if (!(rc = mpsc_make_ready(pi))) | 1747 | if (!(rc = mpsc_make_ready(pi))) |
| 1750 | if (!(rc = uart_add_one_port(&mpsc_reg, | 1748 | if (!(rc = uart_add_one_port(&mpsc_reg, |
| @@ -1764,27 +1762,26 @@ mpsc_drv_probe(struct device *dev) | |||
| 1764 | } | 1762 | } |
| 1765 | 1763 | ||
| 1766 | static int | 1764 | static int |
| 1767 | mpsc_drv_remove(struct device *dev) | 1765 | mpsc_drv_remove(struct platform_device *dev) |
| 1768 | { | 1766 | { |
| 1769 | struct platform_device *pd = to_platform_device(dev); | 1767 | pr_debug("mpsc_drv_exit: Removing MPSC %d\n", dev->id); |
| 1770 | 1768 | ||
| 1771 | pr_debug("mpsc_drv_exit: Removing MPSC %d\n", pd->id); | 1769 | if (dev->id < MPSC_NUM_CTLRS) { |
| 1772 | 1770 | uart_remove_one_port(&mpsc_reg, &mpsc_ports[dev->id].port); | |
| 1773 | if (pd->id < MPSC_NUM_CTLRS) { | 1771 | mpsc_release_port((struct uart_port *)&mpsc_ports[dev->id].port); |
| 1774 | uart_remove_one_port(&mpsc_reg, &mpsc_ports[pd->id].port); | 1772 | mpsc_drv_unmap_regs(&mpsc_ports[dev->id]); |
| 1775 | mpsc_release_port((struct uart_port *)&mpsc_ports[pd->id].port); | ||
| 1776 | mpsc_drv_unmap_regs(&mpsc_ports[pd->id]); | ||
| 1777 | return 0; | 1773 | return 0; |
| 1778 | } | 1774 | } |
| 1779 | else | 1775 | else |
| 1780 | return -ENODEV; | 1776 | return -ENODEV; |
| 1781 | } | 1777 | } |
| 1782 | 1778 | ||
| 1783 | static struct device_driver mpsc_driver = { | 1779 | static struct platform_driver mpsc_driver = { |
| 1784 | .name = MPSC_CTLR_NAME, | ||
| 1785 | .bus = &platform_bus_type, | ||
| 1786 | .probe = mpsc_drv_probe, | 1780 | .probe = mpsc_drv_probe, |
| 1787 | .remove = mpsc_drv_remove, | 1781 | .remove = mpsc_drv_remove, |
| 1782 | .driver = { | ||
| 1783 | .name = MPSC_CTLR_NAME, | ||
| 1784 | }, | ||
| 1788 | }; | 1785 | }; |
| 1789 | 1786 | ||
| 1790 | static int __init | 1787 | static int __init |
| @@ -1798,9 +1795,9 @@ mpsc_drv_init(void) | |||
| 1798 | memset(&mpsc_shared_regs, 0, sizeof(mpsc_shared_regs)); | 1795 | memset(&mpsc_shared_regs, 0, sizeof(mpsc_shared_regs)); |
| 1799 | 1796 | ||
| 1800 | if (!(rc = uart_register_driver(&mpsc_reg))) { | 1797 | if (!(rc = uart_register_driver(&mpsc_reg))) { |
| 1801 | if (!(rc = driver_register(&mpsc_shared_driver))) { | 1798 | if (!(rc = platform_driver_register(&mpsc_shared_driver))) { |
| 1802 | if ((rc = driver_register(&mpsc_driver))) { | 1799 | if ((rc = platform_driver_register(&mpsc_driver))) { |
| 1803 | driver_unregister(&mpsc_shared_driver); | 1800 | platform_driver_unregister(&mpsc_shared_driver); |
| 1804 | uart_unregister_driver(&mpsc_reg); | 1801 | uart_unregister_driver(&mpsc_reg); |
| 1805 | } | 1802 | } |
| 1806 | } | 1803 | } |
| @@ -1815,8 +1812,8 @@ mpsc_drv_init(void) | |||
| 1815 | static void __exit | 1812 | static void __exit |
| 1816 | mpsc_drv_exit(void) | 1813 | mpsc_drv_exit(void) |
| 1817 | { | 1814 | { |
| 1818 | driver_unregister(&mpsc_driver); | 1815 | platform_driver_unregister(&mpsc_driver); |
| 1819 | driver_unregister(&mpsc_shared_driver); | 1816 | platform_driver_unregister(&mpsc_shared_driver); |
| 1820 | uart_unregister_driver(&mpsc_reg); | 1817 | uart_unregister_driver(&mpsc_reg); |
| 1821 | memset(mpsc_ports, 0, sizeof(mpsc_ports)); | 1818 | memset(mpsc_ports, 0, sizeof(mpsc_ports)); |
| 1822 | memset(&mpsc_shared_regs, 0, sizeof(mpsc_shared_regs)); | 1819 | memset(&mpsc_shared_regs, 0, sizeof(mpsc_shared_regs)); |
diff --git a/drivers/serial/pxa.c b/drivers/serial/pxa.c index 16b2f9417af9..ff5e6309d682 100644 --- a/drivers/serial/pxa.c +++ b/drivers/serial/pxa.c | |||
| @@ -805,9 +805,9 @@ static struct uart_driver serial_pxa_reg = { | |||
| 805 | .cons = PXA_CONSOLE, | 805 | .cons = PXA_CONSOLE, |
| 806 | }; | 806 | }; |
| 807 | 807 | ||
| 808 | static int serial_pxa_suspend(struct device *_dev, pm_message_t state) | 808 | static int serial_pxa_suspend(struct platform_device *dev, pm_message_t state) |
| 809 | { | 809 | { |
| 810 | struct uart_pxa_port *sport = dev_get_drvdata(_dev); | 810 | struct uart_pxa_port *sport = platform_get_drvdata(dev); |
| 811 | 811 | ||
| 812 | if (sport) | 812 | if (sport) |
| 813 | uart_suspend_port(&serial_pxa_reg, &sport->port); | 813 | uart_suspend_port(&serial_pxa_reg, &sport->port); |
| @@ -815,9 +815,9 @@ static int serial_pxa_suspend(struct device *_dev, pm_message_t state) | |||
| 815 | return 0; | 815 | return 0; |
| 816 | } | 816 | } |
| 817 | 817 | ||
| 818 | static int serial_pxa_resume(struct device *_dev) | 818 | static int serial_pxa_resume(struct platform_device *dev) |
| 819 | { | 819 | { |
| 820 | struct uart_pxa_port *sport = dev_get_drvdata(_dev); | 820 | struct uart_pxa_port *sport = platform_get_drvdata(dev); |
| 821 | 821 | ||
| 822 | if (sport) | 822 | if (sport) |
| 823 | uart_resume_port(&serial_pxa_reg, &sport->port); | 823 | uart_resume_port(&serial_pxa_reg, &sport->port); |
| @@ -825,21 +825,19 @@ static int serial_pxa_resume(struct device *_dev) | |||
| 825 | return 0; | 825 | return 0; |
| 826 | } | 826 | } |
| 827 | 827 | ||
| 828 | static int serial_pxa_probe(struct device *_dev) | 828 | static int serial_pxa_probe(struct platform_device *dev) |
| 829 | { | 829 | { |
| 830 | struct platform_device *dev = to_platform_device(_dev); | 830 | serial_pxa_ports[dev->id].port.dev = &dev->dev; |
| 831 | |||
| 832 | serial_pxa_ports[dev->id].port.dev = _dev; | ||
| 833 | uart_add_one_port(&serial_pxa_reg, &serial_pxa_ports[dev->id].port); | 831 | uart_add_one_port(&serial_pxa_reg, &serial_pxa_ports[dev->id].port); |
| 834 | dev_set_drvdata(_dev, &serial_pxa_ports[dev->id]); | 832 | platform_set_drvdata(dev, &serial_pxa_ports[dev->id]); |
| 835 | return 0; | 833 | return 0; |
| 836 | } | 834 | } |
| 837 | 835 | ||
| 838 | static int serial_pxa_remove(struct device *_dev) | 836 | static int serial_pxa_remove(struct platform_device *dev) |
| 839 | { | 837 | { |
| 840 | struct uart_pxa_port *sport = dev_get_drvdata(_dev); | 838 | struct uart_pxa_port *sport = platform_get_drvdata(dev); |
| 841 | 839 | ||
| 842 | dev_set_drvdata(_dev, NULL); | 840 | platform_set_drvdata(dev, NULL); |
| 843 | 841 | ||
| 844 | if (sport) | 842 | if (sport) |
| 845 | uart_remove_one_port(&serial_pxa_reg, &sport->port); | 843 | uart_remove_one_port(&serial_pxa_reg, &sport->port); |
| @@ -847,14 +845,15 @@ static int serial_pxa_remove(struct device *_dev) | |||
| 847 | return 0; | 845 | return 0; |
| 848 | } | 846 | } |
| 849 | 847 | ||
| 850 | static struct device_driver serial_pxa_driver = { | 848 | static struct platform_driver serial_pxa_driver = { |
| 851 | .name = "pxa2xx-uart", | ||
| 852 | .bus = &platform_bus_type, | ||
| 853 | .probe = serial_pxa_probe, | 849 | .probe = serial_pxa_probe, |
| 854 | .remove = serial_pxa_remove, | 850 | .remove = serial_pxa_remove, |
| 855 | 851 | ||
| 856 | .suspend = serial_pxa_suspend, | 852 | .suspend = serial_pxa_suspend, |
| 857 | .resume = serial_pxa_resume, | 853 | .resume = serial_pxa_resume, |
| 854 | .driver = { | ||
| 855 | .name = "pxa2xx-uart", | ||
| 856 | }, | ||
| 858 | }; | 857 | }; |
| 859 | 858 | ||
| 860 | int __init serial_pxa_init(void) | 859 | int __init serial_pxa_init(void) |
| @@ -865,7 +864,7 @@ int __init serial_pxa_init(void) | |||
| 865 | if (ret != 0) | 864 | if (ret != 0) |
| 866 | return ret; | 865 | return ret; |
| 867 | 866 | ||
| 868 | ret = driver_register(&serial_pxa_driver); | 867 | ret = platform_driver_register(&serial_pxa_driver); |
| 869 | if (ret != 0) | 868 | if (ret != 0) |
| 870 | uart_unregister_driver(&serial_pxa_reg); | 869 | uart_unregister_driver(&serial_pxa_reg); |
| 871 | 870 | ||
| @@ -874,7 +873,7 @@ int __init serial_pxa_init(void) | |||
| 874 | 873 | ||
| 875 | void __exit serial_pxa_exit(void) | 874 | void __exit serial_pxa_exit(void) |
| 876 | { | 875 | { |
| 877 | driver_unregister(&serial_pxa_driver); | 876 | platform_driver_unregister(&serial_pxa_driver); |
| 878 | uart_unregister_driver(&serial_pxa_reg); | 877 | uart_unregister_driver(&serial_pxa_reg); |
| 879 | } | 878 | } |
| 880 | 879 | ||
diff --git a/drivers/serial/s3c2410.c b/drivers/serial/s3c2410.c index 036792328d49..47681c4654e4 100644 --- a/drivers/serial/s3c2410.c +++ b/drivers/serial/s3c2410.c | |||
| @@ -1092,14 +1092,13 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport, | |||
| 1092 | 1092 | ||
| 1093 | static int probe_index = 0; | 1093 | static int probe_index = 0; |
| 1094 | 1094 | ||
| 1095 | static int s3c24xx_serial_probe(struct device *_dev, | 1095 | static int s3c24xx_serial_probe(struct platform_device *dev, |
| 1096 | struct s3c24xx_uart_info *info) | 1096 | struct s3c24xx_uart_info *info) |
| 1097 | { | 1097 | { |
| 1098 | struct s3c24xx_uart_port *ourport; | 1098 | struct s3c24xx_uart_port *ourport; |
| 1099 | struct platform_device *dev = to_platform_device(_dev); | ||
| 1100 | int ret; | 1099 | int ret; |
| 1101 | 1100 | ||
| 1102 | dbg("s3c24xx_serial_probe(%p, %p) %d\n", _dev, info, probe_index); | 1101 | dbg("s3c24xx_serial_probe(%p, %p) %d\n", dev, info, probe_index); |
| 1103 | 1102 | ||
| 1104 | ourport = &s3c24xx_serial_ports[probe_index]; | 1103 | ourport = &s3c24xx_serial_ports[probe_index]; |
| 1105 | probe_index++; | 1104 | probe_index++; |
| @@ -1112,7 +1111,7 @@ static int s3c24xx_serial_probe(struct device *_dev, | |||
| 1112 | 1111 | ||
| 1113 | dbg("%s: adding port\n", __FUNCTION__); | 1112 | dbg("%s: adding port\n", __FUNCTION__); |
| 1114 | uart_add_one_port(&s3c24xx_uart_drv, &ourport->port); | 1113 | uart_add_one_port(&s3c24xx_uart_drv, &ourport->port); |
| 1115 | dev_set_drvdata(_dev, &ourport->port); | 1114 | platform_set_drvdata(dev, &ourport->port); |
| 1116 | 1115 | ||
| 1117 | return 0; | 1116 | return 0; |
| 1118 | 1117 | ||
| @@ -1120,9 +1119,9 @@ static int s3c24xx_serial_probe(struct device *_dev, | |||
| 1120 | return ret; | 1119 | return ret; |
| 1121 | } | 1120 | } |
| 1122 | 1121 | ||
| 1123 | static int s3c24xx_serial_remove(struct device *_dev) | 1122 | static int s3c24xx_serial_remove(struct platform_device *dev) |
| 1124 | { | 1123 | { |
| 1125 | struct uart_port *port = s3c24xx_dev_to_port(_dev); | 1124 | struct uart_port *port = s3c24xx_dev_to_port(&dev->dev); |
| 1126 | 1125 | ||
| 1127 | if (port) | 1126 | if (port) |
| 1128 | uart_remove_one_port(&s3c24xx_uart_drv, port); | 1127 | uart_remove_one_port(&s3c24xx_uart_drv, port); |
| @@ -1134,9 +1133,9 @@ static int s3c24xx_serial_remove(struct device *_dev) | |||
| 1134 | 1133 | ||
| 1135 | #ifdef CONFIG_PM | 1134 | #ifdef CONFIG_PM |
| 1136 | 1135 | ||
| 1137 | static int s3c24xx_serial_suspend(struct device *dev, pm_message_t state) | 1136 | static int s3c24xx_serial_suspend(struct platform_device *dev, pm_message_t state) |
| 1138 | { | 1137 | { |
| 1139 | struct uart_port *port = s3c24xx_dev_to_port(dev); | 1138 | struct uart_port *port = s3c24xx_dev_to_port(&dev->dev); |
| 1140 | 1139 | ||
| 1141 | if (port) | 1140 | if (port) |
| 1142 | uart_suspend_port(&s3c24xx_uart_drv, port); | 1141 | uart_suspend_port(&s3c24xx_uart_drv, port); |
| @@ -1144,9 +1143,9 @@ static int s3c24xx_serial_suspend(struct device *dev, pm_message_t state) | |||
| 1144 | return 0; | 1143 | return 0; |
| 1145 | } | 1144 | } |
| 1146 | 1145 | ||
| 1147 | static int s3c24xx_serial_resume(struct device *dev) | 1146 | static int s3c24xx_serial_resume(struct platform_device *dev) |
| 1148 | { | 1147 | { |
| 1149 | struct uart_port *port = s3c24xx_dev_to_port(dev); | 1148 | struct uart_port *port = s3c24xx_dev_to_port(&dev->dev); |
| 1150 | struct s3c24xx_uart_port *ourport = to_ourport(port); | 1149 | struct s3c24xx_uart_port *ourport = to_ourport(port); |
| 1151 | 1150 | ||
| 1152 | if (port) { | 1151 | if (port) { |
| @@ -1165,11 +1164,11 @@ static int s3c24xx_serial_resume(struct device *dev) | |||
| 1165 | #define s3c24xx_serial_resume NULL | 1164 | #define s3c24xx_serial_resume NULL |
| 1166 | #endif | 1165 | #endif |
| 1167 | 1166 | ||
| 1168 | static int s3c24xx_serial_init(struct device_driver *drv, | 1167 | static int s3c24xx_serial_init(struct platform_driver *drv, |
| 1169 | struct s3c24xx_uart_info *info) | 1168 | struct s3c24xx_uart_info *info) |
| 1170 | { | 1169 | { |
| 1171 | dbg("s3c24xx_serial_init(%p,%p)\n", drv, info); | 1170 | dbg("s3c24xx_serial_init(%p,%p)\n", drv, info); |
| 1172 | return driver_register(drv); | 1171 | return platform_driver_register(drv); |
| 1173 | } | 1172 | } |
| 1174 | 1173 | ||
| 1175 | 1174 | ||
| @@ -1228,19 +1227,20 @@ static struct s3c24xx_uart_info s3c2400_uart_inf = { | |||
| 1228 | .reset_port = s3c2400_serial_resetport, | 1227 | .reset_port = s3c2400_serial_resetport, |
| 1229 | }; | 1228 | }; |
| 1230 | 1229 | ||
| 1231 | static int s3c2400_serial_probe(struct device *dev) | 1230 | static int s3c2400_serial_probe(struct platform_device *dev) |
| 1232 | { | 1231 | { |
| 1233 | return s3c24xx_serial_probe(dev, &s3c2400_uart_inf); | 1232 | return s3c24xx_serial_probe(dev, &s3c2400_uart_inf); |
| 1234 | } | 1233 | } |
| 1235 | 1234 | ||
| 1236 | static struct device_driver s3c2400_serial_drv = { | 1235 | static struct platform_driver s3c2400_serial_drv = { |
| 1237 | .name = "s3c2400-uart", | ||
| 1238 | .owner = THIS_MODULE, | ||
| 1239 | .bus = &platform_bus_type, | ||
| 1240 | .probe = s3c2400_serial_probe, | 1236 | .probe = s3c2400_serial_probe, |
| 1241 | .remove = s3c24xx_serial_remove, | 1237 | .remove = s3c24xx_serial_remove, |
| 1242 | .suspend = s3c24xx_serial_suspend, | 1238 | .suspend = s3c24xx_serial_suspend, |
| 1243 | .resume = s3c24xx_serial_resume, | 1239 | .resume = s3c24xx_serial_resume, |
| 1240 | .driver = { | ||
| 1241 | .name = "s3c2400-uart", | ||
| 1242 | .owner = THIS_MODULE, | ||
| 1243 | }, | ||
| 1244 | }; | 1244 | }; |
| 1245 | 1245 | ||
| 1246 | static inline int s3c2400_serial_init(void) | 1246 | static inline int s3c2400_serial_init(void) |
| @@ -1250,7 +1250,7 @@ static inline int s3c2400_serial_init(void) | |||
| 1250 | 1250 | ||
| 1251 | static inline void s3c2400_serial_exit(void) | 1251 | static inline void s3c2400_serial_exit(void) |
| 1252 | { | 1252 | { |
| 1253 | driver_unregister(&s3c2400_serial_drv); | 1253 | platform_driver_unregister(&s3c2400_serial_drv); |
| 1254 | } | 1254 | } |
| 1255 | 1255 | ||
| 1256 | #define s3c2400_uart_inf_at &s3c2400_uart_inf | 1256 | #define s3c2400_uart_inf_at &s3c2400_uart_inf |
| @@ -1332,19 +1332,20 @@ static struct s3c24xx_uart_info s3c2410_uart_inf = { | |||
| 1332 | 1332 | ||
| 1333 | /* device management */ | 1333 | /* device management */ |
| 1334 | 1334 | ||
| 1335 | static int s3c2410_serial_probe(struct device *dev) | 1335 | static int s3c2410_serial_probe(struct platform_device *dev) |
| 1336 | { | 1336 | { |
| 1337 | return s3c24xx_serial_probe(dev, &s3c2410_uart_inf); | 1337 | return s3c24xx_serial_probe(dev, &s3c2410_uart_inf); |
| 1338 | } | 1338 | } |
| 1339 | 1339 | ||
| 1340 | static struct device_driver s3c2410_serial_drv = { | 1340 | static struct platform_driver s3c2410_serial_drv = { |
| 1341 | .name = "s3c2410-uart", | ||
| 1342 | .owner = THIS_MODULE, | ||
| 1343 | .bus = &platform_bus_type, | ||
| 1344 | .probe = s3c2410_serial_probe, | 1341 | .probe = s3c2410_serial_probe, |
| 1345 | .remove = s3c24xx_serial_remove, | 1342 | .remove = s3c24xx_serial_remove, |
| 1346 | .suspend = s3c24xx_serial_suspend, | 1343 | .suspend = s3c24xx_serial_suspend, |
| 1347 | .resume = s3c24xx_serial_resume, | 1344 | .resume = s3c24xx_serial_resume, |
| 1345 | .driver = { | ||
| 1346 | .name = "s3c2410-uart", | ||
| 1347 | .owner = THIS_MODULE, | ||
| 1348 | }, | ||
| 1348 | }; | 1349 | }; |
| 1349 | 1350 | ||
| 1350 | static inline int s3c2410_serial_init(void) | 1351 | static inline int s3c2410_serial_init(void) |
| @@ -1354,7 +1355,7 @@ static inline int s3c2410_serial_init(void) | |||
| 1354 | 1355 | ||
| 1355 | static inline void s3c2410_serial_exit(void) | 1356 | static inline void s3c2410_serial_exit(void) |
| 1356 | { | 1357 | { |
| 1357 | driver_unregister(&s3c2410_serial_drv); | 1358 | platform_driver_unregister(&s3c2410_serial_drv); |
| 1358 | } | 1359 | } |
| 1359 | 1360 | ||
| 1360 | #define s3c2410_uart_inf_at &s3c2410_uart_inf | 1361 | #define s3c2410_uart_inf_at &s3c2410_uart_inf |
| @@ -1493,20 +1494,21 @@ static struct s3c24xx_uart_info s3c2440_uart_inf = { | |||
| 1493 | 1494 | ||
| 1494 | /* device management */ | 1495 | /* device management */ |
| 1495 | 1496 | ||
| 1496 | static int s3c2440_serial_probe(struct device *dev) | 1497 | static int s3c2440_serial_probe(struct platform_device *dev) |
| 1497 | { | 1498 | { |
| 1498 | dbg("s3c2440_serial_probe: dev=%p\n", dev); | 1499 | dbg("s3c2440_serial_probe: dev=%p\n", dev); |
| 1499 | return s3c24xx_serial_probe(dev, &s3c2440_uart_inf); | 1500 | return s3c24xx_serial_probe(dev, &s3c2440_uart_inf); |
| 1500 | } | 1501 | } |
| 1501 | 1502 | ||
| 1502 | static struct device_driver s3c2440_serial_drv = { | 1503 | static struct platform_driver s3c2440_serial_drv = { |
| 1503 | .name = "s3c2440-uart", | ||
| 1504 | .owner = THIS_MODULE, | ||
| 1505 | .bus = &platform_bus_type, | ||
| 1506 | .probe = s3c2440_serial_probe, | 1504 | .probe = s3c2440_serial_probe, |
| 1507 | .remove = s3c24xx_serial_remove, | 1505 | .remove = s3c24xx_serial_remove, |
| 1508 | .suspend = s3c24xx_serial_suspend, | 1506 | .suspend = s3c24xx_serial_suspend, |
| 1509 | .resume = s3c24xx_serial_resume, | 1507 | .resume = s3c24xx_serial_resume, |
| 1508 | .driver = { | ||
| 1509 | .name = "s3c2440-uart", | ||
| 1510 | .owner = THIS_MODULE, | ||
| 1511 | }, | ||
| 1510 | }; | 1512 | }; |
| 1511 | 1513 | ||
| 1512 | 1514 | ||
| @@ -1517,7 +1519,7 @@ static inline int s3c2440_serial_init(void) | |||
| 1517 | 1519 | ||
| 1518 | static inline void s3c2440_serial_exit(void) | 1520 | static inline void s3c2440_serial_exit(void) |
| 1519 | { | 1521 | { |
| 1520 | driver_unregister(&s3c2440_serial_drv); | 1522 | platform_driver_unregister(&s3c2440_serial_drv); |
| 1521 | } | 1523 | } |
| 1522 | 1524 | ||
| 1523 | #define s3c2440_uart_inf_at &s3c2440_uart_inf | 1525 | #define s3c2440_uart_inf_at &s3c2440_uart_inf |
diff --git a/drivers/serial/sa1100.c b/drivers/serial/sa1100.c index ed618cc7ae96..fd9deee20e05 100644 --- a/drivers/serial/sa1100.c +++ b/drivers/serial/sa1100.c | |||
| @@ -834,9 +834,9 @@ static struct uart_driver sa1100_reg = { | |||
| 834 | .cons = SA1100_CONSOLE, | 834 | .cons = SA1100_CONSOLE, |
| 835 | }; | 835 | }; |
| 836 | 836 | ||
| 837 | static int sa1100_serial_suspend(struct device *_dev, pm_message_t state) | 837 | static int sa1100_serial_suspend(struct platform_device *dev, pm_message_t state) |
| 838 | { | 838 | { |
| 839 | struct sa1100_port *sport = dev_get_drvdata(_dev); | 839 | struct sa1100_port *sport = platform_get_drvdata(dev); |
| 840 | 840 | ||
| 841 | if (sport) | 841 | if (sport) |
| 842 | uart_suspend_port(&sa1100_reg, &sport->port); | 842 | uart_suspend_port(&sa1100_reg, &sport->port); |
| @@ -844,9 +844,9 @@ static int sa1100_serial_suspend(struct device *_dev, pm_message_t state) | |||
| 844 | return 0; | 844 | return 0; |
| 845 | } | 845 | } |
| 846 | 846 | ||
| 847 | static int sa1100_serial_resume(struct device *_dev) | 847 | static int sa1100_serial_resume(struct platform_device *dev) |
| 848 | { | 848 | { |
| 849 | struct sa1100_port *sport = dev_get_drvdata(_dev); | 849 | struct sa1100_port *sport = platform_get_drvdata(dev); |
| 850 | 850 | ||
| 851 | if (sport) | 851 | if (sport) |
| 852 | uart_resume_port(&sa1100_reg, &sport->port); | 852 | uart_resume_port(&sa1100_reg, &sport->port); |
| @@ -854,9 +854,8 @@ static int sa1100_serial_resume(struct device *_dev) | |||
| 854 | return 0; | 854 | return 0; |
| 855 | } | 855 | } |
| 856 | 856 | ||
| 857 | static int sa1100_serial_probe(struct device *_dev) | 857 | static int sa1100_serial_probe(struct platform_device *dev) |
| 858 | { | 858 | { |
| 859 | struct platform_device *dev = to_platform_device(_dev); | ||
| 860 | struct resource *res = dev->resource; | 859 | struct resource *res = dev->resource; |
| 861 | int i; | 860 | int i; |
| 862 | 861 | ||
| @@ -869,9 +868,9 @@ static int sa1100_serial_probe(struct device *_dev) | |||
| 869 | if (sa1100_ports[i].port.mapbase != res->start) | 868 | if (sa1100_ports[i].port.mapbase != res->start) |
| 870 | continue; | 869 | continue; |
| 871 | 870 | ||
| 872 | sa1100_ports[i].port.dev = _dev; | 871 | sa1100_ports[i].port.dev = &dev->dev; |
| 873 | uart_add_one_port(&sa1100_reg, &sa1100_ports[i].port); | 872 | uart_add_one_port(&sa1100_reg, &sa1100_ports[i].port); |
| 874 | dev_set_drvdata(_dev, &sa1100_ports[i]); | 873 | platform_set_drvdata(dev, &sa1100_ports[i]); |
| 875 | break; | 874 | break; |
| 876 | } | 875 | } |
| 877 | } | 876 | } |
| @@ -879,11 +878,11 @@ static int sa1100_serial_probe(struct device *_dev) | |||
| 879 | return 0; | 878 | return 0; |
| 880 | } | 879 | } |
| 881 | 880 | ||
| 882 | static int sa1100_serial_remove(struct device *_dev) | 881 | static int sa1100_serial_remove(struct platform_device *pdev) |
| 883 | { | 882 | { |
| 884 | struct sa1100_port *sport = dev_get_drvdata(_dev); | 883 | struct sa1100_port *sport = platform_get_drvdata(pdev); |
| 885 | 884 | ||
| 886 | dev_set_drvdata(_dev, NULL); | 885 | platform_set_drvdata(pdev, NULL); |
| 887 | 886 | ||
| 888 | if (sport) | 887 | if (sport) |
| 889 | uart_remove_one_port(&sa1100_reg, &sport->port); | 888 | uart_remove_one_port(&sa1100_reg, &sport->port); |
| @@ -891,13 +890,14 @@ static int sa1100_serial_remove(struct device *_dev) | |||
| 891 | return 0; | 890 | return 0; |
| 892 | } | 891 | } |
| 893 | 892 | ||
| 894 | static struct device_driver sa11x0_serial_driver = { | 893 | static struct platform_driver sa11x0_serial_driver = { |
| 895 | .name = "sa11x0-uart", | ||
| 896 | .bus = &platform_bus_type, | ||
| 897 | .probe = sa1100_serial_probe, | 894 | .probe = sa1100_serial_probe, |
| 898 | .remove = sa1100_serial_remove, | 895 | .remove = sa1100_serial_remove, |
| 899 | .suspend = sa1100_serial_suspend, | 896 | .suspend = sa1100_serial_suspend, |
| 900 | .resume = sa1100_serial_resume, | 897 | .resume = sa1100_serial_resume, |
| 898 | .driver = { | ||
| 899 | .name = "sa11x0-uart", | ||
| 900 | }, | ||
| 901 | }; | 901 | }; |
| 902 | 902 | ||
| 903 | static int __init sa1100_serial_init(void) | 903 | static int __init sa1100_serial_init(void) |
| @@ -910,7 +910,7 @@ static int __init sa1100_serial_init(void) | |||
| 910 | 910 | ||
| 911 | ret = uart_register_driver(&sa1100_reg); | 911 | ret = uart_register_driver(&sa1100_reg); |
| 912 | if (ret == 0) { | 912 | if (ret == 0) { |
| 913 | ret = driver_register(&sa11x0_serial_driver); | 913 | ret = platform_driver_register(&sa11x0_serial_driver); |
| 914 | if (ret) | 914 | if (ret) |
| 915 | uart_unregister_driver(&sa1100_reg); | 915 | uart_unregister_driver(&sa1100_reg); |
| 916 | } | 916 | } |
| @@ -919,7 +919,7 @@ static int __init sa1100_serial_init(void) | |||
| 919 | 919 | ||
| 920 | static void __exit sa1100_serial_exit(void) | 920 | static void __exit sa1100_serial_exit(void) |
| 921 | { | 921 | { |
| 922 | driver_unregister(&sa11x0_serial_driver); | 922 | platform_driver_unregister(&sa11x0_serial_driver); |
| 923 | uart_unregister_driver(&sa1100_reg); | 923 | uart_unregister_driver(&sa1100_reg); |
| 924 | } | 924 | } |
| 925 | 925 | ||
diff --git a/drivers/serial/vr41xx_siu.c b/drivers/serial/vr41xx_siu.c index 01696b3e3f61..865d4dea65df 100644 --- a/drivers/serial/vr41xx_siu.c +++ b/drivers/serial/vr41xx_siu.c | |||
| @@ -924,7 +924,7 @@ static struct uart_driver siu_uart_driver = { | |||
| 924 | .cons = SERIAL_VR41XX_CONSOLE, | 924 | .cons = SERIAL_VR41XX_CONSOLE, |
| 925 | }; | 925 | }; |
| 926 | 926 | ||
| 927 | static int siu_probe(struct device *dev) | 927 | static int siu_probe(struct platform_device *dev) |
| 928 | { | 928 | { |
| 929 | struct uart_port *port; | 929 | struct uart_port *port; |
| 930 | int num, i, retval; | 930 | int num, i, retval; |
| @@ -941,7 +941,7 @@ static int siu_probe(struct device *dev) | |||
| 941 | for (i = 0; i < num; i++) { | 941 | for (i = 0; i < num; i++) { |
| 942 | port = &siu_uart_ports[i]; | 942 | port = &siu_uart_ports[i]; |
| 943 | port->ops = &siu_uart_ops; | 943 | port->ops = &siu_uart_ops; |
| 944 | port->dev = dev; | 944 | port->dev = &dev->dev; |
| 945 | 945 | ||
| 946 | retval = uart_add_one_port(&siu_uart_driver, port); | 946 | retval = uart_add_one_port(&siu_uart_driver, port); |
| 947 | if (retval < 0) { | 947 | if (retval < 0) { |
| @@ -958,14 +958,14 @@ static int siu_probe(struct device *dev) | |||
| 958 | return 0; | 958 | return 0; |
| 959 | } | 959 | } |
| 960 | 960 | ||
| 961 | static int siu_remove(struct device *dev) | 961 | static int siu_remove(struct platform_device *dev) |
| 962 | { | 962 | { |
| 963 | struct uart_port *port; | 963 | struct uart_port *port; |
| 964 | int i; | 964 | int i; |
| 965 | 965 | ||
| 966 | for (i = 0; i < siu_uart_driver.nr; i++) { | 966 | for (i = 0; i < siu_uart_driver.nr; i++) { |
| 967 | port = &siu_uart_ports[i]; | 967 | port = &siu_uart_ports[i]; |
| 968 | if (port->dev == dev) { | 968 | if (port->dev == &dev->dev) { |
| 969 | uart_remove_one_port(&siu_uart_driver, port); | 969 | uart_remove_one_port(&siu_uart_driver, port); |
| 970 | port->dev = NULL; | 970 | port->dev = NULL; |
| 971 | } | 971 | } |
| @@ -976,7 +976,7 @@ static int siu_remove(struct device *dev) | |||
| 976 | return 0; | 976 | return 0; |
| 977 | } | 977 | } |
| 978 | 978 | ||
| 979 | static int siu_suspend(struct device *dev, pm_message_t state) | 979 | static int siu_suspend(struct platform_device *dev, pm_message_t state) |
| 980 | { | 980 | { |
| 981 | struct uart_port *port; | 981 | struct uart_port *port; |
| 982 | int i; | 982 | int i; |
| @@ -984,7 +984,7 @@ static int siu_suspend(struct device *dev, pm_message_t state) | |||
| 984 | for (i = 0; i < siu_uart_driver.nr; i++) { | 984 | for (i = 0; i < siu_uart_driver.nr; i++) { |
| 985 | port = &siu_uart_ports[i]; | 985 | port = &siu_uart_ports[i]; |
| 986 | if ((port->type == PORT_VR41XX_SIU || | 986 | if ((port->type == PORT_VR41XX_SIU || |
| 987 | port->type == PORT_VR41XX_DSIU) && port->dev == dev) | 987 | port->type == PORT_VR41XX_DSIU) && port->dev == &dev->dev) |
| 988 | uart_suspend_port(&siu_uart_driver, port); | 988 | uart_suspend_port(&siu_uart_driver, port); |
| 989 | 989 | ||
| 990 | } | 990 | } |
| @@ -992,7 +992,7 @@ static int siu_suspend(struct device *dev, pm_message_t state) | |||
| 992 | return 0; | 992 | return 0; |
| 993 | } | 993 | } |
| 994 | 994 | ||
| 995 | static int siu_resume(struct device *dev) | 995 | static int siu_resume(struct platform_device *dev) |
| 996 | { | 996 | { |
| 997 | struct uart_port *port; | 997 | struct uart_port *port; |
| 998 | int i; | 998 | int i; |
| @@ -1000,7 +1000,7 @@ static int siu_resume(struct device *dev) | |||
| 1000 | for (i = 0; i < siu_uart_driver.nr; i++) { | 1000 | for (i = 0; i < siu_uart_driver.nr; i++) { |
| 1001 | port = &siu_uart_ports[i]; | 1001 | port = &siu_uart_ports[i]; |
| 1002 | if ((port->type == PORT_VR41XX_SIU || | 1002 | if ((port->type == PORT_VR41XX_SIU || |
| 1003 | port->type == PORT_VR41XX_DSIU) && port->dev == dev) | 1003 | port->type == PORT_VR41XX_DSIU) && port->dev == &dev->dev) |
| 1004 | uart_resume_port(&siu_uart_driver, port); | 1004 | uart_resume_port(&siu_uart_driver, port); |
| 1005 | } | 1005 | } |
| 1006 | 1006 | ||
| @@ -1009,13 +1009,14 @@ static int siu_resume(struct device *dev) | |||
| 1009 | 1009 | ||
| 1010 | static struct platform_device *siu_platform_device; | 1010 | static struct platform_device *siu_platform_device; |
| 1011 | 1011 | ||
| 1012 | static struct device_driver siu_device_driver = { | 1012 | static struct platform_driver siu_device_driver = { |
| 1013 | .name = "SIU", | ||
| 1014 | .bus = &platform_bus_type, | ||
| 1015 | .probe = siu_probe, | 1013 | .probe = siu_probe, |
| 1016 | .remove = siu_remove, | 1014 | .remove = siu_remove, |
| 1017 | .suspend = siu_suspend, | 1015 | .suspend = siu_suspend, |
| 1018 | .resume = siu_resume, | 1016 | .resume = siu_resume, |
| 1017 | .driver = { | ||
| 1018 | .name = "SIU", | ||
| 1019 | }, | ||
| 1019 | }; | 1020 | }; |
| 1020 | 1021 | ||
| 1021 | static int __devinit vr41xx_siu_init(void) | 1022 | static int __devinit vr41xx_siu_init(void) |
| @@ -1026,7 +1027,7 @@ static int __devinit vr41xx_siu_init(void) | |||
| 1026 | if (IS_ERR(siu_platform_device)) | 1027 | if (IS_ERR(siu_platform_device)) |
| 1027 | return PTR_ERR(siu_platform_device); | 1028 | return PTR_ERR(siu_platform_device); |
| 1028 | 1029 | ||
| 1029 | retval = driver_register(&siu_device_driver); | 1030 | retval = platform_driver_register(&siu_device_driver); |
| 1030 | if (retval < 0) | 1031 | if (retval < 0) |
| 1031 | platform_device_unregister(siu_platform_device); | 1032 | platform_device_unregister(siu_platform_device); |
| 1032 | 1033 | ||
| @@ -1035,7 +1036,7 @@ static int __devinit vr41xx_siu_init(void) | |||
| 1035 | 1036 | ||
| 1036 | static void __devexit vr41xx_siu_exit(void) | 1037 | static void __devexit vr41xx_siu_exit(void) |
| 1037 | { | 1038 | { |
| 1038 | driver_unregister(&siu_device_driver); | 1039 | platform_driver_unregister(&siu_device_driver); |
| 1039 | 1040 | ||
| 1040 | platform_device_unregister(siu_platform_device); | 1041 | platform_device_unregister(siu_platform_device); |
| 1041 | } | 1042 | } |
diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c index 904519085334..1e407745c115 100644 --- a/drivers/usb/gadget/dummy_hcd.c +++ b/drivers/usb/gadget/dummy_hcd.c | |||
| @@ -896,7 +896,7 @@ dummy_gadget_release (struct device *dev) | |||
| 896 | #endif | 896 | #endif |
| 897 | } | 897 | } |
| 898 | 898 | ||
| 899 | static int dummy_udc_probe (struct device *dev) | 899 | static int dummy_udc_probe (struct platform_device *dev) |
| 900 | { | 900 | { |
| 901 | struct dummy *dum = the_controller; | 901 | struct dummy *dum = the_controller; |
| 902 | int rc; | 902 | int rc; |
| @@ -909,7 +909,7 @@ static int dummy_udc_probe (struct device *dev) | |||
| 909 | dum->gadget.is_otg = (dummy_to_hcd(dum)->self.otg_port != 0); | 909 | dum->gadget.is_otg = (dummy_to_hcd(dum)->self.otg_port != 0); |
| 910 | 910 | ||
| 911 | strcpy (dum->gadget.dev.bus_id, "gadget"); | 911 | strcpy (dum->gadget.dev.bus_id, "gadget"); |
| 912 | dum->gadget.dev.parent = dev; | 912 | dum->gadget.dev.parent = &dev->dev; |
| 913 | dum->gadget.dev.release = dummy_gadget_release; | 913 | dum->gadget.dev.release = dummy_gadget_release; |
| 914 | rc = device_register (&dum->gadget.dev); | 914 | rc = device_register (&dum->gadget.dev); |
| 915 | if (rc < 0) | 915 | if (rc < 0) |
| @@ -919,26 +919,26 @@ static int dummy_udc_probe (struct device *dev) | |||
| 919 | usb_bus_get (&dummy_to_hcd (dum)->self); | 919 | usb_bus_get (&dummy_to_hcd (dum)->self); |
| 920 | #endif | 920 | #endif |
| 921 | 921 | ||
| 922 | dev_set_drvdata (dev, dum); | 922 | platform_set_drvdata (dev, dum); |
| 923 | device_create_file (&dum->gadget.dev, &dev_attr_function); | 923 | device_create_file (&dum->gadget.dev, &dev_attr_function); |
| 924 | return rc; | 924 | return rc; |
| 925 | } | 925 | } |
| 926 | 926 | ||
| 927 | static int dummy_udc_remove (struct device *dev) | 927 | static int dummy_udc_remove (struct platform_device *dev) |
| 928 | { | 928 | { |
| 929 | struct dummy *dum = dev_get_drvdata (dev); | 929 | struct dummy *dum = platform_get_drvdata (dev); |
| 930 | 930 | ||
| 931 | dev_set_drvdata (dev, NULL); | 931 | platform_set_drvdata (dev, NULL); |
| 932 | device_remove_file (&dum->gadget.dev, &dev_attr_function); | 932 | device_remove_file (&dum->gadget.dev, &dev_attr_function); |
| 933 | device_unregister (&dum->gadget.dev); | 933 | device_unregister (&dum->gadget.dev); |
| 934 | return 0; | 934 | return 0; |
| 935 | } | 935 | } |
| 936 | 936 | ||
| 937 | static int dummy_udc_suspend (struct device *dev, pm_message_t state) | 937 | static int dummy_udc_suspend (struct platform_device *dev, pm_message_t state) |
| 938 | { | 938 | { |
| 939 | struct dummy *dum = dev_get_drvdata(dev); | 939 | struct dummy *dum = platform_get_drvdata(dev); |
| 940 | 940 | ||
| 941 | dev_dbg (dev, "%s\n", __FUNCTION__); | 941 | dev_dbg (&dev->dev, "%s\n", __FUNCTION__); |
| 942 | spin_lock_irq (&dum->lock); | 942 | spin_lock_irq (&dum->lock); |
| 943 | dum->udc_suspended = 1; | 943 | dum->udc_suspended = 1; |
| 944 | set_link_state (dum); | 944 | set_link_state (dum); |
| @@ -949,29 +949,30 @@ static int dummy_udc_suspend (struct device *dev, pm_message_t state) | |||
| 949 | return 0; | 949 | return 0; |
| 950 | } | 950 | } |
| 951 | 951 | ||
| 952 | static int dummy_udc_resume (struct device *dev) | 952 | static int dummy_udc_resume (struct platform_device *dev) |
| 953 | { | 953 | { |
| 954 | struct dummy *dum = dev_get_drvdata(dev); | 954 | struct dummy *dum = platform_get_drvdata(dev); |
| 955 | 955 | ||
| 956 | dev_dbg (dev, "%s\n", __FUNCTION__); | 956 | dev_dbg (&dev->dev, "%s\n", __FUNCTION__); |
| 957 | spin_lock_irq (&dum->lock); | 957 | spin_lock_irq (&dum->lock); |
| 958 | dum->udc_suspended = 0; | 958 | dum->udc_suspended = 0; |
| 959 | set_link_state (dum); | 959 | set_link_state (dum); |
| 960 | spin_unlock_irq (&dum->lock); | 960 | spin_unlock_irq (&dum->lock); |
| 961 | 961 | ||
| 962 | dev->power.power_state = PMSG_ON; | 962 | dev->dev.power.power_state = PMSG_ON; |
| 963 | usb_hcd_poll_rh_status (dummy_to_hcd (dum)); | 963 | usb_hcd_poll_rh_status (dummy_to_hcd (dum)); |
| 964 | return 0; | 964 | return 0; |
| 965 | } | 965 | } |
| 966 | 966 | ||
| 967 | static struct device_driver dummy_udc_driver = { | 967 | static struct platform_driver dummy_udc_driver = { |
| 968 | .name = (char *) gadget_name, | ||
| 969 | .owner = THIS_MODULE, | ||
| 970 | .bus = &platform_bus_type, | ||
| 971 | .probe = dummy_udc_probe, | 968 | .probe = dummy_udc_probe, |
| 972 | .remove = dummy_udc_remove, | 969 | .remove = dummy_udc_remove, |
| 973 | .suspend = dummy_udc_suspend, | 970 | .suspend = dummy_udc_suspend, |
| 974 | .resume = dummy_udc_resume, | 971 | .resume = dummy_udc_resume, |
| 972 | .driver = { | ||
| 973 | .name = (char *) gadget_name, | ||
| 974 | .owner = THIS_MODULE, | ||
| 975 | }, | ||
| 975 | }; | 976 | }; |
| 976 | 977 | ||
| 977 | /*-------------------------------------------------------------------------*/ | 978 | /*-------------------------------------------------------------------------*/ |
| @@ -1898,14 +1899,14 @@ static const struct hc_driver dummy_hcd = { | |||
| 1898 | .bus_resume = dummy_bus_resume, | 1899 | .bus_resume = dummy_bus_resume, |
| 1899 | }; | 1900 | }; |
| 1900 | 1901 | ||
| 1901 | static int dummy_hcd_probe (struct device *dev) | 1902 | static int dummy_hcd_probe (struct platform_device *dev) |
| 1902 | { | 1903 | { |
| 1903 | struct usb_hcd *hcd; | 1904 | struct usb_hcd *hcd; |
| 1904 | int retval; | 1905 | int retval; |
| 1905 | 1906 | ||
| 1906 | dev_info (dev, "%s, driver " DRIVER_VERSION "\n", driver_desc); | 1907 | dev_info (dev, "%s, driver " DRIVER_VERSION "\n", driver_desc); |
| 1907 | 1908 | ||
| 1908 | hcd = usb_create_hcd (&dummy_hcd, dev, dev->bus_id); | 1909 | hcd = usb_create_hcd (&dummy_hcd, &dev->dev, dev->dev.bus_id); |
| 1909 | if (!hcd) | 1910 | if (!hcd) |
| 1910 | return -ENOMEM; | 1911 | return -ENOMEM; |
| 1911 | the_controller = hcd_to_dummy (hcd); | 1912 | the_controller = hcd_to_dummy (hcd); |
| @@ -1918,48 +1919,49 @@ static int dummy_hcd_probe (struct device *dev) | |||
| 1918 | return retval; | 1919 | return retval; |
| 1919 | } | 1920 | } |
| 1920 | 1921 | ||
| 1921 | static int dummy_hcd_remove (struct device *dev) | 1922 | static int dummy_hcd_remove (struct platform_device *dev) |
| 1922 | { | 1923 | { |
| 1923 | struct usb_hcd *hcd; | 1924 | struct usb_hcd *hcd; |
| 1924 | 1925 | ||
| 1925 | hcd = dev_get_drvdata (dev); | 1926 | hcd = platform_get_drvdata (dev); |
| 1926 | usb_remove_hcd (hcd); | 1927 | usb_remove_hcd (hcd); |
| 1927 | usb_put_hcd (hcd); | 1928 | usb_put_hcd (hcd); |
| 1928 | the_controller = NULL; | 1929 | the_controller = NULL; |
| 1929 | return 0; | 1930 | return 0; |
| 1930 | } | 1931 | } |
| 1931 | 1932 | ||
| 1932 | static int dummy_hcd_suspend (struct device *dev, pm_message_t state) | 1933 | static int dummy_hcd_suspend (struct platform_device *dev, pm_message_t state) |
| 1933 | { | 1934 | { |
| 1934 | struct usb_hcd *hcd; | 1935 | struct usb_hcd *hcd; |
| 1935 | 1936 | ||
| 1936 | dev_dbg (dev, "%s\n", __FUNCTION__); | 1937 | dev_dbg (&dev->dev, "%s\n", __FUNCTION__); |
| 1937 | hcd = dev_get_drvdata (dev); | 1938 | hcd = platform_get_drvdata (dev); |
| 1938 | 1939 | ||
| 1939 | hcd->state = HC_STATE_SUSPENDED; | 1940 | hcd->state = HC_STATE_SUSPENDED; |
| 1940 | return 0; | 1941 | return 0; |
| 1941 | } | 1942 | } |
| 1942 | 1943 | ||
| 1943 | static int dummy_hcd_resume (struct device *dev) | 1944 | static int dummy_hcd_resume (struct platform_device *dev) |
| 1944 | { | 1945 | { |
| 1945 | struct usb_hcd *hcd; | 1946 | struct usb_hcd *hcd; |
| 1946 | 1947 | ||
| 1947 | dev_dbg (dev, "%s\n", __FUNCTION__); | 1948 | dev_dbg (&dev->dev, "%s\n", __FUNCTION__); |
| 1948 | hcd = dev_get_drvdata (dev); | 1949 | hcd = platform_get_drvdata (dev); |
| 1949 | hcd->state = HC_STATE_RUNNING; | 1950 | hcd->state = HC_STATE_RUNNING; |
| 1950 | 1951 | ||
| 1951 | usb_hcd_poll_rh_status (hcd); | 1952 | usb_hcd_poll_rh_status (hcd); |
| 1952 | return 0; | 1953 | return 0; |
| 1953 | } | 1954 | } |
| 1954 | 1955 | ||
| 1955 | static struct device_driver dummy_hcd_driver = { | 1956 | static struct platform_driver dummy_hcd_driver = { |
| 1956 | .name = (char *) driver_name, | ||
| 1957 | .owner = THIS_MODULE, | ||
| 1958 | .bus = &platform_bus_type, | ||
| 1959 | .probe = dummy_hcd_probe, | 1957 | .probe = dummy_hcd_probe, |
| 1960 | .remove = dummy_hcd_remove, | 1958 | .remove = dummy_hcd_remove, |
| 1961 | .suspend = dummy_hcd_suspend, | 1959 | .suspend = dummy_hcd_suspend, |
| 1962 | .resume = dummy_hcd_resume, | 1960 | .resume = dummy_hcd_resume, |
| 1961 | .driver = { | ||
| 1962 | .name = (char *) driver_name, | ||
| 1963 | .owner = THIS_MODULE, | ||
| 1964 | }, | ||
| 1963 | }; | 1965 | }; |
| 1964 | 1966 | ||
| 1965 | /*-------------------------------------------------------------------------*/ | 1967 | /*-------------------------------------------------------------------------*/ |
| @@ -1995,11 +1997,11 @@ static int __init init (void) | |||
| 1995 | if (usb_disabled ()) | 1997 | if (usb_disabled ()) |
| 1996 | return -ENODEV; | 1998 | return -ENODEV; |
| 1997 | 1999 | ||
| 1998 | retval = driver_register (&dummy_hcd_driver); | 2000 | retval = platform_driver_register (&dummy_hcd_driver); |
| 1999 | if (retval < 0) | 2001 | if (retval < 0) |
| 2000 | return retval; | 2002 | return retval; |
| 2001 | 2003 | ||
| 2002 | retval = driver_register (&dummy_udc_driver); | 2004 | retval = platform_driver_register (&dummy_udc_driver); |
| 2003 | if (retval < 0) | 2005 | if (retval < 0) |
| 2004 | goto err_register_udc_driver; | 2006 | goto err_register_udc_driver; |
| 2005 | 2007 | ||
| @@ -2015,9 +2017,9 @@ static int __init init (void) | |||
| 2015 | err_register_udc: | 2017 | err_register_udc: |
| 2016 | platform_device_unregister (&the_hcd_pdev); | 2018 | platform_device_unregister (&the_hcd_pdev); |
| 2017 | err_register_hcd: | 2019 | err_register_hcd: |
| 2018 | driver_unregister (&dummy_udc_driver); | 2020 | platform_driver_unregister (&dummy_udc_driver); |
| 2019 | err_register_udc_driver: | 2021 | err_register_udc_driver: |
| 2020 | driver_unregister (&dummy_hcd_driver); | 2022 | platform_driver_unregister (&dummy_hcd_driver); |
| 2021 | return retval; | 2023 | return retval; |
| 2022 | } | 2024 | } |
| 2023 | module_init (init); | 2025 | module_init (init); |
| @@ -2026,7 +2028,7 @@ static void __exit cleanup (void) | |||
| 2026 | { | 2028 | { |
| 2027 | platform_device_unregister (&the_udc_pdev); | 2029 | platform_device_unregister (&the_udc_pdev); |
| 2028 | platform_device_unregister (&the_hcd_pdev); | 2030 | platform_device_unregister (&the_hcd_pdev); |
| 2029 | driver_unregister (&dummy_udc_driver); | 2031 | platform_driver_unregister (&dummy_udc_driver); |
| 2030 | driver_unregister (&dummy_hcd_driver); | 2032 | platform_driver_unregister (&dummy_hcd_driver); |
| 2031 | } | 2033 | } |
| 2032 | module_exit (cleanup); | 2034 | module_exit (cleanup); |
diff --git a/drivers/usb/gadget/lh7a40x_udc.c b/drivers/usb/gadget/lh7a40x_udc.c index bc6269f10cbb..e02fea5a5433 100644 --- a/drivers/usb/gadget/lh7a40x_udc.c +++ b/drivers/usb/gadget/lh7a40x_udc.c | |||
| @@ -2085,21 +2085,21 @@ static struct lh7a40x_udc memory = { | |||
| 2085 | /* | 2085 | /* |
| 2086 | * probe - binds to the platform device | 2086 | * probe - binds to the platform device |
| 2087 | */ | 2087 | */ |
| 2088 | static int lh7a40x_udc_probe(struct device *_dev) | 2088 | static int lh7a40x_udc_probe(struct platform_device *pdev) |
| 2089 | { | 2089 | { |
| 2090 | struct lh7a40x_udc *dev = &memory; | 2090 | struct lh7a40x_udc *dev = &memory; |
| 2091 | int retval; | 2091 | int retval; |
| 2092 | 2092 | ||
| 2093 | DEBUG("%s: %p\n", __FUNCTION__, _dev); | 2093 | DEBUG("%s: %p\n", __FUNCTION__, pdev); |
| 2094 | 2094 | ||
| 2095 | spin_lock_init(&dev->lock); | 2095 | spin_lock_init(&dev->lock); |
| 2096 | dev->dev = _dev; | 2096 | dev->dev = &pdev->dev; |
| 2097 | 2097 | ||
| 2098 | device_initialize(&dev->gadget.dev); | 2098 | device_initialize(&dev->gadget.dev); |
| 2099 | dev->gadget.dev.parent = _dev; | 2099 | dev->gadget.dev.parent = &pdev->dev; |
| 2100 | 2100 | ||
| 2101 | the_controller = dev; | 2101 | the_controller = dev; |
| 2102 | dev_set_drvdata(_dev, dev); | 2102 | platform_set_drvdata(pdev, dev); |
| 2103 | 2103 | ||
| 2104 | udc_disable(dev); | 2104 | udc_disable(dev); |
| 2105 | udc_reinit(dev); | 2105 | udc_reinit(dev); |
| @@ -2119,11 +2119,11 @@ static int lh7a40x_udc_probe(struct device *_dev) | |||
| 2119 | return retval; | 2119 | return retval; |
| 2120 | } | 2120 | } |
| 2121 | 2121 | ||
| 2122 | static int lh7a40x_udc_remove(struct device *_dev) | 2122 | static int lh7a40x_udc_remove(struct platform_device *pdev) |
| 2123 | { | 2123 | { |
| 2124 | struct lh7a40x_udc *dev = _dev->driver_data; | 2124 | struct lh7a40x_udc *dev = platform_get_drvdata(pdev); |
| 2125 | 2125 | ||
| 2126 | DEBUG("%s: %p\n", __FUNCTION__, dev); | 2126 | DEBUG("%s: %p\n", __FUNCTION__, pdev); |
| 2127 | 2127 | ||
| 2128 | udc_disable(dev); | 2128 | udc_disable(dev); |
| 2129 | remove_proc_files(); | 2129 | remove_proc_files(); |
| @@ -2131,7 +2131,7 @@ static int lh7a40x_udc_remove(struct device *_dev) | |||
| 2131 | 2131 | ||
| 2132 | free_irq(IRQ_USBINTR, dev); | 2132 | free_irq(IRQ_USBINTR, dev); |
| 2133 | 2133 | ||
| 2134 | dev_set_drvdata(_dev, 0); | 2134 | platform_set_drvdata(pdev, 0); |
| 2135 | 2135 | ||
| 2136 | the_controller = 0; | 2136 | the_controller = 0; |
| 2137 | 2137 | ||
| @@ -2140,26 +2140,27 @@ static int lh7a40x_udc_remove(struct device *_dev) | |||
| 2140 | 2140 | ||
| 2141 | /*-------------------------------------------------------------------------*/ | 2141 | /*-------------------------------------------------------------------------*/ |
| 2142 | 2142 | ||
| 2143 | static struct device_driver udc_driver = { | 2143 | static struct platform_driver udc_driver = { |
| 2144 | .name = (char *)driver_name, | ||
| 2145 | .owner = THIS_MODULE, | ||
| 2146 | .bus = &platform_bus_type, | ||
| 2147 | .probe = lh7a40x_udc_probe, | 2144 | .probe = lh7a40x_udc_probe, |
| 2148 | .remove = lh7a40x_udc_remove | 2145 | .remove = lh7a40x_udc_remove |
| 2149 | /* FIXME power management support */ | 2146 | /* FIXME power management support */ |
| 2150 | /* .suspend = ... disable UDC */ | 2147 | /* .suspend = ... disable UDC */ |
| 2151 | /* .resume = ... re-enable UDC */ | 2148 | /* .resume = ... re-enable UDC */ |
| 2149 | .driver = { | ||
| 2150 | .name = (char *)driver_name, | ||
| 2151 | .owner = THIS_MODULE, | ||
| 2152 | }, | ||
| 2152 | }; | 2153 | }; |
| 2153 | 2154 | ||
| 2154 | static int __init udc_init(void) | 2155 | static int __init udc_init(void) |
| 2155 | { | 2156 | { |
| 2156 | DEBUG("%s: %s version %s\n", __FUNCTION__, driver_name, DRIVER_VERSION); | 2157 | DEBUG("%s: %s version %s\n", __FUNCTION__, driver_name, DRIVER_VERSION); |
| 2157 | return driver_register(&udc_driver); | 2158 | return platform_driver_register(&udc_driver); |
| 2158 | } | 2159 | } |
| 2159 | 2160 | ||
| 2160 | static void __exit udc_exit(void) | 2161 | static void __exit udc_exit(void) |
| 2161 | { | 2162 | { |
| 2162 | driver_unregister(&udc_driver); | 2163 | platform_driver_unregister(&udc_driver); |
| 2163 | } | 2164 | } |
| 2164 | 2165 | ||
| 2165 | module_init(udc_init); | 2166 | module_init(udc_init); |
diff --git a/drivers/usb/gadget/omap_udc.c b/drivers/usb/gadget/omap_udc.c index 387692a3611e..a8972d7c97be 100644 --- a/drivers/usb/gadget/omap_udc.c +++ b/drivers/usb/gadget/omap_udc.c | |||
| @@ -2707,18 +2707,17 @@ omap_udc_setup(struct platform_device *odev, struct otg_transceiver *xceiv) | |||
| 2707 | return 0; | 2707 | return 0; |
| 2708 | } | 2708 | } |
| 2709 | 2709 | ||
| 2710 | static int __init omap_udc_probe(struct device *dev) | 2710 | static int __init omap_udc_probe(struct platform_device *pdev) |
| 2711 | { | 2711 | { |
| 2712 | struct platform_device *odev = to_platform_device(dev); | ||
| 2713 | int status = -ENODEV; | 2712 | int status = -ENODEV; |
| 2714 | int hmc; | 2713 | int hmc; |
| 2715 | struct otg_transceiver *xceiv = NULL; | 2714 | struct otg_transceiver *xceiv = NULL; |
| 2716 | const char *type = NULL; | 2715 | const char *type = NULL; |
| 2717 | struct omap_usb_config *config = dev->platform_data; | 2716 | struct omap_usb_config *config = pdev->dev.platform_data; |
| 2718 | 2717 | ||
| 2719 | /* NOTE: "knows" the order of the resources! */ | 2718 | /* NOTE: "knows" the order of the resources! */ |
| 2720 | if (!request_mem_region(odev->resource[0].start, | 2719 | if (!request_mem_region(pdev->resource[0].start, |
| 2721 | odev->resource[0].end - odev->resource[0].start + 1, | 2720 | pdev->resource[0].end - pdev->resource[0].start + 1, |
| 2722 | driver_name)) { | 2721 | driver_name)) { |
| 2723 | DBG("request_mem_region failed\n"); | 2722 | DBG("request_mem_region failed\n"); |
| 2724 | return -EBUSY; | 2723 | return -EBUSY; |
| @@ -2803,7 +2802,7 @@ bad_on_1710: | |||
| 2803 | INFO("hmc mode %d, %s transceiver\n", hmc, type); | 2802 | INFO("hmc mode %d, %s transceiver\n", hmc, type); |
| 2804 | 2803 | ||
| 2805 | /* a "gadget" abstracts/virtualizes the controller */ | 2804 | /* a "gadget" abstracts/virtualizes the controller */ |
| 2806 | status = omap_udc_setup(odev, xceiv); | 2805 | status = omap_udc_setup(pdev, xceiv); |
| 2807 | if (status) { | 2806 | if (status) { |
| 2808 | goto cleanup0; | 2807 | goto cleanup0; |
| 2809 | } | 2808 | } |
| @@ -2821,28 +2820,28 @@ bad_on_1710: | |||
| 2821 | udc->clr_halt = UDC_RESET_EP; | 2820 | udc->clr_halt = UDC_RESET_EP; |
| 2822 | 2821 | ||
| 2823 | /* USB general purpose IRQ: ep0, state changes, dma, etc */ | 2822 | /* USB general purpose IRQ: ep0, state changes, dma, etc */ |
| 2824 | status = request_irq(odev->resource[1].start, omap_udc_irq, | 2823 | status = request_irq(pdev->resource[1].start, omap_udc_irq, |
| 2825 | SA_SAMPLE_RANDOM, driver_name, udc); | 2824 | SA_SAMPLE_RANDOM, driver_name, udc); |
| 2826 | if (status != 0) { | 2825 | if (status != 0) { |
| 2827 | ERR( "can't get irq %ld, err %d\n", | 2826 | ERR( "can't get irq %ld, err %d\n", |
| 2828 | odev->resource[1].start, status); | 2827 | pdev->resource[1].start, status); |
| 2829 | goto cleanup1; | 2828 | goto cleanup1; |
| 2830 | } | 2829 | } |
| 2831 | 2830 | ||
| 2832 | /* USB "non-iso" IRQ (PIO for all but ep0) */ | 2831 | /* USB "non-iso" IRQ (PIO for all but ep0) */ |
| 2833 | status = request_irq(odev->resource[2].start, omap_udc_pio_irq, | 2832 | status = request_irq(pdev->resource[2].start, omap_udc_pio_irq, |
| 2834 | SA_SAMPLE_RANDOM, "omap_udc pio", udc); | 2833 | SA_SAMPLE_RANDOM, "omap_udc pio", udc); |
| 2835 | if (status != 0) { | 2834 | if (status != 0) { |
| 2836 | ERR( "can't get irq %ld, err %d\n", | 2835 | ERR( "can't get irq %ld, err %d\n", |
| 2837 | odev->resource[2].start, status); | 2836 | pdev->resource[2].start, status); |
| 2838 | goto cleanup2; | 2837 | goto cleanup2; |
| 2839 | } | 2838 | } |
| 2840 | #ifdef USE_ISO | 2839 | #ifdef USE_ISO |
| 2841 | status = request_irq(odev->resource[3].start, omap_udc_iso_irq, | 2840 | status = request_irq(pdev->resource[3].start, omap_udc_iso_irq, |
| 2842 | SA_INTERRUPT, "omap_udc iso", udc); | 2841 | SA_INTERRUPT, "omap_udc iso", udc); |
| 2843 | if (status != 0) { | 2842 | if (status != 0) { |
| 2844 | ERR("can't get irq %ld, err %d\n", | 2843 | ERR("can't get irq %ld, err %d\n", |
| 2845 | odev->resource[3].start, status); | 2844 | pdev->resource[3].start, status); |
| 2846 | goto cleanup3; | 2845 | goto cleanup3; |
| 2847 | } | 2846 | } |
| 2848 | #endif | 2847 | #endif |
| @@ -2853,11 +2852,11 @@ bad_on_1710: | |||
| 2853 | 2852 | ||
| 2854 | #ifdef USE_ISO | 2853 | #ifdef USE_ISO |
| 2855 | cleanup3: | 2854 | cleanup3: |
| 2856 | free_irq(odev->resource[2].start, udc); | 2855 | free_irq(pdev->resource[2].start, udc); |
| 2857 | #endif | 2856 | #endif |
| 2858 | 2857 | ||
| 2859 | cleanup2: | 2858 | cleanup2: |
| 2860 | free_irq(odev->resource[1].start, udc); | 2859 | free_irq(pdev->resource[1].start, udc); |
| 2861 | 2860 | ||
| 2862 | cleanup1: | 2861 | cleanup1: |
| 2863 | kfree (udc); | 2862 | kfree (udc); |
| @@ -2866,14 +2865,13 @@ cleanup1: | |||
| 2866 | cleanup0: | 2865 | cleanup0: |
| 2867 | if (xceiv) | 2866 | if (xceiv) |
| 2868 | put_device(xceiv->dev); | 2867 | put_device(xceiv->dev); |
| 2869 | release_mem_region(odev->resource[0].start, | 2868 | release_mem_region(pdev->resource[0].start, |
| 2870 | odev->resource[0].end - odev->resource[0].start + 1); | 2869 | pdev->resource[0].end - pdev->resource[0].start + 1); |
| 2871 | return status; | 2870 | return status; |
| 2872 | } | 2871 | } |
| 2873 | 2872 | ||
| 2874 | static int __exit omap_udc_remove(struct device *dev) | 2873 | static int __exit omap_udc_remove(struct platform_device *pdev) |
| 2875 | { | 2874 | { |
| 2876 | struct platform_device *odev = to_platform_device(dev); | ||
| 2877 | DECLARE_COMPLETION(done); | 2875 | DECLARE_COMPLETION(done); |
| 2878 | 2876 | ||
| 2879 | if (!udc) | 2877 | if (!udc) |
| @@ -2891,13 +2889,13 @@ static int __exit omap_udc_remove(struct device *dev) | |||
| 2891 | remove_proc_file(); | 2889 | remove_proc_file(); |
| 2892 | 2890 | ||
| 2893 | #ifdef USE_ISO | 2891 | #ifdef USE_ISO |
| 2894 | free_irq(odev->resource[3].start, udc); | 2892 | free_irq(pdev->resource[3].start, udc); |
| 2895 | #endif | 2893 | #endif |
| 2896 | free_irq(odev->resource[2].start, udc); | 2894 | free_irq(pdev->resource[2].start, udc); |
| 2897 | free_irq(odev->resource[1].start, udc); | 2895 | free_irq(pdev->resource[1].start, udc); |
| 2898 | 2896 | ||
| 2899 | release_mem_region(odev->resource[0].start, | 2897 | release_mem_region(pdev->resource[0].start, |
| 2900 | odev->resource[0].end - odev->resource[0].start + 1); | 2898 | pdev->resource[0].end - pdev->resource[0].start + 1); |
| 2901 | 2899 | ||
| 2902 | device_unregister(&udc->gadget.dev); | 2900 | device_unregister(&udc->gadget.dev); |
| 2903 | wait_for_completion(&done); | 2901 | wait_for_completion(&done); |
| @@ -2915,7 +2913,7 @@ static int __exit omap_udc_remove(struct device *dev) | |||
| 2915 | * may involve talking to an external transceiver (e.g. isp1301). | 2913 | * may involve talking to an external transceiver (e.g. isp1301). |
| 2916 | */ | 2914 | */ |
| 2917 | 2915 | ||
| 2918 | static int omap_udc_suspend(struct device *dev, pm_message_t message) | 2916 | static int omap_udc_suspend(struct platform_device *dev, pm_message_t message) |
| 2919 | { | 2917 | { |
| 2920 | u32 devstat; | 2918 | u32 devstat; |
| 2921 | 2919 | ||
| @@ -2935,7 +2933,7 @@ static int omap_udc_suspend(struct device *dev, pm_message_t message) | |||
| 2935 | return 0; | 2933 | return 0; |
| 2936 | } | 2934 | } |
| 2937 | 2935 | ||
| 2938 | static int omap_udc_resume(struct device *dev) | 2936 | static int omap_udc_resume(struct platform_device *dev) |
| 2939 | { | 2937 | { |
| 2940 | DBG("resume + wakeup/SRP\n"); | 2938 | DBG("resume + wakeup/SRP\n"); |
| 2941 | omap_pullup(&udc->gadget, 1); | 2939 | omap_pullup(&udc->gadget, 1); |
| @@ -2947,14 +2945,15 @@ static int omap_udc_resume(struct device *dev) | |||
| 2947 | 2945 | ||
| 2948 | /*-------------------------------------------------------------------------*/ | 2946 | /*-------------------------------------------------------------------------*/ |
| 2949 | 2947 | ||
| 2950 | static struct device_driver udc_driver = { | 2948 | static struct platform_driver udc_driver = { |
| 2951 | .name = (char *) driver_name, | ||
| 2952 | .owner = THIS_MODULE, | ||
| 2953 | .bus = &platform_bus_type, | ||
| 2954 | .probe = omap_udc_probe, | 2949 | .probe = omap_udc_probe, |
| 2955 | .remove = __exit_p(omap_udc_remove), | 2950 | .remove = __exit_p(omap_udc_remove), |
| 2956 | .suspend = omap_udc_suspend, | 2951 | .suspend = omap_udc_suspend, |
| 2957 | .resume = omap_udc_resume, | 2952 | .resume = omap_udc_resume, |
| 2953 | .driver = { | ||
| 2954 | .owner = THIS_MODULE, | ||
| 2955 | .name = (char *) driver_name, | ||
| 2956 | }, | ||
| 2958 | }; | 2957 | }; |
| 2959 | 2958 | ||
| 2960 | static int __init udc_init(void) | 2959 | static int __init udc_init(void) |
| @@ -2965,13 +2964,13 @@ static int __init udc_init(void) | |||
| 2965 | #endif | 2964 | #endif |
| 2966 | "%s\n", driver_desc, | 2965 | "%s\n", driver_desc, |
| 2967 | use_dma ? " (dma)" : ""); | 2966 | use_dma ? " (dma)" : ""); |
| 2968 | return driver_register(&udc_driver); | 2967 | return platform_driver_register(&udc_driver); |
| 2969 | } | 2968 | } |
| 2970 | module_init(udc_init); | 2969 | module_init(udc_init); |
| 2971 | 2970 | ||
| 2972 | static void __exit udc_exit(void) | 2971 | static void __exit udc_exit(void) |
| 2973 | { | 2972 | { |
| 2974 | driver_unregister(&udc_driver); | 2973 | platform_driver_unregister(&udc_driver); |
| 2975 | } | 2974 | } |
| 2976 | module_exit(udc_exit); | 2975 | module_exit(udc_exit); |
| 2977 | 2976 | ||
diff --git a/drivers/usb/gadget/pxa2xx_udc.c b/drivers/usb/gadget/pxa2xx_udc.c index 510d28a924db..bb028c5b8952 100644 --- a/drivers/usb/gadget/pxa2xx_udc.c +++ b/drivers/usb/gadget/pxa2xx_udc.c | |||
| @@ -2432,7 +2432,7 @@ static struct pxa2xx_udc memory = { | |||
| 2432 | /* | 2432 | /* |
| 2433 | * probe - binds to the platform device | 2433 | * probe - binds to the platform device |
| 2434 | */ | 2434 | */ |
| 2435 | static int __init pxa2xx_udc_probe(struct device *_dev) | 2435 | static int __init pxa2xx_udc_probe(struct platform_device *pdev) |
| 2436 | { | 2436 | { |
| 2437 | struct pxa2xx_udc *dev = &memory; | 2437 | struct pxa2xx_udc *dev = &memory; |
| 2438 | int retval, out_dma = 1; | 2438 | int retval, out_dma = 1; |
| @@ -2495,19 +2495,19 @@ static int __init pxa2xx_udc_probe(struct device *_dev) | |||
| 2495 | #endif | 2495 | #endif |
| 2496 | 2496 | ||
| 2497 | /* other non-static parts of init */ | 2497 | /* other non-static parts of init */ |
| 2498 | dev->dev = _dev; | 2498 | dev->dev = &pdev->dev; |
| 2499 | dev->mach = _dev->platform_data; | 2499 | dev->mach = pdev->dev.platform_data; |
| 2500 | 2500 | ||
| 2501 | init_timer(&dev->timer); | 2501 | init_timer(&dev->timer); |
| 2502 | dev->timer.function = udc_watchdog; | 2502 | dev->timer.function = udc_watchdog; |
| 2503 | dev->timer.data = (unsigned long) dev; | 2503 | dev->timer.data = (unsigned long) dev; |
| 2504 | 2504 | ||
| 2505 | device_initialize(&dev->gadget.dev); | 2505 | device_initialize(&dev->gadget.dev); |
| 2506 | dev->gadget.dev.parent = _dev; | 2506 | dev->gadget.dev.parent = &pdev->dev; |
| 2507 | dev->gadget.dev.dma_mask = _dev->dma_mask; | 2507 | dev->gadget.dev.dma_mask = pdev->dev.dma_mask; |
| 2508 | 2508 | ||
| 2509 | the_controller = dev; | 2509 | the_controller = dev; |
| 2510 | dev_set_drvdata(_dev, dev); | 2510 | platform_set_drvdata(pdev, dev); |
| 2511 | 2511 | ||
| 2512 | udc_disable(dev); | 2512 | udc_disable(dev); |
| 2513 | udc_reinit(dev); | 2513 | udc_reinit(dev); |
| @@ -2559,14 +2559,14 @@ lubbock_fail0: | |||
| 2559 | return 0; | 2559 | return 0; |
| 2560 | } | 2560 | } |
| 2561 | 2561 | ||
| 2562 | static void pxa2xx_udc_shutdown(struct device *_dev) | 2562 | static void pxa2xx_udc_shutdown(struct platform_device *_dev) |
| 2563 | { | 2563 | { |
| 2564 | pullup_off(); | 2564 | pullup_off(); |
| 2565 | } | 2565 | } |
| 2566 | 2566 | ||
| 2567 | static int __exit pxa2xx_udc_remove(struct device *_dev) | 2567 | static int __exit pxa2xx_udc_remove(struct platform_device *pdev) |
| 2568 | { | 2568 | { |
| 2569 | struct pxa2xx_udc *dev = dev_get_drvdata(_dev); | 2569 | struct pxa2xx_udc *dev = platform_get_drvdata(pdev); |
| 2570 | 2570 | ||
| 2571 | udc_disable(dev); | 2571 | udc_disable(dev); |
| 2572 | remove_proc_files(); | 2572 | remove_proc_files(); |
| @@ -2580,7 +2580,7 @@ static int __exit pxa2xx_udc_remove(struct device *_dev) | |||
| 2580 | free_irq(LUBBOCK_USB_DISC_IRQ, dev); | 2580 | free_irq(LUBBOCK_USB_DISC_IRQ, dev); |
| 2581 | free_irq(LUBBOCK_USB_IRQ, dev); | 2581 | free_irq(LUBBOCK_USB_IRQ, dev); |
| 2582 | } | 2582 | } |
| 2583 | dev_set_drvdata(_dev, NULL); | 2583 | platform_set_drvdata(pdev, NULL); |
| 2584 | the_controller = NULL; | 2584 | the_controller = NULL; |
| 2585 | return 0; | 2585 | return 0; |
| 2586 | } | 2586 | } |
| @@ -2601,9 +2601,9 @@ static int __exit pxa2xx_udc_remove(struct device *_dev) | |||
| 2601 | * VBUS IRQs should probably be ignored so that the PXA device just acts | 2601 | * VBUS IRQs should probably be ignored so that the PXA device just acts |
| 2602 | * "dead" to USB hosts until system resume. | 2602 | * "dead" to USB hosts until system resume. |
| 2603 | */ | 2603 | */ |
| 2604 | static int pxa2xx_udc_suspend(struct device *dev, pm_message_t state) | 2604 | static int pxa2xx_udc_suspend(struct platform_device *dev, pm_message_t state) |
| 2605 | { | 2605 | { |
| 2606 | struct pxa2xx_udc *udc = dev_get_drvdata(dev); | 2606 | struct pxa2xx_udc *udc = platform_get_drvdata(dev); |
| 2607 | 2607 | ||
| 2608 | if (!udc->mach->udc_command) | 2608 | if (!udc->mach->udc_command) |
| 2609 | WARN("USB host won't detect disconnect!\n"); | 2609 | WARN("USB host won't detect disconnect!\n"); |
| @@ -2612,9 +2612,9 @@ static int pxa2xx_udc_suspend(struct device *dev, pm_message_t state) | |||
| 2612 | return 0; | 2612 | return 0; |
| 2613 | } | 2613 | } |
| 2614 | 2614 | ||
| 2615 | static int pxa2xx_udc_resume(struct device *dev) | 2615 | static int pxa2xx_udc_resume(struct platform_device *dev) |
| 2616 | { | 2616 | { |
| 2617 | struct pxa2xx_udc *udc = dev_get_drvdata(dev); | 2617 | struct pxa2xx_udc *udc = platform_get_drvdata(dev); |
| 2618 | 2618 | ||
| 2619 | pullup(udc, 1); | 2619 | pullup(udc, 1); |
| 2620 | 2620 | ||
| @@ -2628,27 +2628,28 @@ static int pxa2xx_udc_resume(struct device *dev) | |||
| 2628 | 2628 | ||
| 2629 | /*-------------------------------------------------------------------------*/ | 2629 | /*-------------------------------------------------------------------------*/ |
| 2630 | 2630 | ||
| 2631 | static struct device_driver udc_driver = { | 2631 | static struct platform_driver udc_driver = { |
| 2632 | .name = "pxa2xx-udc", | ||
| 2633 | .owner = THIS_MODULE, | ||
| 2634 | .bus = &platform_bus_type, | ||
| 2635 | .probe = pxa2xx_udc_probe, | 2632 | .probe = pxa2xx_udc_probe, |
| 2636 | .shutdown = pxa2xx_udc_shutdown, | 2633 | .shutdown = pxa2xx_udc_shutdown, |
| 2637 | .remove = __exit_p(pxa2xx_udc_remove), | 2634 | .remove = __exit_p(pxa2xx_udc_remove), |
| 2638 | .suspend = pxa2xx_udc_suspend, | 2635 | .suspend = pxa2xx_udc_suspend, |
| 2639 | .resume = pxa2xx_udc_resume, | 2636 | .resume = pxa2xx_udc_resume, |
| 2637 | .driver = { | ||
| 2638 | .owner = THIS_MODULE, | ||
| 2639 | .name = "pxa2xx-udc", | ||
| 2640 | }, | ||
| 2640 | }; | 2641 | }; |
| 2641 | 2642 | ||
| 2642 | static int __init udc_init(void) | 2643 | static int __init udc_init(void) |
| 2643 | { | 2644 | { |
| 2644 | printk(KERN_INFO "%s: version %s\n", driver_name, DRIVER_VERSION); | 2645 | printk(KERN_INFO "%s: version %s\n", driver_name, DRIVER_VERSION); |
| 2645 | return driver_register(&udc_driver); | 2646 | return platform_driver_register(&udc_driver); |
| 2646 | } | 2647 | } |
| 2647 | module_init(udc_init); | 2648 | module_init(udc_init); |
| 2648 | 2649 | ||
| 2649 | static void __exit udc_exit(void) | 2650 | static void __exit udc_exit(void) |
| 2650 | { | 2651 | { |
| 2651 | driver_unregister(&udc_driver); | 2652 | platform_driver_unregister(&udc_driver); |
| 2652 | } | 2653 | } |
| 2653 | module_exit(udc_exit); | 2654 | module_exit(udc_exit); |
| 2654 | 2655 | ||
diff --git a/drivers/usb/host/isp116x-hcd.c b/drivers/usb/host/isp116x-hcd.c index f9c3f5b8dd1c..82f64986bc22 100644 --- a/drivers/usb/host/isp116x-hcd.c +++ b/drivers/usb/host/isp116x-hcd.c | |||
| @@ -1633,17 +1633,15 @@ static struct hc_driver isp116x_hc_driver = { | |||
| 1633 | 1633 | ||
| 1634 | /*----------------------------------------------------------------*/ | 1634 | /*----------------------------------------------------------------*/ |
| 1635 | 1635 | ||
| 1636 | static int __init_or_module isp116x_remove(struct device *dev) | 1636 | static int __init_or_module isp116x_remove(struct platform_device *pdev) |
| 1637 | { | 1637 | { |
| 1638 | struct usb_hcd *hcd = dev_get_drvdata(dev); | 1638 | struct usb_hcd *hcd = platform_get_drvdata(pdev); |
| 1639 | struct isp116x *isp116x; | 1639 | struct isp116x *isp116x; |
| 1640 | struct platform_device *pdev; | ||
| 1641 | struct resource *res; | 1640 | struct resource *res; |
| 1642 | 1641 | ||
| 1643 | if (!hcd) | 1642 | if (!hcd) |
| 1644 | return 0; | 1643 | return 0; |
| 1645 | isp116x = hcd_to_isp116x(hcd); | 1644 | isp116x = hcd_to_isp116x(hcd); |
| 1646 | pdev = container_of(dev, struct platform_device, dev); | ||
| 1647 | remove_debug_file(isp116x); | 1645 | remove_debug_file(isp116x); |
| 1648 | usb_remove_hcd(hcd); | 1646 | usb_remove_hcd(hcd); |
| 1649 | 1647 | ||
| @@ -1660,18 +1658,16 @@ static int __init_or_module isp116x_remove(struct device *dev) | |||
| 1660 | 1658 | ||
| 1661 | #define resource_len(r) (((r)->end - (r)->start) + 1) | 1659 | #define resource_len(r) (((r)->end - (r)->start) + 1) |
| 1662 | 1660 | ||
| 1663 | static int __init isp116x_probe(struct device *dev) | 1661 | static int __init isp116x_probe(struct platform_device *pdev) |
| 1664 | { | 1662 | { |
| 1665 | struct usb_hcd *hcd; | 1663 | struct usb_hcd *hcd; |
| 1666 | struct isp116x *isp116x; | 1664 | struct isp116x *isp116x; |
| 1667 | struct platform_device *pdev; | ||
| 1668 | struct resource *addr, *data; | 1665 | struct resource *addr, *data; |
| 1669 | void __iomem *addr_reg; | 1666 | void __iomem *addr_reg; |
| 1670 | void __iomem *data_reg; | 1667 | void __iomem *data_reg; |
| 1671 | int irq; | 1668 | int irq; |
| 1672 | int ret = 0; | 1669 | int ret = 0; |
| 1673 | 1670 | ||
| 1674 | pdev = container_of(dev, struct platform_device, dev); | ||
| 1675 | if (pdev->num_resources < 3) { | 1671 | if (pdev->num_resources < 3) { |
| 1676 | ret = -ENODEV; | 1672 | ret = -ENODEV; |
| 1677 | goto err1; | 1673 | goto err1; |
| @@ -1685,7 +1681,7 @@ static int __init isp116x_probe(struct device *dev) | |||
| 1685 | goto err1; | 1681 | goto err1; |
| 1686 | } | 1682 | } |
| 1687 | 1683 | ||
| 1688 | if (dev->dma_mask) { | 1684 | if (pdev->dev.dma_mask) { |
| 1689 | DBG("DMA not supported\n"); | 1685 | DBG("DMA not supported\n"); |
| 1690 | ret = -EINVAL; | 1686 | ret = -EINVAL; |
| 1691 | goto err1; | 1687 | goto err1; |
| @@ -1711,7 +1707,7 @@ static int __init isp116x_probe(struct device *dev) | |||
| 1711 | } | 1707 | } |
| 1712 | 1708 | ||
| 1713 | /* allocate and initialize hcd */ | 1709 | /* allocate and initialize hcd */ |
| 1714 | hcd = usb_create_hcd(&isp116x_hc_driver, dev, dev->bus_id); | 1710 | hcd = usb_create_hcd(&isp116x_hc_driver, &pdev->dev, pdev->dev.bus_id); |
| 1715 | if (!hcd) { | 1711 | if (!hcd) { |
| 1716 | ret = -ENOMEM; | 1712 | ret = -ENOMEM; |
| 1717 | goto err5; | 1713 | goto err5; |
| @@ -1723,7 +1719,7 @@ static int __init isp116x_probe(struct device *dev) | |||
| 1723 | isp116x->addr_reg = addr_reg; | 1719 | isp116x->addr_reg = addr_reg; |
| 1724 | spin_lock_init(&isp116x->lock); | 1720 | spin_lock_init(&isp116x->lock); |
| 1725 | INIT_LIST_HEAD(&isp116x->async); | 1721 | INIT_LIST_HEAD(&isp116x->async); |
| 1726 | isp116x->board = dev->platform_data; | 1722 | isp116x->board = pdev->dev.platform_data; |
| 1727 | 1723 | ||
| 1728 | if (!isp116x->board) { | 1724 | if (!isp116x->board) { |
| 1729 | ERR("Platform data structure not initialized\n"); | 1725 | ERR("Platform data structure not initialized\n"); |
| @@ -1764,13 +1760,13 @@ static int __init isp116x_probe(struct device *dev) | |||
| 1764 | /* | 1760 | /* |
| 1765 | Suspend of platform device | 1761 | Suspend of platform device |
| 1766 | */ | 1762 | */ |
| 1767 | static int isp116x_suspend(struct device *dev, pm_message_t state) | 1763 | static int isp116x_suspend(struct platform_device *dev, pm_message_t state) |
| 1768 | { | 1764 | { |
| 1769 | int ret = 0; | 1765 | int ret = 0; |
| 1770 | 1766 | ||
| 1771 | VDBG("%s: state %x\n", __func__, state); | 1767 | VDBG("%s: state %x\n", __func__, state); |
| 1772 | 1768 | ||
| 1773 | dev->power.power_state = state; | 1769 | dev->dev.power.power_state = state; |
| 1774 | 1770 | ||
| 1775 | return ret; | 1771 | return ret; |
| 1776 | } | 1772 | } |
| @@ -1778,13 +1774,13 @@ static int isp116x_suspend(struct device *dev, pm_message_t state) | |||
| 1778 | /* | 1774 | /* |
| 1779 | Resume platform device | 1775 | Resume platform device |
| 1780 | */ | 1776 | */ |
| 1781 | static int isp116x_resume(struct device *dev) | 1777 | static int isp116x_resume(struct platform_device *dev) |
| 1782 | { | 1778 | { |
| 1783 | int ret = 0; | 1779 | int ret = 0; |
| 1784 | 1780 | ||
| 1785 | VDBG("%s: state %x\n", __func__, dev->power.power_state); | 1781 | VDBG("%s: state %x\n", __func__, dev->dev.power.power_state); |
| 1786 | 1782 | ||
| 1787 | dev->power.power_state = PMSG_ON; | 1783 | dev->dev.power.power_state = PMSG_ON; |
| 1788 | 1784 | ||
| 1789 | return ret; | 1785 | return ret; |
| 1790 | } | 1786 | } |
| @@ -1796,13 +1792,14 @@ static int isp116x_resume(struct device *dev) | |||
| 1796 | 1792 | ||
| 1797 | #endif | 1793 | #endif |
| 1798 | 1794 | ||
| 1799 | static struct device_driver isp116x_driver = { | 1795 | static struct platform_driver isp116x_driver = { |
| 1800 | .name = (char *)hcd_name, | ||
| 1801 | .bus = &platform_bus_type, | ||
| 1802 | .probe = isp116x_probe, | 1796 | .probe = isp116x_probe, |
| 1803 | .remove = isp116x_remove, | 1797 | .remove = isp116x_remove, |
| 1804 | .suspend = isp116x_suspend, | 1798 | .suspend = isp116x_suspend, |
| 1805 | .resume = isp116x_resume, | 1799 | .resume = isp116x_resume, |
| 1800 | .driver = { | ||
| 1801 | .name = (char *)hcd_name, | ||
| 1802 | }, | ||
| 1806 | }; | 1803 | }; |
| 1807 | 1804 | ||
| 1808 | /*-----------------------------------------------------------------*/ | 1805 | /*-----------------------------------------------------------------*/ |
| @@ -1813,14 +1810,14 @@ static int __init isp116x_init(void) | |||
| 1813 | return -ENODEV; | 1810 | return -ENODEV; |
| 1814 | 1811 | ||
| 1815 | INFO("driver %s, %s\n", hcd_name, DRIVER_VERSION); | 1812 | INFO("driver %s, %s\n", hcd_name, DRIVER_VERSION); |
| 1816 | return driver_register(&isp116x_driver); | 1813 | return platform_driver_register(&isp116x_driver); |
| 1817 | } | 1814 | } |
| 1818 | 1815 | ||
| 1819 | module_init(isp116x_init); | 1816 | module_init(isp116x_init); |
| 1820 | 1817 | ||
| 1821 | static void __exit isp116x_cleanup(void) | 1818 | static void __exit isp116x_cleanup(void) |
| 1822 | { | 1819 | { |
| 1823 | driver_unregister(&isp116x_driver); | 1820 | platform_driver_unregister(&isp116x_driver); |
| 1824 | } | 1821 | } |
| 1825 | 1822 | ||
| 1826 | module_exit(isp116x_cleanup); | 1823 | module_exit(isp116x_cleanup); |
diff --git a/drivers/usb/host/ohci-au1xxx.c b/drivers/usb/host/ohci-au1xxx.c index f0c78cf14b6c..d9cf3b327d96 100644 --- a/drivers/usb/host/ohci-au1xxx.c +++ b/drivers/usb/host/ohci-au1xxx.c | |||
| @@ -225,9 +225,8 @@ static const struct hc_driver ohci_au1xxx_hc_driver = { | |||
| 225 | 225 | ||
| 226 | /*-------------------------------------------------------------------------*/ | 226 | /*-------------------------------------------------------------------------*/ |
| 227 | 227 | ||
| 228 | static int ohci_hcd_au1xxx_drv_probe(struct device *dev) | 228 | static int ohci_hcd_au1xxx_drv_probe(struct platform_device *pdev) |
| 229 | { | 229 | { |
| 230 | struct platform_device *pdev = to_platform_device(dev); | ||
| 231 | int ret; | 230 | int ret; |
| 232 | 231 | ||
| 233 | pr_debug ("In ohci_hcd_au1xxx_drv_probe"); | 232 | pr_debug ("In ohci_hcd_au1xxx_drv_probe"); |
| @@ -239,39 +238,37 @@ static int ohci_hcd_au1xxx_drv_probe(struct device *dev) | |||
| 239 | return ret; | 238 | return ret; |
| 240 | } | 239 | } |
| 241 | 240 | ||
| 242 | static int ohci_hcd_au1xxx_drv_remove(struct device *dev) | 241 | static int ohci_hcd_au1xxx_drv_remove(struct platform_device *pdev) |
| 243 | { | 242 | { |
| 244 | struct platform_device *pdev = to_platform_device(dev); | 243 | struct usb_hcd *hcd = platform_get_drvdata(pdev); |
| 245 | struct usb_hcd *hcd = dev_get_drvdata(dev); | ||
| 246 | 244 | ||
| 247 | usb_hcd_au1xxx_remove(hcd, pdev); | 245 | usb_hcd_au1xxx_remove(hcd, pdev); |
| 248 | return 0; | 246 | return 0; |
| 249 | } | 247 | } |
| 250 | /*TBD*/ | 248 | /*TBD*/ |
| 251 | /*static int ohci_hcd_au1xxx_drv_suspend(struct device *dev) | 249 | /*static int ohci_hcd_au1xxx_drv_suspend(struct platform_device *dev) |
| 252 | { | 250 | { |
| 253 | struct platform_device *pdev = to_platform_device(dev); | 251 | struct usb_hcd *hcd = platform_get_drvdata(dev); |
| 254 | struct usb_hcd *hcd = dev_get_drvdata(dev); | ||
| 255 | 252 | ||
| 256 | return 0; | 253 | return 0; |
| 257 | } | 254 | } |
| 258 | static int ohci_hcd_au1xxx_drv_resume(struct device *dev) | 255 | static int ohci_hcd_au1xxx_drv_resume(struct platform_device *dev) |
| 259 | { | 256 | { |
| 260 | struct platform_device *pdev = to_platform_device(dev); | 257 | struct usb_hcd *hcd = platform_get_drvdata(dev); |
| 261 | struct usb_hcd *hcd = dev_get_drvdata(dev); | ||
| 262 | 258 | ||
| 263 | return 0; | 259 | return 0; |
| 264 | } | 260 | } |
| 265 | */ | 261 | */ |
| 266 | 262 | ||
| 267 | static struct device_driver ohci_hcd_au1xxx_driver = { | 263 | static struct platform_driver ohci_hcd_au1xxx_driver = { |
| 268 | .name = "au1xxx-ohci", | ||
| 269 | .owner = THIS_MODULE, | ||
| 270 | .bus = &platform_bus_type, | ||
| 271 | .probe = ohci_hcd_au1xxx_drv_probe, | 264 | .probe = ohci_hcd_au1xxx_drv_probe, |
| 272 | .remove = ohci_hcd_au1xxx_drv_remove, | 265 | .remove = ohci_hcd_au1xxx_drv_remove, |
| 273 | /*.suspend = ohci_hcd_au1xxx_drv_suspend, */ | 266 | /*.suspend = ohci_hcd_au1xxx_drv_suspend, */ |
| 274 | /*.resume = ohci_hcd_au1xxx_drv_resume, */ | 267 | /*.resume = ohci_hcd_au1xxx_drv_resume, */ |
| 268 | .driver = { | ||
| 269 | .name = "au1xxx-ohci", | ||
| 270 | .owner = THIS_MODULE, | ||
| 271 | }, | ||
| 275 | }; | 272 | }; |
| 276 | 273 | ||
| 277 | static int __init ohci_hcd_au1xxx_init (void) | 274 | static int __init ohci_hcd_au1xxx_init (void) |
| @@ -280,12 +277,12 @@ static int __init ohci_hcd_au1xxx_init (void) | |||
| 280 | pr_debug ("block sizes: ed %d td %d\n", | 277 | pr_debug ("block sizes: ed %d td %d\n", |
| 281 | sizeof (struct ed), sizeof (struct td)); | 278 | sizeof (struct ed), sizeof (struct td)); |
| 282 | 279 | ||
| 283 | return driver_register(&ohci_hcd_au1xxx_driver); | 280 | return platform_driver_register(&ohci_hcd_au1xxx_driver); |
| 284 | } | 281 | } |
| 285 | 282 | ||
| 286 | static void __exit ohci_hcd_au1xxx_cleanup (void) | 283 | static void __exit ohci_hcd_au1xxx_cleanup (void) |
| 287 | { | 284 | { |
| 288 | driver_unregister(&ohci_hcd_au1xxx_driver); | 285 | platform_driver_unregister(&ohci_hcd_au1xxx_driver); |
| 289 | } | 286 | } |
| 290 | 287 | ||
| 291 | module_init (ohci_hcd_au1xxx_init); | 288 | module_init (ohci_hcd_au1xxx_init); |
diff --git a/drivers/usb/host/ohci-lh7a404.c b/drivers/usb/host/ohci-lh7a404.c index 336c766c6e29..081ec3f5cff4 100644 --- a/drivers/usb/host/ohci-lh7a404.c +++ b/drivers/usb/host/ohci-lh7a404.c | |||
| @@ -204,9 +204,8 @@ static const struct hc_driver ohci_lh7a404_hc_driver = { | |||
| 204 | 204 | ||
| 205 | /*-------------------------------------------------------------------------*/ | 205 | /*-------------------------------------------------------------------------*/ |
| 206 | 206 | ||
| 207 | static int ohci_hcd_lh7a404_drv_probe(struct device *dev) | 207 | static int ohci_hcd_lh7a404_drv_probe(struct platform_device *pdev) |
| 208 | { | 208 | { |
| 209 | struct platform_device *pdev = to_platform_device(dev); | ||
| 210 | int ret; | 209 | int ret; |
| 211 | 210 | ||
| 212 | pr_debug ("In ohci_hcd_lh7a404_drv_probe"); | 211 | pr_debug ("In ohci_hcd_lh7a404_drv_probe"); |
| @@ -218,40 +217,38 @@ static int ohci_hcd_lh7a404_drv_probe(struct device *dev) | |||
| 218 | return ret; | 217 | return ret; |
| 219 | } | 218 | } |
| 220 | 219 | ||
| 221 | static int ohci_hcd_lh7a404_drv_remove(struct device *dev) | 220 | static int ohci_hcd_lh7a404_drv_remove(struct platform_device *pdev) |
| 222 | { | 221 | { |
| 223 | struct platform_device *pdev = to_platform_device(dev); | 222 | struct usb_hcd *hcd = platform_get_drvdata(dev); |
| 224 | struct usb_hcd *hcd = dev_get_drvdata(dev); | ||
| 225 | 223 | ||
| 226 | usb_hcd_lh7a404_remove(hcd, pdev); | 224 | usb_hcd_lh7a404_remove(hcd, pdev); |
| 227 | return 0; | 225 | return 0; |
| 228 | } | 226 | } |
| 229 | /*TBD*/ | 227 | /*TBD*/ |
| 230 | /*static int ohci_hcd_lh7a404_drv_suspend(struct device *dev) | 228 | /*static int ohci_hcd_lh7a404_drv_suspend(struct platform_device *dev) |
| 231 | { | 229 | { |
| 232 | struct platform_device *pdev = to_platform_device(dev); | 230 | struct usb_hcd *hcd = platform_get_drvdata(dev); |
| 233 | struct usb_hcd *hcd = dev_get_drvdata(dev); | ||
| 234 | 231 | ||
| 235 | return 0; | 232 | return 0; |
| 236 | } | 233 | } |
| 237 | static int ohci_hcd_lh7a404_drv_resume(struct device *dev) | 234 | static int ohci_hcd_lh7a404_drv_resume(struct platform_device *dev) |
| 238 | { | 235 | { |
| 239 | struct platform_device *pdev = to_platform_device(dev); | 236 | struct usb_hcd *hcd = platform_get_drvdata(dev); |
| 240 | struct usb_hcd *hcd = dev_get_drvdata(dev); | ||
| 241 | 237 | ||
| 242 | 238 | ||
| 243 | return 0; | 239 | return 0; |
| 244 | } | 240 | } |
| 245 | */ | 241 | */ |
| 246 | 242 | ||
| 247 | static struct device_driver ohci_hcd_lh7a404_driver = { | 243 | static struct platform_driver ohci_hcd_lh7a404_driver = { |
| 248 | .name = "lh7a404-ohci", | ||
| 249 | .owner = THIS_MODULE, | ||
| 250 | .bus = &platform_bus_type, | ||
| 251 | .probe = ohci_hcd_lh7a404_drv_probe, | 244 | .probe = ohci_hcd_lh7a404_drv_probe, |
| 252 | .remove = ohci_hcd_lh7a404_drv_remove, | 245 | .remove = ohci_hcd_lh7a404_drv_remove, |
| 253 | /*.suspend = ohci_hcd_lh7a404_drv_suspend, */ | 246 | /*.suspend = ohci_hcd_lh7a404_drv_suspend, */ |
| 254 | /*.resume = ohci_hcd_lh7a404_drv_resume, */ | 247 | /*.resume = ohci_hcd_lh7a404_drv_resume, */ |
| 248 | .driver = { | ||
| 249 | .name = "lh7a404-ohci", | ||
| 250 | .owner = THIS_MODULE, | ||
| 251 | }, | ||
| 255 | }; | 252 | }; |
| 256 | 253 | ||
| 257 | static int __init ohci_hcd_lh7a404_init (void) | 254 | static int __init ohci_hcd_lh7a404_init (void) |
| @@ -260,12 +257,12 @@ static int __init ohci_hcd_lh7a404_init (void) | |||
| 260 | pr_debug ("block sizes: ed %d td %d\n", | 257 | pr_debug ("block sizes: ed %d td %d\n", |
| 261 | sizeof (struct ed), sizeof (struct td)); | 258 | sizeof (struct ed), sizeof (struct td)); |
| 262 | 259 | ||
| 263 | return driver_register(&ohci_hcd_lh7a404_driver); | 260 | return platform_driver_register(&ohci_hcd_lh7a404_driver); |
| 264 | } | 261 | } |
| 265 | 262 | ||
| 266 | static void __exit ohci_hcd_lh7a404_cleanup (void) | 263 | static void __exit ohci_hcd_lh7a404_cleanup (void) |
| 267 | { | 264 | { |
| 268 | driver_unregister(&ohci_hcd_lh7a404_driver); | 265 | platform_driver_unregister(&ohci_hcd_lh7a404_driver); |
| 269 | } | 266 | } |
| 270 | 267 | ||
| 271 | module_init (ohci_hcd_lh7a404_init); | 268 | module_init (ohci_hcd_lh7a404_init); |
diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c index e46cc540cf4d..c9e29d808711 100644 --- a/drivers/usb/host/ohci-omap.c +++ b/drivers/usb/host/ohci-omap.c | |||
| @@ -433,24 +433,22 @@ static const struct hc_driver ohci_omap_hc_driver = { | |||
| 433 | 433 | ||
| 434 | /*-------------------------------------------------------------------------*/ | 434 | /*-------------------------------------------------------------------------*/ |
| 435 | 435 | ||
| 436 | static int ohci_hcd_omap_drv_probe(struct device *dev) | 436 | static int ohci_hcd_omap_drv_probe(struct platform_device *dev) |
| 437 | { | 437 | { |
| 438 | return usb_hcd_omap_probe(&ohci_omap_hc_driver, | 438 | return usb_hcd_omap_probe(&ohci_omap_hc_driver, dev); |
| 439 | to_platform_device(dev)); | ||
| 440 | } | 439 | } |
| 441 | 440 | ||
| 442 | static int ohci_hcd_omap_drv_remove(struct device *dev) | 441 | static int ohci_hcd_omap_drv_remove(struct platform_device *dev) |
| 443 | { | 442 | { |
| 444 | struct platform_device *pdev = to_platform_device(dev); | 443 | struct usb_hcd *hcd = platform_get_drvdata(dev); |
| 445 | struct usb_hcd *hcd = dev_get_drvdata(dev); | ||
| 446 | struct ohci_hcd *ohci = hcd_to_ohci (hcd); | 444 | struct ohci_hcd *ohci = hcd_to_ohci (hcd); |
| 447 | 445 | ||
| 448 | usb_hcd_omap_remove(hcd, pdev); | 446 | usb_hcd_omap_remove(hcd, dev); |
| 449 | if (ohci->transceiver) { | 447 | if (ohci->transceiver) { |
| 450 | (void) otg_set_host(ohci->transceiver, 0); | 448 | (void) otg_set_host(ohci->transceiver, 0); |
| 451 | put_device(ohci->transceiver->dev); | 449 | put_device(ohci->transceiver->dev); |
| 452 | } | 450 | } |
| 453 | dev_set_drvdata(dev, NULL); | 451 | platform_set_drvdata(dev, NULL); |
| 454 | 452 | ||
| 455 | return 0; | 453 | return 0; |
| 456 | } | 454 | } |
| @@ -459,9 +457,9 @@ static int ohci_hcd_omap_drv_remove(struct device *dev) | |||
| 459 | 457 | ||
| 460 | #ifdef CONFIG_PM | 458 | #ifdef CONFIG_PM |
| 461 | 459 | ||
| 462 | static int ohci_omap_suspend(struct device *dev, pm_message_t message) | 460 | static int ohci_omap_suspend(struct platform_device *dev, pm_message_t message) |
| 463 | { | 461 | { |
| 464 | struct ohci_hcd *ohci = hcd_to_ohci(dev_get_drvdata(dev)); | 462 | struct ohci_hcd *ohci = hcd_to_ohci(platform_get_drvdata(dev)); |
| 465 | 463 | ||
| 466 | if (time_before(jiffies, ohci->next_statechange)) | 464 | if (time_before(jiffies, ohci->next_statechange)) |
| 467 | msleep(5); | 465 | msleep(5); |
| @@ -473,9 +471,9 @@ static int ohci_omap_suspend(struct device *dev, pm_message_t message) | |||
| 473 | return 0; | 471 | return 0; |
| 474 | } | 472 | } |
| 475 | 473 | ||
| 476 | static int ohci_omap_resume(struct device *dev) | 474 | static int ohci_omap_resume(struct platform_device *dev) |
| 477 | { | 475 | { |
| 478 | struct ohci_hcd *ohci = hcd_to_ohci(dev_get_drvdata(dev)); | 476 | struct ohci_hcd *ohci = hcd_to_ohci(platform_get_drvdata(dev)); |
| 479 | 477 | ||
| 480 | if (time_before(jiffies, ohci->next_statechange)) | 478 | if (time_before(jiffies, ohci->next_statechange)) |
| 481 | msleep(5); | 479 | msleep(5); |
| @@ -494,16 +492,17 @@ static int ohci_omap_resume(struct device *dev) | |||
| 494 | /* | 492 | /* |
| 495 | * Driver definition to register with the OMAP bus | 493 | * Driver definition to register with the OMAP bus |
| 496 | */ | 494 | */ |
| 497 | static struct device_driver ohci_hcd_omap_driver = { | 495 | static struct platform_driver ohci_hcd_omap_driver = { |
| 498 | .name = "ohci", | ||
| 499 | .owner = THIS_MODULE, | ||
| 500 | .bus = &platform_bus_type, | ||
| 501 | .probe = ohci_hcd_omap_drv_probe, | 496 | .probe = ohci_hcd_omap_drv_probe, |
| 502 | .remove = ohci_hcd_omap_drv_remove, | 497 | .remove = ohci_hcd_omap_drv_remove, |
| 503 | #ifdef CONFIG_PM | 498 | #ifdef CONFIG_PM |
| 504 | .suspend = ohci_omap_suspend, | 499 | .suspend = ohci_omap_suspend, |
| 505 | .resume = ohci_omap_resume, | 500 | .resume = ohci_omap_resume, |
| 506 | #endif | 501 | #endif |
| 502 | .driver = { | ||
| 503 | .owner = THIS_MODULE, | ||
| 504 | .name = "ohci", | ||
| 505 | }, | ||
| 507 | }; | 506 | }; |
| 508 | 507 | ||
| 509 | static int __init ohci_hcd_omap_init (void) | 508 | static int __init ohci_hcd_omap_init (void) |
| @@ -515,12 +514,12 @@ static int __init ohci_hcd_omap_init (void) | |||
| 515 | pr_debug("%s: block sizes: ed %Zd td %Zd\n", hcd_name, | 514 | pr_debug("%s: block sizes: ed %Zd td %Zd\n", hcd_name, |
| 516 | sizeof (struct ed), sizeof (struct td)); | 515 | sizeof (struct ed), sizeof (struct td)); |
| 517 | 516 | ||
| 518 | return driver_register(&ohci_hcd_omap_driver); | 517 | return platform_driver_register(&ohci_hcd_omap_driver); |
| 519 | } | 518 | } |
| 520 | 519 | ||
| 521 | static void __exit ohci_hcd_omap_cleanup (void) | 520 | static void __exit ohci_hcd_omap_cleanup (void) |
| 522 | { | 521 | { |
| 523 | driver_unregister(&ohci_hcd_omap_driver); | 522 | platform_driver_unregister(&ohci_hcd_omap_driver); |
| 524 | } | 523 | } |
| 525 | 524 | ||
| 526 | module_init (ohci_hcd_omap_init); | 525 | module_init (ohci_hcd_omap_init); |
diff --git a/drivers/usb/host/ohci-ppc-soc.c b/drivers/usb/host/ohci-ppc-soc.c index 92cf6f4a1374..18755766e406 100644 --- a/drivers/usb/host/ohci-ppc-soc.c +++ b/drivers/usb/host/ohci-ppc-soc.c | |||
| @@ -172,9 +172,8 @@ static const struct hc_driver ohci_ppc_soc_hc_driver = { | |||
| 172 | .start_port_reset = ohci_start_port_reset, | 172 | .start_port_reset = ohci_start_port_reset, |
| 173 | }; | 173 | }; |
| 174 | 174 | ||
| 175 | static int ohci_hcd_ppc_soc_drv_probe(struct device *dev) | 175 | static int ohci_hcd_ppc_soc_drv_probe(struct platform_device *pdev) |
| 176 | { | 176 | { |
| 177 | struct platform_device *pdev = to_platform_device(dev); | ||
| 178 | int ret; | 177 | int ret; |
| 179 | 178 | ||
| 180 | if (usb_disabled()) | 179 | if (usb_disabled()) |
| @@ -184,25 +183,25 @@ static int ohci_hcd_ppc_soc_drv_probe(struct device *dev) | |||
| 184 | return ret; | 183 | return ret; |
| 185 | } | 184 | } |
| 186 | 185 | ||
| 187 | static int ohci_hcd_ppc_soc_drv_remove(struct device *dev) | 186 | static int ohci_hcd_ppc_soc_drv_remove(struct platform_device *pdev) |
| 188 | { | 187 | { |
| 189 | struct platform_device *pdev = to_platform_device(dev); | 188 | struct usb_hcd *hcd = platform_get_drvdata(dev); |
| 190 | struct usb_hcd *hcd = dev_get_drvdata(dev); | ||
| 191 | 189 | ||
| 192 | usb_hcd_ppc_soc_remove(hcd, pdev); | 190 | usb_hcd_ppc_soc_remove(hcd, pdev); |
| 193 | return 0; | 191 | return 0; |
| 194 | } | 192 | } |
| 195 | 193 | ||
| 196 | static struct device_driver ohci_hcd_ppc_soc_driver = { | 194 | static struct platform_driver ohci_hcd_ppc_soc_driver = { |
| 197 | .name = "ppc-soc-ohci", | ||
| 198 | .owner = THIS_MODULE, | ||
| 199 | .bus = &platform_bus_type, | ||
| 200 | .probe = ohci_hcd_ppc_soc_drv_probe, | 195 | .probe = ohci_hcd_ppc_soc_drv_probe, |
| 201 | .remove = ohci_hcd_ppc_soc_drv_remove, | 196 | .remove = ohci_hcd_ppc_soc_drv_remove, |
| 202 | #ifdef CONFIG_PM | 197 | #ifdef CONFIG_PM |
| 203 | /*.suspend = ohci_hcd_ppc_soc_drv_suspend,*/ | 198 | /*.suspend = ohci_hcd_ppc_soc_drv_suspend,*/ |
| 204 | /*.resume = ohci_hcd_ppc_soc_drv_resume,*/ | 199 | /*.resume = ohci_hcd_ppc_soc_drv_resume,*/ |
| 205 | #endif | 200 | #endif |
| 201 | .driver = { | ||
| 202 | .name = "ppc-soc-ohci", | ||
| 203 | .owner = THIS_MODULE, | ||
| 204 | }, | ||
| 206 | }; | 205 | }; |
| 207 | 206 | ||
| 208 | static int __init ohci_hcd_ppc_soc_init(void) | 207 | static int __init ohci_hcd_ppc_soc_init(void) |
| @@ -211,12 +210,12 @@ static int __init ohci_hcd_ppc_soc_init(void) | |||
| 211 | pr_debug("block sizes: ed %d td %d\n", sizeof(struct ed), | 210 | pr_debug("block sizes: ed %d td %d\n", sizeof(struct ed), |
| 212 | sizeof(struct td)); | 211 | sizeof(struct td)); |
| 213 | 212 | ||
| 214 | return driver_register(&ohci_hcd_ppc_soc_driver); | 213 | return platform_driver_register(&ohci_hcd_ppc_soc_driver); |
| 215 | } | 214 | } |
| 216 | 215 | ||
| 217 | static void __exit ohci_hcd_ppc_soc_cleanup(void) | 216 | static void __exit ohci_hcd_ppc_soc_cleanup(void) |
| 218 | { | 217 | { |
| 219 | driver_unregister(&ohci_hcd_ppc_soc_driver); | 218 | platform_driver_unregister(&ohci_hcd_ppc_soc_driver); |
| 220 | } | 219 | } |
| 221 | 220 | ||
| 222 | module_init(ohci_hcd_ppc_soc_init); | 221 | module_init(ohci_hcd_ppc_soc_init); |
diff --git a/drivers/usb/host/ohci-pxa27x.c b/drivers/usb/host/ohci-pxa27x.c index 59e20568e8f9..9d65ec307990 100644 --- a/drivers/usb/host/ohci-pxa27x.c +++ b/drivers/usb/host/ohci-pxa27x.c | |||
| @@ -290,9 +290,8 @@ static const struct hc_driver ohci_pxa27x_hc_driver = { | |||
| 290 | 290 | ||
| 291 | /*-------------------------------------------------------------------------*/ | 291 | /*-------------------------------------------------------------------------*/ |
| 292 | 292 | ||
| 293 | static int ohci_hcd_pxa27x_drv_probe(struct device *dev) | 293 | static int ohci_hcd_pxa27x_drv_probe(struct platform_device *pdev) |
| 294 | { | 294 | { |
| 295 | struct platform_device *pdev = to_platform_device(dev); | ||
| 296 | int ret; | 295 | int ret; |
| 297 | 296 | ||
| 298 | pr_debug ("In ohci_hcd_pxa27x_drv_probe"); | 297 | pr_debug ("In ohci_hcd_pxa27x_drv_probe"); |
| @@ -304,41 +303,39 @@ static int ohci_hcd_pxa27x_drv_probe(struct device *dev) | |||
| 304 | return ret; | 303 | return ret; |
| 305 | } | 304 | } |
| 306 | 305 | ||
| 307 | static int ohci_hcd_pxa27x_drv_remove(struct device *dev) | 306 | static int ohci_hcd_pxa27x_drv_remove(struct platform_device *pdev) |
| 308 | { | 307 | { |
| 309 | struct platform_device *pdev = to_platform_device(dev); | 308 | struct usb_hcd *hcd = platform_get_drvdata(pdev); |
| 310 | struct usb_hcd *hcd = dev_get_drvdata(dev); | ||
| 311 | 309 | ||
| 312 | usb_hcd_pxa27x_remove(hcd, pdev); | 310 | usb_hcd_pxa27x_remove(hcd, pdev); |
| 313 | return 0; | 311 | return 0; |
| 314 | } | 312 | } |
| 315 | 313 | ||
| 316 | static int ohci_hcd_pxa27x_drv_suspend(struct device *dev, pm_message_t state) | 314 | static int ohci_hcd_pxa27x_drv_suspend(struct platform_device *dev, pm_message_t state) |
| 317 | { | 315 | { |
| 318 | // struct platform_device *pdev = to_platform_device(dev); | 316 | // struct usb_hcd *hcd = platform_get_drvdata(dev); |
| 319 | // struct usb_hcd *hcd = dev_get_drvdata(dev); | ||
| 320 | printk("%s: not implemented yet\n", __FUNCTION__); | 317 | printk("%s: not implemented yet\n", __FUNCTION__); |
| 321 | 318 | ||
| 322 | return 0; | 319 | return 0; |
| 323 | } | 320 | } |
| 324 | 321 | ||
| 325 | static int ohci_hcd_pxa27x_drv_resume(struct device *dev) | 322 | static int ohci_hcd_pxa27x_drv_resume(struct platform_device *dev) |
| 326 | { | 323 | { |
| 327 | // struct platform_device *pdev = to_platform_device(dev); | 324 | // struct usb_hcd *hcd = platform_get_drvdata(dev); |
| 328 | // struct usb_hcd *hcd = dev_get_drvdata(dev); | ||
| 329 | printk("%s: not implemented yet\n", __FUNCTION__); | 325 | printk("%s: not implemented yet\n", __FUNCTION__); |
| 330 | 326 | ||
| 331 | return 0; | 327 | return 0; |
| 332 | } | 328 | } |
| 333 | 329 | ||
| 334 | 330 | ||
| 335 | static struct device_driver ohci_hcd_pxa27x_driver = { | 331 | static struct platform_driver ohci_hcd_pxa27x_driver = { |
| 336 | .name = "pxa27x-ohci", | ||
| 337 | .bus = &platform_bus_type, | ||
| 338 | .probe = ohci_hcd_pxa27x_drv_probe, | 332 | .probe = ohci_hcd_pxa27x_drv_probe, |
| 339 | .remove = ohci_hcd_pxa27x_drv_remove, | 333 | .remove = ohci_hcd_pxa27x_drv_remove, |
| 340 | .suspend = ohci_hcd_pxa27x_drv_suspend, | 334 | .suspend = ohci_hcd_pxa27x_drv_suspend, |
| 341 | .resume = ohci_hcd_pxa27x_drv_resume, | 335 | .resume = ohci_hcd_pxa27x_drv_resume, |
| 336 | .driver = { | ||
| 337 | .name = "pxa27x-ohci", | ||
| 338 | }, | ||
| 342 | }; | 339 | }; |
| 343 | 340 | ||
| 344 | static int __init ohci_hcd_pxa27x_init (void) | 341 | static int __init ohci_hcd_pxa27x_init (void) |
| @@ -347,12 +344,12 @@ static int __init ohci_hcd_pxa27x_init (void) | |||
| 347 | pr_debug ("block sizes: ed %d td %d\n", | 344 | pr_debug ("block sizes: ed %d td %d\n", |
| 348 | sizeof (struct ed), sizeof (struct td)); | 345 | sizeof (struct ed), sizeof (struct td)); |
| 349 | 346 | ||
| 350 | return driver_register(&ohci_hcd_pxa27x_driver); | 347 | return platform_driver_register(&ohci_hcd_pxa27x_driver); |
| 351 | } | 348 | } |
| 352 | 349 | ||
| 353 | static void __exit ohci_hcd_pxa27x_cleanup (void) | 350 | static void __exit ohci_hcd_pxa27x_cleanup (void) |
| 354 | { | 351 | { |
| 355 | driver_unregister(&ohci_hcd_pxa27x_driver); | 352 | platform_driver_unregister(&ohci_hcd_pxa27x_driver); |
| 356 | } | 353 | } |
| 357 | 354 | ||
| 358 | module_init (ohci_hcd_pxa27x_init); | 355 | module_init (ohci_hcd_pxa27x_init); |
diff --git a/drivers/usb/host/ohci-s3c2410.c b/drivers/usb/host/ohci-s3c2410.c index ee1fc605b402..35cc9402adc0 100644 --- a/drivers/usb/host/ohci-s3c2410.c +++ b/drivers/usb/host/ohci-s3c2410.c | |||
| @@ -459,39 +459,38 @@ static const struct hc_driver ohci_s3c2410_hc_driver = { | |||
| 459 | 459 | ||
| 460 | /* device driver */ | 460 | /* device driver */ |
| 461 | 461 | ||
| 462 | static int ohci_hcd_s3c2410_drv_probe(struct device *dev) | 462 | static int ohci_hcd_s3c2410_drv_probe(struct platform_device *pdev) |
| 463 | { | 463 | { |
| 464 | struct platform_device *pdev = to_platform_device(dev); | ||
| 465 | return usb_hcd_s3c2410_probe(&ohci_s3c2410_hc_driver, pdev); | 464 | return usb_hcd_s3c2410_probe(&ohci_s3c2410_hc_driver, pdev); |
| 466 | } | 465 | } |
| 467 | 466 | ||
| 468 | static int ohci_hcd_s3c2410_drv_remove(struct device *dev) | 467 | static int ohci_hcd_s3c2410_drv_remove(struct platform_device *pdev) |
| 469 | { | 468 | { |
| 470 | struct platform_device *pdev = to_platform_device(dev); | 469 | struct usb_hcd *hcd = platform_get_drvdata(pdev); |
| 471 | struct usb_hcd *hcd = dev_get_drvdata(dev); | ||
| 472 | 470 | ||
| 473 | usb_hcd_s3c2410_remove(hcd, pdev); | 471 | usb_hcd_s3c2410_remove(hcd, pdev); |
| 474 | return 0; | 472 | return 0; |
| 475 | } | 473 | } |
| 476 | 474 | ||
| 477 | static struct device_driver ohci_hcd_s3c2410_driver = { | 475 | static struct platform_driver ohci_hcd_s3c2410_driver = { |
| 478 | .name = "s3c2410-ohci", | ||
| 479 | .owner = THIS_MODULE, | ||
| 480 | .bus = &platform_bus_type, | ||
| 481 | .probe = ohci_hcd_s3c2410_drv_probe, | 476 | .probe = ohci_hcd_s3c2410_drv_probe, |
| 482 | .remove = ohci_hcd_s3c2410_drv_remove, | 477 | .remove = ohci_hcd_s3c2410_drv_remove, |
| 483 | /*.suspend = ohci_hcd_s3c2410_drv_suspend, */ | 478 | /*.suspend = ohci_hcd_s3c2410_drv_suspend, */ |
| 484 | /*.resume = ohci_hcd_s3c2410_drv_resume, */ | 479 | /*.resume = ohci_hcd_s3c2410_drv_resume, */ |
| 480 | .driver = { | ||
| 481 | .owner = THIS_MODULE, | ||
| 482 | .name = "s3c2410-ohci", | ||
| 483 | }, | ||
| 485 | }; | 484 | }; |
| 486 | 485 | ||
| 487 | static int __init ohci_hcd_s3c2410_init (void) | 486 | static int __init ohci_hcd_s3c2410_init (void) |
| 488 | { | 487 | { |
| 489 | return driver_register(&ohci_hcd_s3c2410_driver); | 488 | return platform_driver_register(&ohci_hcd_s3c2410_driver); |
| 490 | } | 489 | } |
| 491 | 490 | ||
| 492 | static void __exit ohci_hcd_s3c2410_cleanup (void) | 491 | static void __exit ohci_hcd_s3c2410_cleanup (void) |
| 493 | { | 492 | { |
| 494 | driver_unregister(&ohci_hcd_s3c2410_driver); | 493 | platform_driver_unregister(&ohci_hcd_s3c2410_driver); |
| 495 | } | 494 | } |
| 496 | 495 | ||
| 497 | module_init (ohci_hcd_s3c2410_init); | 496 | module_init (ohci_hcd_s3c2410_init); |
diff --git a/drivers/usb/host/sl811-hcd.c b/drivers/usb/host/sl811-hcd.c index 5607c0ae6835..a7722a6a5a5b 100644 --- a/drivers/usb/host/sl811-hcd.c +++ b/drivers/usb/host/sl811-hcd.c | |||
| @@ -1631,24 +1631,21 @@ static struct hc_driver sl811h_hc_driver = { | |||
| 1631 | /*-------------------------------------------------------------------------*/ | 1631 | /*-------------------------------------------------------------------------*/ |
| 1632 | 1632 | ||
| 1633 | static int __devexit | 1633 | static int __devexit |
| 1634 | sl811h_remove(struct device *dev) | 1634 | sl811h_remove(struct platform_device *dev) |
| 1635 | { | 1635 | { |
| 1636 | struct usb_hcd *hcd = dev_get_drvdata(dev); | 1636 | struct usb_hcd *hcd = platform_get_drvdata(dev); |
| 1637 | struct sl811 *sl811 = hcd_to_sl811(hcd); | 1637 | struct sl811 *sl811 = hcd_to_sl811(hcd); |
| 1638 | struct platform_device *pdev; | ||
| 1639 | struct resource *res; | 1638 | struct resource *res; |
| 1640 | 1639 | ||
| 1641 | pdev = container_of(dev, struct platform_device, dev); | ||
| 1642 | |||
| 1643 | remove_debug_file(sl811); | 1640 | remove_debug_file(sl811); |
| 1644 | usb_remove_hcd(hcd); | 1641 | usb_remove_hcd(hcd); |
| 1645 | 1642 | ||
| 1646 | /* some platforms may use IORESOURCE_IO */ | 1643 | /* some platforms may use IORESOURCE_IO */ |
| 1647 | res = platform_get_resource(pdev, IORESOURCE_MEM, 1); | 1644 | res = platform_get_resource(dev, IORESOURCE_MEM, 1); |
| 1648 | if (res) | 1645 | if (res) |
| 1649 | iounmap(sl811->data_reg); | 1646 | iounmap(sl811->data_reg); |
| 1650 | 1647 | ||
| 1651 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 1648 | res = platform_get_resource(dev, IORESOURCE_MEM, 0); |
| 1652 | if (res) | 1649 | if (res) |
| 1653 | iounmap(sl811->addr_reg); | 1650 | iounmap(sl811->addr_reg); |
| 1654 | 1651 | ||
| @@ -1657,11 +1654,10 @@ sl811h_remove(struct device *dev) | |||
| 1657 | } | 1654 | } |
| 1658 | 1655 | ||
| 1659 | static int __devinit | 1656 | static int __devinit |
| 1660 | sl811h_probe(struct device *dev) | 1657 | sl811h_probe(struct platform_device *dev) |
| 1661 | { | 1658 | { |
| 1662 | struct usb_hcd *hcd; | 1659 | struct usb_hcd *hcd; |
| 1663 | struct sl811 *sl811; | 1660 | struct sl811 *sl811; |
| 1664 | struct platform_device *pdev; | ||
| 1665 | struct resource *addr, *data; | 1661 | struct resource *addr, *data; |
| 1666 | int irq; | 1662 | int irq; |
| 1667 | void __iomem *addr_reg; | 1663 | void __iomem *addr_reg; |
| @@ -1674,24 +1670,23 @@ sl811h_probe(struct device *dev) | |||
| 1674 | * specific platform_data. we don't probe for IRQs, and do only | 1670 | * specific platform_data. we don't probe for IRQs, and do only |
| 1675 | * minimal sanity checking. | 1671 | * minimal sanity checking. |
| 1676 | */ | 1672 | */ |
| 1677 | pdev = container_of(dev, struct platform_device, dev); | 1673 | irq = platform_get_irq(dev, 0); |
| 1678 | irq = platform_get_irq(pdev, 0); | 1674 | if (dev->num_resources < 3 || irq < 0) |
| 1679 | if (pdev->num_resources < 3 || irq < 0) | ||
| 1680 | return -ENODEV; | 1675 | return -ENODEV; |
| 1681 | 1676 | ||
| 1682 | /* refuse to confuse usbcore */ | 1677 | /* refuse to confuse usbcore */ |
| 1683 | if (dev->dma_mask) { | 1678 | if (dev->dev.dma_mask) { |
| 1684 | DBG("no we won't dma\n"); | 1679 | DBG("no we won't dma\n"); |
| 1685 | return -EINVAL; | 1680 | return -EINVAL; |
| 1686 | } | 1681 | } |
| 1687 | 1682 | ||
| 1688 | /* the chip may be wired for either kind of addressing */ | 1683 | /* the chip may be wired for either kind of addressing */ |
| 1689 | addr = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 1684 | addr = platform_get_resource(dev, IORESOURCE_MEM, 0); |
| 1690 | data = platform_get_resource(pdev, IORESOURCE_MEM, 1); | 1685 | data = platform_get_resource(dev, IORESOURCE_MEM, 1); |
| 1691 | retval = -EBUSY; | 1686 | retval = -EBUSY; |
| 1692 | if (!addr || !data) { | 1687 | if (!addr || !data) { |
| 1693 | addr = platform_get_resource(pdev, IORESOURCE_IO, 0); | 1688 | addr = platform_get_resource(dev, IORESOURCE_IO, 0); |
| 1694 | data = platform_get_resource(pdev, IORESOURCE_IO, 1); | 1689 | data = platform_get_resource(dev, IORESOURCE_IO, 1); |
| 1695 | if (!addr || !data) | 1690 | if (!addr || !data) |
| 1696 | return -ENODEV; | 1691 | return -ENODEV; |
| 1697 | ioaddr = 1; | 1692 | ioaddr = 1; |
| @@ -1713,7 +1708,7 @@ sl811h_probe(struct device *dev) | |||
| 1713 | } | 1708 | } |
| 1714 | 1709 | ||
| 1715 | /* allocate and initialize hcd */ | 1710 | /* allocate and initialize hcd */ |
| 1716 | hcd = usb_create_hcd(&sl811h_hc_driver, dev, dev->bus_id); | 1711 | hcd = usb_create_hcd(&sl811h_hc_driver, &dev->dev, dev->dev.bus_id); |
| 1717 | if (!hcd) { | 1712 | if (!hcd) { |
| 1718 | retval = -ENOMEM; | 1713 | retval = -ENOMEM; |
| 1719 | goto err5; | 1714 | goto err5; |
| @@ -1723,7 +1718,7 @@ sl811h_probe(struct device *dev) | |||
| 1723 | 1718 | ||
| 1724 | spin_lock_init(&sl811->lock); | 1719 | spin_lock_init(&sl811->lock); |
| 1725 | INIT_LIST_HEAD(&sl811->async); | 1720 | INIT_LIST_HEAD(&sl811->async); |
| 1726 | sl811->board = dev->platform_data; | 1721 | sl811->board = dev->dev.platform_data; |
| 1727 | init_timer(&sl811->timer); | 1722 | init_timer(&sl811->timer); |
| 1728 | sl811->timer.function = sl811h_timer; | 1723 | sl811->timer.function = sl811h_timer; |
| 1729 | sl811->timer.data = (unsigned long) sl811; | 1724 | sl811->timer.data = (unsigned long) sl811; |
| @@ -1785,9 +1780,9 @@ sl811h_probe(struct device *dev) | |||
| 1785 | */ | 1780 | */ |
| 1786 | 1781 | ||
| 1787 | static int | 1782 | static int |
| 1788 | sl811h_suspend(struct device *dev, pm_message_t state) | 1783 | sl811h_suspend(struct platform_device *dev, pm_message_t state) |
| 1789 | { | 1784 | { |
| 1790 | struct usb_hcd *hcd = dev_get_drvdata(dev); | 1785 | struct usb_hcd *hcd = platform_get_drvdata(dev); |
| 1791 | struct sl811 *sl811 = hcd_to_sl811(hcd); | 1786 | struct sl811 *sl811 = hcd_to_sl811(hcd); |
| 1792 | int retval = 0; | 1787 | int retval = 0; |
| 1793 | 1788 | ||
| @@ -1796,27 +1791,27 @@ sl811h_suspend(struct device *dev, pm_message_t state) | |||
| 1796 | else if (state.event == PM_EVENT_SUSPEND) | 1791 | else if (state.event == PM_EVENT_SUSPEND) |
| 1797 | port_power(sl811, 0); | 1792 | port_power(sl811, 0); |
| 1798 | if (retval == 0) | 1793 | if (retval == 0) |
| 1799 | dev->power.power_state = state; | 1794 | dev->dev.power.power_state = state; |
| 1800 | return retval; | 1795 | return retval; |
| 1801 | } | 1796 | } |
| 1802 | 1797 | ||
| 1803 | static int | 1798 | static int |
| 1804 | sl811h_resume(struct device *dev) | 1799 | sl811h_resume(struct platform_device *dev) |
| 1805 | { | 1800 | { |
| 1806 | struct usb_hcd *hcd = dev_get_drvdata(dev); | 1801 | struct usb_hcd *hcd = platform_get_drvdata(dev); |
| 1807 | struct sl811 *sl811 = hcd_to_sl811(hcd); | 1802 | struct sl811 *sl811 = hcd_to_sl811(hcd); |
| 1808 | 1803 | ||
| 1809 | /* with no "check to see if VBUS is still powered" board hook, | 1804 | /* with no "check to see if VBUS is still powered" board hook, |
| 1810 | * let's assume it'd only be powered to enable remote wakeup. | 1805 | * let's assume it'd only be powered to enable remote wakeup. |
| 1811 | */ | 1806 | */ |
| 1812 | if (dev->power.power_state.event == PM_EVENT_SUSPEND | 1807 | if (dev->dev.power.power_state.event == PM_EVENT_SUSPEND |
| 1813 | || !hcd->can_wakeup) { | 1808 | || !hcd->can_wakeup) { |
| 1814 | sl811->port1 = 0; | 1809 | sl811->port1 = 0; |
| 1815 | port_power(sl811, 1); | 1810 | port_power(sl811, 1); |
| 1816 | return 0; | 1811 | return 0; |
| 1817 | } | 1812 | } |
| 1818 | 1813 | ||
| 1819 | dev->power.power_state = PMSG_ON; | 1814 | dev->dev.power.power_state = PMSG_ON; |
| 1820 | return sl811h_bus_resume(hcd); | 1815 | return sl811h_bus_resume(hcd); |
| 1821 | } | 1816 | } |
| 1822 | 1817 | ||
| @@ -1829,16 +1824,16 @@ sl811h_resume(struct device *dev) | |||
| 1829 | 1824 | ||
| 1830 | 1825 | ||
| 1831 | /* this driver is exported so sl811_cs can depend on it */ | 1826 | /* this driver is exported so sl811_cs can depend on it */ |
| 1832 | struct device_driver sl811h_driver = { | 1827 | struct platform_driver sl811h_driver = { |
| 1833 | .name = (char *) hcd_name, | ||
| 1834 | .bus = &platform_bus_type, | ||
| 1835 | .owner = THIS_MODULE, | ||
| 1836 | |||
| 1837 | .probe = sl811h_probe, | 1828 | .probe = sl811h_probe, |
| 1838 | .remove = __devexit_p(sl811h_remove), | 1829 | .remove = __devexit_p(sl811h_remove), |
| 1839 | 1830 | ||
| 1840 | .suspend = sl811h_suspend, | 1831 | .suspend = sl811h_suspend, |
| 1841 | .resume = sl811h_resume, | 1832 | .resume = sl811h_resume, |
| 1833 | .driver = { | ||
| 1834 | .name = (char *) hcd_name, | ||
| 1835 | .owner = THIS_MODULE, | ||
| 1836 | }, | ||
| 1842 | }; | 1837 | }; |
| 1843 | EXPORT_SYMBOL(sl811h_driver); | 1838 | EXPORT_SYMBOL(sl811h_driver); |
| 1844 | 1839 | ||
| @@ -1850,12 +1845,12 @@ static int __init sl811h_init(void) | |||
| 1850 | return -ENODEV; | 1845 | return -ENODEV; |
| 1851 | 1846 | ||
| 1852 | INFO("driver %s, %s\n", hcd_name, DRIVER_VERSION); | 1847 | INFO("driver %s, %s\n", hcd_name, DRIVER_VERSION); |
| 1853 | return driver_register(&sl811h_driver); | 1848 | return platform_driver_register(&sl811h_driver); |
| 1854 | } | 1849 | } |
| 1855 | module_init(sl811h_init); | 1850 | module_init(sl811h_init); |
| 1856 | 1851 | ||
| 1857 | static void __exit sl811h_cleanup(void) | 1852 | static void __exit sl811h_cleanup(void) |
| 1858 | { | 1853 | { |
| 1859 | driver_unregister(&sl811h_driver); | 1854 | platform_driver_unregister(&sl811h_driver); |
| 1860 | } | 1855 | } |
| 1861 | module_exit(sl811h_cleanup); | 1856 | module_exit(sl811h_cleanup); |
diff --git a/drivers/video/acornfb.c b/drivers/video/acornfb.c index 193b482570c7..750cebb18306 100644 --- a/drivers/video/acornfb.c +++ b/drivers/video/acornfb.c | |||
| @@ -1279,7 +1279,7 @@ free_unused_pages(unsigned int virtual_start, unsigned int virtual_end) | |||
| 1279 | printk("acornfb: freed %dK memory\n", mb_freed); | 1279 | printk("acornfb: freed %dK memory\n", mb_freed); |
| 1280 | } | 1280 | } |
| 1281 | 1281 | ||
| 1282 | static int __init acornfb_probe(struct device *dev) | 1282 | static int __init acornfb_probe(struct platform_device *dev) |
| 1283 | { | 1283 | { |
| 1284 | unsigned long size; | 1284 | unsigned long size; |
| 1285 | u_int h_sync, v_sync; | 1285 | u_int h_sync, v_sync; |
| @@ -1292,7 +1292,7 @@ static int __init acornfb_probe(struct device *dev) | |||
| 1292 | 1292 | ||
| 1293 | acornfb_init_fbinfo(); | 1293 | acornfb_init_fbinfo(); |
| 1294 | 1294 | ||
| 1295 | current_par.dev = dev; | 1295 | current_par.dev = &dev->dev; |
| 1296 | 1296 | ||
| 1297 | if (current_par.montype == -1) | 1297 | if (current_par.montype == -1) |
| 1298 | current_par.montype = acornfb_detect_monitortype(); | 1298 | current_par.montype = acornfb_detect_monitortype(); |
| @@ -1453,15 +1453,16 @@ static int __init acornfb_probe(struct device *dev) | |||
| 1453 | return 0; | 1453 | return 0; |
| 1454 | } | 1454 | } |
| 1455 | 1455 | ||
| 1456 | static struct device_driver acornfb_driver = { | 1456 | static struct platform_driver acornfb_driver = { |
| 1457 | .name = "acornfb", | ||
| 1458 | .bus = &platform_bus_type, | ||
| 1459 | .probe = acornfb_probe, | 1457 | .probe = acornfb_probe, |
| 1458 | .driver = { | ||
| 1459 | .name = "acornfb", | ||
| 1460 | }, | ||
| 1460 | }; | 1461 | }; |
| 1461 | 1462 | ||
| 1462 | static int __init acornfb_init(void) | 1463 | static int __init acornfb_init(void) |
| 1463 | { | 1464 | { |
| 1464 | return driver_register(&acornfb_driver); | 1465 | return platform_driver_register(&acornfb_driver); |
| 1465 | } | 1466 | } |
| 1466 | 1467 | ||
| 1467 | module_init(acornfb_init); | 1468 | module_init(acornfb_init); |
diff --git a/drivers/video/arcfb.c b/drivers/video/arcfb.c index a1fc8bbb1090..080db812ca48 100644 --- a/drivers/video/arcfb.c +++ b/drivers/video/arcfb.c | |||
| @@ -514,9 +514,8 @@ static struct fb_ops arcfb_ops = { | |||
| 514 | .fb_ioctl = arcfb_ioctl, | 514 | .fb_ioctl = arcfb_ioctl, |
| 515 | }; | 515 | }; |
| 516 | 516 | ||
| 517 | static int __init arcfb_probe(struct device *device) | 517 | static int __init arcfb_probe(struct platform_device *dev) |
| 518 | { | 518 | { |
| 519 | struct platform_device *dev = to_platform_device(device); | ||
| 520 | struct fb_info *info; | 519 | struct fb_info *info; |
| 521 | int retval = -ENOMEM; | 520 | int retval = -ENOMEM; |
| 522 | int videomemorysize; | 521 | int videomemorysize; |
| @@ -559,7 +558,7 @@ static int __init arcfb_probe(struct device *device) | |||
| 559 | retval = register_framebuffer(info); | 558 | retval = register_framebuffer(info); |
| 560 | if (retval < 0) | 559 | if (retval < 0) |
| 561 | goto err1; | 560 | goto err1; |
| 562 | dev_set_drvdata(&dev->dev, info); | 561 | platform_set_drvdata(dev, info); |
| 563 | if (irq) { | 562 | if (irq) { |
| 564 | par->irq = irq; | 563 | par->irq = irq; |
| 565 | if (request_irq(par->irq, &arcfb_interrupt, SA_SHIRQ, | 564 | if (request_irq(par->irq, &arcfb_interrupt, SA_SHIRQ, |
| @@ -600,9 +599,9 @@ err: | |||
| 600 | return retval; | 599 | return retval; |
| 601 | } | 600 | } |
| 602 | 601 | ||
| 603 | static int arcfb_remove(struct device *device) | 602 | static int arcfb_remove(struct platform_device *dev) |
| 604 | { | 603 | { |
| 605 | struct fb_info *info = dev_get_drvdata(device); | 604 | struct fb_info *info = platform_get_drvdata(dev); |
| 606 | 605 | ||
| 607 | if (info) { | 606 | if (info) { |
| 608 | unregister_framebuffer(info); | 607 | unregister_framebuffer(info); |
| @@ -612,11 +611,12 @@ static int arcfb_remove(struct device *device) | |||
| 612 | return 0; | 611 | return 0; |
| 613 | } | 612 | } |
| 614 | 613 | ||
| 615 | static struct device_driver arcfb_driver = { | 614 | static struct platform_driver arcfb_driver = { |
| 616 | .name = "arcfb", | ||
| 617 | .bus = &platform_bus_type, | ||
| 618 | .probe = arcfb_probe, | 615 | .probe = arcfb_probe, |
| 619 | .remove = arcfb_remove, | 616 | .remove = arcfb_remove, |
| 617 | .driver = { | ||
| 618 | .name = "arcfb", | ||
| 619 | }, | ||
| 620 | }; | 620 | }; |
| 621 | 621 | ||
| 622 | static struct platform_device *arcfb_device; | 622 | static struct platform_device *arcfb_device; |
| @@ -628,7 +628,7 @@ static int __init arcfb_init(void) | |||
| 628 | if (!arcfb_enable) | 628 | if (!arcfb_enable) |
| 629 | return -ENXIO; | 629 | return -ENXIO; |
| 630 | 630 | ||
| 631 | ret = driver_register(&arcfb_driver); | 631 | ret = platform_driver_register(&arcfb_driver); |
| 632 | if (!ret) { | 632 | if (!ret) { |
| 633 | arcfb_device = platform_device_alloc("arcfb", 0); | 633 | arcfb_device = platform_device_alloc("arcfb", 0); |
| 634 | if (arcfb_device) { | 634 | if (arcfb_device) { |
| @@ -638,7 +638,7 @@ static int __init arcfb_init(void) | |||
| 638 | } | 638 | } |
| 639 | if (ret) { | 639 | if (ret) { |
| 640 | platform_device_put(arcfb_device); | 640 | platform_device_put(arcfb_device); |
| 641 | driver_unregister(&arcfb_driver); | 641 | platform_driver_unregister(&arcfb_driver); |
| 642 | } | 642 | } |
| 643 | } | 643 | } |
| 644 | return ret; | 644 | return ret; |
| @@ -648,7 +648,7 @@ static int __init arcfb_init(void) | |||
| 648 | static void __exit arcfb_exit(void) | 648 | static void __exit arcfb_exit(void) |
| 649 | { | 649 | { |
| 650 | platform_device_unregister(arcfb_device); | 650 | platform_device_unregister(arcfb_device); |
| 651 | driver_unregister(&arcfb_driver); | 651 | platform_driver_unregister(&arcfb_driver); |
| 652 | } | 652 | } |
| 653 | 653 | ||
| 654 | module_param(num_cols, ulong, 0); | 654 | module_param(num_cols, ulong, 0); |
diff --git a/drivers/video/backlight/corgi_bl.c b/drivers/video/backlight/corgi_bl.c index bd9a6996aee7..6a219b2c77e3 100644 --- a/drivers/video/backlight/corgi_bl.c +++ b/drivers/video/backlight/corgi_bl.c | |||
| @@ -79,13 +79,13 @@ static void corgibl_blank(int blank) | |||
| 79 | } | 79 | } |
| 80 | 80 | ||
| 81 | #ifdef CONFIG_PM | 81 | #ifdef CONFIG_PM |
| 82 | static int corgibl_suspend(struct device *dev, pm_message_t state) | 82 | static int corgibl_suspend(struct platform_device *dev, pm_message_t state) |
| 83 | { | 83 | { |
| 84 | corgibl_blank(FB_BLANK_POWERDOWN); | 84 | corgibl_blank(FB_BLANK_POWERDOWN); |
| 85 | return 0; | 85 | return 0; |
| 86 | } | 86 | } |
| 87 | 87 | ||
| 88 | static int corgibl_resume(struct device *dev) | 88 | static int corgibl_resume(struct platform_device *dev) |
| 89 | { | 89 | { |
| 90 | corgibl_blank(FB_BLANK_UNBLANK); | 90 | corgibl_blank(FB_BLANK_UNBLANK); |
| 91 | return 0; | 91 | return 0; |
| @@ -143,9 +143,9 @@ static struct backlight_properties corgibl_data = { | |||
| 143 | 143 | ||
| 144 | static struct backlight_device *corgi_backlight_device; | 144 | static struct backlight_device *corgi_backlight_device; |
| 145 | 145 | ||
| 146 | static int __init corgibl_probe(struct device *dev) | 146 | static int __init corgibl_probe(struct platform_device *pdev) |
| 147 | { | 147 | { |
| 148 | struct corgibl_machinfo *machinfo = dev->platform_data; | 148 | struct corgibl_machinfo *machinfo = pdev->dev.platform_data; |
| 149 | 149 | ||
| 150 | corgibl_data.max_brightness = machinfo->max_intensity; | 150 | corgibl_data.max_brightness = machinfo->max_intensity; |
| 151 | corgibl_mach_set_intensity = machinfo->set_bl_intensity; | 151 | corgibl_mach_set_intensity = machinfo->set_bl_intensity; |
| @@ -162,7 +162,7 @@ static int __init corgibl_probe(struct device *dev) | |||
| 162 | return 0; | 162 | return 0; |
| 163 | } | 163 | } |
| 164 | 164 | ||
| 165 | static int corgibl_remove(struct device *dev) | 165 | static int corgibl_remove(struct platform_device *dev) |
| 166 | { | 166 | { |
| 167 | backlight_device_unregister(corgi_backlight_device); | 167 | backlight_device_unregister(corgi_backlight_device); |
| 168 | 168 | ||
| @@ -172,23 +172,24 @@ static int corgibl_remove(struct device *dev) | |||
| 172 | return 0; | 172 | return 0; |
| 173 | } | 173 | } |
| 174 | 174 | ||
| 175 | static struct device_driver corgibl_driver = { | 175 | static struct platform_driver corgibl_driver = { |
| 176 | .name = "corgi-bl", | ||
| 177 | .bus = &platform_bus_type, | ||
| 178 | .probe = corgibl_probe, | 176 | .probe = corgibl_probe, |
| 179 | .remove = corgibl_remove, | 177 | .remove = corgibl_remove, |
| 180 | .suspend = corgibl_suspend, | 178 | .suspend = corgibl_suspend, |
| 181 | .resume = corgibl_resume, | 179 | .resume = corgibl_resume, |
| 180 | .driver = { | ||
| 181 | .name = "corgi-bl", | ||
| 182 | }, | ||
| 182 | }; | 183 | }; |
| 183 | 184 | ||
| 184 | static int __init corgibl_init(void) | 185 | static int __init corgibl_init(void) |
| 185 | { | 186 | { |
| 186 | return driver_register(&corgibl_driver); | 187 | return platform_driver_register(&corgibl_driver); |
| 187 | } | 188 | } |
| 188 | 189 | ||
| 189 | static void __exit corgibl_exit(void) | 190 | static void __exit corgibl_exit(void) |
| 190 | { | 191 | { |
| 191 | driver_unregister(&corgibl_driver); | 192 | platform_driver_unregister(&corgibl_driver); |
| 192 | } | 193 | } |
| 193 | 194 | ||
| 194 | module_init(corgibl_init); | 195 | module_init(corgibl_init); |
diff --git a/drivers/video/dnfb.c b/drivers/video/dnfb.c index 957a3ada2b75..5abd3cb00671 100644 --- a/drivers/video/dnfb.c +++ b/drivers/video/dnfb.c | |||
| @@ -227,9 +227,8 @@ void dnfb_copyarea(struct fb_info *info, const struct fb_copyarea *area) | |||
| 227 | * Initialization | 227 | * Initialization |
| 228 | */ | 228 | */ |
| 229 | 229 | ||
| 230 | static int __devinit dnfb_probe(struct device *device) | 230 | static int __devinit dnfb_probe(struct platform_device *dev) |
| 231 | { | 231 | { |
| 232 | struct platform_device *dev = to_platform_device(device); | ||
| 233 | struct fb_info *info; | 232 | struct fb_info *info; |
| 234 | int err = 0; | 233 | int err = 0; |
| 235 | 234 | ||
| @@ -257,7 +256,7 @@ static int __devinit dnfb_probe(struct device *device) | |||
| 257 | framebuffer_release(info); | 256 | framebuffer_release(info); |
| 258 | return err; | 257 | return err; |
| 259 | } | 258 | } |
| 260 | dev_set_drvdata(&dev->dev, info); | 259 | platform_set_drvdata(dev, info); |
| 261 | 260 | ||
| 262 | /* now we have registered we can safely setup the hardware */ | 261 | /* now we have registered we can safely setup the hardware */ |
| 263 | out_8(AP_CONTROL_3A, RESET_CREG); | 262 | out_8(AP_CONTROL_3A, RESET_CREG); |
| @@ -271,10 +270,11 @@ static int __devinit dnfb_probe(struct device *device) | |||
| 271 | return err; | 270 | return err; |
| 272 | } | 271 | } |
| 273 | 272 | ||
| 274 | static struct device_driver dnfb_driver = { | 273 | static struct platform_driver dnfb_driver = { |
| 275 | .name = "dnfb", | ||
| 276 | .bus = &platform_bus_type, | ||
| 277 | .probe = dnfb_probe, | 274 | .probe = dnfb_probe, |
| 275 | .driver = { | ||
| 276 | .name = "dnfb", | ||
| 277 | }, | ||
| 278 | }; | 278 | }; |
| 279 | 279 | ||
| 280 | static struct platform_device dnfb_device = { | 280 | static struct platform_device dnfb_device = { |
| @@ -288,12 +288,12 @@ int __init dnfb_init(void) | |||
| 288 | if (fb_get_options("dnfb", NULL)) | 288 | if (fb_get_options("dnfb", NULL)) |
| 289 | return -ENODEV; | 289 | return -ENODEV; |
| 290 | 290 | ||
| 291 | ret = driver_register(&dnfb_driver); | 291 | ret = platform_driver_register(&dnfb_driver); |
| 292 | 292 | ||
| 293 | if (!ret) { | 293 | if (!ret) { |
| 294 | ret = platform_device_register(&dnfb_device); | 294 | ret = platform_device_register(&dnfb_device); |
| 295 | if (ret) | 295 | if (ret) |
| 296 | driver_unregister(&dnfb_driver); | 296 | platform_driver_unregister(&dnfb_driver); |
| 297 | } | 297 | } |
| 298 | return ret; | 298 | return ret; |
| 299 | } | 299 | } |
diff --git a/drivers/video/epson1355fb.c b/drivers/video/epson1355fb.c index 6a81a1dd8f3d..3b0e71383448 100644 --- a/drivers/video/epson1355fb.c +++ b/drivers/video/epson1355fb.c | |||
| @@ -609,9 +609,9 @@ static void epson1355fb_platform_release(struct device *device) | |||
| 609 | { | 609 | { |
| 610 | } | 610 | } |
| 611 | 611 | ||
| 612 | static int epson1355fb_remove(struct device *device) | 612 | static int epson1355fb_remove(struct platform_device *dev) |
| 613 | { | 613 | { |
| 614 | struct fb_info *info = dev_get_drvdata(device); | 614 | struct fb_info *info = platform_get_drvdata(dev); |
| 615 | struct epson1355_par *par = info->par; | 615 | struct epson1355_par *par = info->par; |
| 616 | 616 | ||
| 617 | backlight_enable(0); | 617 | backlight_enable(0); |
| @@ -632,9 +632,8 @@ static int epson1355fb_remove(struct device *device) | |||
| 632 | return 0; | 632 | return 0; |
| 633 | } | 633 | } |
| 634 | 634 | ||
| 635 | int __init epson1355fb_probe(struct device *device) | 635 | int __init epson1355fb_probe(struct platform_device *dev) |
| 636 | { | 636 | { |
| 637 | struct platform_device *dev = to_platform_device(device); | ||
| 638 | struct epson1355_par *default_par; | 637 | struct epson1355_par *default_par; |
| 639 | struct fb_info *info; | 638 | struct fb_info *info; |
| 640 | u8 revision; | 639 | u8 revision; |
| @@ -713,7 +712,7 @@ int __init epson1355fb_probe(struct device *device) | |||
| 713 | /* | 712 | /* |
| 714 | * Our driver data. | 713 | * Our driver data. |
| 715 | */ | 714 | */ |
| 716 | dev_set_drvdata(&dev->dev, info); | 715 | platform_set_drvdata(dev, info); |
| 717 | 716 | ||
| 718 | printk(KERN_INFO "fb%d: %s frame buffer device\n", | 717 | printk(KERN_INFO "fb%d: %s frame buffer device\n", |
| 719 | info->node, info->fix.id); | 718 | info->node, info->fix.id); |
| @@ -721,15 +720,16 @@ int __init epson1355fb_probe(struct device *device) | |||
| 721 | return 0; | 720 | return 0; |
| 722 | 721 | ||
| 723 | bail: | 722 | bail: |
| 724 | epson1355fb_remove(device); | 723 | epson1355fb_remove(dev); |
| 725 | return rc; | 724 | return rc; |
| 726 | } | 725 | } |
| 727 | 726 | ||
| 728 | static struct device_driver epson1355fb_driver = { | 727 | static struct platform_driver epson1355fb_driver = { |
| 729 | .name = "epson1355fb", | ||
| 730 | .bus = &platform_bus_type, | ||
| 731 | .probe = epson1355fb_probe, | 728 | .probe = epson1355fb_probe, |
| 732 | .remove = epson1355fb_remove, | 729 | .remove = epson1355fb_remove, |
| 730 | .driver = { | ||
| 731 | .name = "epson1355fb", | ||
| 732 | }, | ||
| 733 | }; | 733 | }; |
| 734 | 734 | ||
| 735 | static struct platform_device epson1355fb_device = { | 735 | static struct platform_device epson1355fb_device = { |
| @@ -747,11 +747,11 @@ int __init epson1355fb_init(void) | |||
| 747 | if (fb_get_options("epson1355fb", NULL)) | 747 | if (fb_get_options("epson1355fb", NULL)) |
| 748 | return -ENODEV; | 748 | return -ENODEV; |
| 749 | 749 | ||
| 750 | ret = driver_register(&epson1355fb_driver); | 750 | ret = platform_driver_register(&epson1355fb_driver); |
| 751 | if (!ret) { | 751 | if (!ret) { |
| 752 | ret = platform_device_register(&epson1355fb_device); | 752 | ret = platform_device_register(&epson1355fb_device); |
| 753 | if (ret) | 753 | if (ret) |
| 754 | driver_unregister(&epson1355fb_driver); | 754 | platform_driver_unregister(&epson1355fb_driver); |
| 755 | } | 755 | } |
| 756 | return ret; | 756 | return ret; |
| 757 | } | 757 | } |
| @@ -762,7 +762,7 @@ module_init(epson1355fb_init); | |||
| 762 | static void __exit epson1355fb_exit(void) | 762 | static void __exit epson1355fb_exit(void) |
| 763 | { | 763 | { |
| 764 | platform_device_unregister(&epson1355fb_device); | 764 | platform_device_unregister(&epson1355fb_device); |
| 765 | driver_unregister(&epson1355fb_driver); | 765 | platform_driver_unregister(&epson1355fb_driver); |
| 766 | } | 766 | } |
| 767 | 767 | ||
| 768 | /* ------------------------------------------------------------------------- */ | 768 | /* ------------------------------------------------------------------------- */ |
diff --git a/drivers/video/gbefb.c b/drivers/video/gbefb.c index 9d5e4f342110..d744c51807b7 100644 --- a/drivers/video/gbefb.c +++ b/drivers/video/gbefb.c | |||
| @@ -1105,12 +1105,11 @@ int __init gbefb_setup(char *options) | |||
| 1105 | return 0; | 1105 | return 0; |
| 1106 | } | 1106 | } |
| 1107 | 1107 | ||
| 1108 | static int __init gbefb_probe(struct device *dev) | 1108 | static int __init gbefb_probe(struct platform_device *p_dev) |
| 1109 | { | 1109 | { |
| 1110 | int i, ret = 0; | 1110 | int i, ret = 0; |
| 1111 | struct fb_info *info; | 1111 | struct fb_info *info; |
| 1112 | struct gbefb_par *par; | 1112 | struct gbefb_par *par; |
| 1113 | struct platform_device *p_dev = to_platform_device(dev); | ||
| 1114 | #ifndef MODULE | 1113 | #ifndef MODULE |
| 1115 | char *options = NULL; | 1114 | char *options = NULL; |
| 1116 | #endif | 1115 | #endif |
| @@ -1204,8 +1203,8 @@ static int __init gbefb_probe(struct device *dev) | |||
| 1204 | goto out_gbe_unmap; | 1203 | goto out_gbe_unmap; |
| 1205 | } | 1204 | } |
| 1206 | 1205 | ||
| 1207 | dev_set_drvdata(&p_dev->dev, info); | 1206 | platform_set_drvdata(p_dev, info); |
| 1208 | gbefb_create_sysfs(dev); | 1207 | gbefb_create_sysfs(&p_dev->dev); |
| 1209 | 1208 | ||
| 1210 | printk(KERN_INFO "fb%d: %s rev %d @ 0x%08x using %dkB memory\n", | 1209 | printk(KERN_INFO "fb%d: %s rev %d @ 0x%08x using %dkB memory\n", |
| 1211 | info->node, info->fix.id, gbe_revision, (unsigned) GBE_BASE, | 1210 | info->node, info->fix.id, gbe_revision, (unsigned) GBE_BASE, |
| @@ -1231,10 +1230,9 @@ out_release_framebuffer: | |||
| 1231 | return ret; | 1230 | return ret; |
| 1232 | } | 1231 | } |
| 1233 | 1232 | ||
| 1234 | static int __devexit gbefb_remove(struct device* dev) | 1233 | static int __devexit gbefb_remove(struct platform_device* p_dev) |
| 1235 | { | 1234 | { |
| 1236 | struct platform_device *p_dev = to_platform_device(dev); | 1235 | struct fb_info *info = platform_get_drvdata(p_dev); |
| 1237 | struct fb_info *info = dev_get_drvdata(&p_dev->dev); | ||
| 1238 | 1236 | ||
| 1239 | unregister_framebuffer(info); | 1237 | unregister_framebuffer(info); |
| 1240 | gbe_turn_off(); | 1238 | gbe_turn_off(); |
| @@ -1252,18 +1250,19 @@ static int __devexit gbefb_remove(struct device* dev) | |||
| 1252 | return 0; | 1250 | return 0; |
| 1253 | } | 1251 | } |
| 1254 | 1252 | ||
| 1255 | static struct device_driver gbefb_driver = { | 1253 | static struct platform_driver gbefb_driver = { |
| 1256 | .name = "gbefb", | ||
| 1257 | .bus = &platform_bus_type, | ||
| 1258 | .probe = gbefb_probe, | 1254 | .probe = gbefb_probe, |
| 1259 | .remove = __devexit_p(gbefb_remove), | 1255 | .remove = __devexit_p(gbefb_remove), |
| 1256 | .driver = { | ||
| 1257 | .name = "gbefb", | ||
| 1258 | }, | ||
| 1260 | }; | 1259 | }; |
| 1261 | 1260 | ||
| 1262 | static struct platform_device *gbefb_device; | 1261 | static struct platform_device *gbefb_device; |
| 1263 | 1262 | ||
| 1264 | int __init gbefb_init(void) | 1263 | int __init gbefb_init(void) |
| 1265 | { | 1264 | { |
| 1266 | int ret = driver_register(&gbefb_driver); | 1265 | int ret = platform_driver_register(&gbefb_driver); |
| 1267 | if (!ret) { | 1266 | if (!ret) { |
| 1268 | gbefb_device = platform_device_alloc("gbefb", 0); | 1267 | gbefb_device = platform_device_alloc("gbefb", 0); |
| 1269 | if (gbefb_device) { | 1268 | if (gbefb_device) { |
| @@ -1273,7 +1272,7 @@ int __init gbefb_init(void) | |||
| 1273 | } | 1272 | } |
| 1274 | if (ret) { | 1273 | if (ret) { |
| 1275 | platform_device_put(gbefb_device); | 1274 | platform_device_put(gbefb_device); |
| 1276 | driver_unregister(&gbefb_driver); | 1275 | platform_driver_unregister(&gbefb_driver); |
| 1277 | } | 1276 | } |
| 1278 | } | 1277 | } |
| 1279 | return ret; | 1278 | return ret; |
| @@ -1282,7 +1281,7 @@ int __init gbefb_init(void) | |||
| 1282 | void __exit gbefb_exit(void) | 1281 | void __exit gbefb_exit(void) |
| 1283 | { | 1282 | { |
| 1284 | platform_device_unregister(gbefb_device); | 1283 | platform_device_unregister(gbefb_device); |
| 1285 | driver_unregister(&gbefb_driver); | 1284 | platform_driver_unregister(&gbefb_driver); |
| 1286 | } | 1285 | } |
| 1287 | 1286 | ||
| 1288 | module_init(gbefb_init); | 1287 | module_init(gbefb_init); |
diff --git a/drivers/video/imxfb.c b/drivers/video/imxfb.c index e20b9f3a255f..5924cc225c95 100644 --- a/drivers/video/imxfb.c +++ b/drivers/video/imxfb.c | |||
| @@ -423,18 +423,18 @@ static void imxfb_setup_gpio(struct imxfb_info *fbi) | |||
| 423 | * Power management hooks. Note that we won't be called from IRQ context, | 423 | * Power management hooks. Note that we won't be called from IRQ context, |
| 424 | * unlike the blank functions above, so we may sleep. | 424 | * unlike the blank functions above, so we may sleep. |
| 425 | */ | 425 | */ |
| 426 | static int imxfb_suspend(struct device *dev, pm_message_t state) | 426 | static int imxfb_suspend(struct platform_device *dev, pm_message_t state) |
| 427 | { | 427 | { |
| 428 | struct imxfb_info *fbi = dev_get_drvdata(dev); | 428 | struct imxfb_info *fbi = platform_get_drvdata(dev); |
| 429 | pr_debug("%s\n",__FUNCTION__); | 429 | pr_debug("%s\n",__FUNCTION__); |
| 430 | 430 | ||
| 431 | imxfb_disable_controller(fbi); | 431 | imxfb_disable_controller(fbi); |
| 432 | return 0; | 432 | return 0; |
| 433 | } | 433 | } |
| 434 | 434 | ||
| 435 | static int imxfb_resume(struct device *dev) | 435 | static int imxfb_resume(struct platform_device *dev) |
| 436 | { | 436 | { |
| 437 | struct imxfb_info *fbi = dev_get_drvdata(dev); | 437 | struct imxfb_info *fbi = platform_get_drvdata(dev); |
| 438 | pr_debug("%s\n",__FUNCTION__); | 438 | pr_debug("%s\n",__FUNCTION__); |
| 439 | 439 | ||
| 440 | imxfb_enable_controller(fbi); | 440 | imxfb_enable_controller(fbi); |
| @@ -538,9 +538,8 @@ static int __init imxfb_map_video_memory(struct fb_info *info) | |||
| 538 | return fbi->map_cpu ? 0 : -ENOMEM; | 538 | return fbi->map_cpu ? 0 : -ENOMEM; |
| 539 | } | 539 | } |
| 540 | 540 | ||
| 541 | static int __init imxfb_probe(struct device *dev) | 541 | static int __init imxfb_probe(struct platform_device *pdev) |
| 542 | { | 542 | { |
| 543 | struct platform_device *pdev = to_platform_device(dev); | ||
| 544 | struct imxfb_info *fbi; | 543 | struct imxfb_info *fbi; |
| 545 | struct fb_info *info; | 544 | struct fb_info *info; |
| 546 | struct imxfb_mach_info *inf; | 545 | struct imxfb_mach_info *inf; |
| @@ -553,21 +552,21 @@ static int __init imxfb_probe(struct device *dev) | |||
| 553 | if(!res) | 552 | if(!res) |
| 554 | return -ENODEV; | 553 | return -ENODEV; |
| 555 | 554 | ||
| 556 | inf = dev->platform_data; | 555 | inf = pdev->dev.platform_data; |
| 557 | if(!inf) { | 556 | if(!inf) { |
| 558 | dev_err(dev,"No platform_data available\n"); | 557 | dev_err(dev,"No platform_data available\n"); |
| 559 | return -ENOMEM; | 558 | return -ENOMEM; |
| 560 | } | 559 | } |
| 561 | 560 | ||
| 562 | info = framebuffer_alloc(sizeof(struct imxfb_info), dev); | 561 | info = framebuffer_alloc(sizeof(struct imxfb_info), &pdev->dev); |
| 563 | if(!info) | 562 | if(!info) |
| 564 | return -ENOMEM; | 563 | return -ENOMEM; |
| 565 | 564 | ||
| 566 | fbi = info->par; | 565 | fbi = info->par; |
| 567 | 566 | ||
| 568 | dev_set_drvdata(dev, info); | 567 | platform_set_drvdata(pdev, info); |
| 569 | 568 | ||
| 570 | ret = imxfb_init_fbinfo(dev); | 569 | ret = imxfb_init_fbinfo(&pdev->dev); |
| 571 | if( ret < 0 ) | 570 | if( ret < 0 ) |
| 572 | goto failed_init; | 571 | goto failed_init; |
| 573 | 572 | ||
| @@ -621,22 +620,21 @@ failed_register: | |||
| 621 | fb_dealloc_cmap(&info->cmap); | 620 | fb_dealloc_cmap(&info->cmap); |
| 622 | failed_cmap: | 621 | failed_cmap: |
| 623 | if (!inf->fixed_screen_cpu) | 622 | if (!inf->fixed_screen_cpu) |
| 624 | dma_free_writecombine(dev,fbi->map_size,fbi->map_cpu, | 623 | dma_free_writecombine(&pdev->dev,fbi->map_size,fbi->map_cpu, |
| 625 | fbi->map_dma); | 624 | fbi->map_dma); |
| 626 | failed_map: | 625 | failed_map: |
| 627 | kfree(info->pseudo_palette); | 626 | kfree(info->pseudo_palette); |
| 628 | failed_regs: | 627 | failed_regs: |
| 629 | release_mem_region(res->start, res->end - res->start); | 628 | release_mem_region(res->start, res->end - res->start); |
| 630 | failed_init: | 629 | failed_init: |
| 631 | dev_set_drvdata(dev, NULL); | 630 | platform_set_drvdata(pdev, NULL); |
| 632 | framebuffer_release(info); | 631 | framebuffer_release(info); |
| 633 | return ret; | 632 | return ret; |
| 634 | } | 633 | } |
| 635 | 634 | ||
| 636 | static int imxfb_remove(struct device *dev) | 635 | static int imxfb_remove(struct platform_device *pdev) |
| 637 | { | 636 | { |
| 638 | struct platform_device *pdev = to_platform_device(dev); | 637 | struct fb_info *info = platform_get_drvdata(pdev); |
| 639 | struct fb_info *info = dev_get_drvdata(dev); | ||
| 640 | struct imxfb_info *fbi = info->par; | 638 | struct imxfb_info *fbi = info->par; |
| 641 | struct resource *res; | 639 | struct resource *res; |
| 642 | 640 | ||
| @@ -651,36 +649,37 @@ static int imxfb_remove(struct device *dev) | |||
| 651 | framebuffer_release(info); | 649 | framebuffer_release(info); |
| 652 | 650 | ||
| 653 | release_mem_region(res->start, res->end - res->start + 1); | 651 | release_mem_region(res->start, res->end - res->start + 1); |
| 654 | dev_set_drvdata(dev, NULL); | 652 | platform_set_drvdata(pdev, NULL); |
| 655 | 653 | ||
| 656 | return 0; | 654 | return 0; |
| 657 | } | 655 | } |
| 658 | 656 | ||
| 659 | void imxfb_shutdown(struct device * dev) | 657 | void imxfb_shutdown(struct platform_device * dev) |
| 660 | { | 658 | { |
| 661 | struct fb_info *info = dev_get_drvdata(dev); | 659 | struct fb_info *info = platform_get_drvdata(dev); |
| 662 | struct imxfb_info *fbi = info->par; | 660 | struct imxfb_info *fbi = info->par; |
| 663 | imxfb_disable_controller(fbi); | 661 | imxfb_disable_controller(fbi); |
| 664 | } | 662 | } |
| 665 | 663 | ||
| 666 | static struct device_driver imxfb_driver = { | 664 | static struct platform_driver imxfb_driver = { |
| 667 | .name = "imx-fb", | ||
| 668 | .bus = &platform_bus_type, | ||
| 669 | .probe = imxfb_probe, | 665 | .probe = imxfb_probe, |
| 670 | .suspend = imxfb_suspend, | 666 | .suspend = imxfb_suspend, |
| 671 | .resume = imxfb_resume, | 667 | .resume = imxfb_resume, |
| 672 | .remove = imxfb_remove, | 668 | .remove = imxfb_remove, |
| 673 | .shutdown = imxfb_shutdown, | 669 | .shutdown = imxfb_shutdown, |
| 670 | .driver = { | ||
| 671 | .name = "imx-fb", | ||
| 672 | }, | ||
| 674 | }; | 673 | }; |
| 675 | 674 | ||
| 676 | int __init imxfb_init(void) | 675 | int __init imxfb_init(void) |
| 677 | { | 676 | { |
| 678 | return driver_register(&imxfb_driver); | 677 | return platform_driver_register(&imxfb_driver); |
| 679 | } | 678 | } |
| 680 | 679 | ||
| 681 | static void __exit imxfb_cleanup(void) | 680 | static void __exit imxfb_cleanup(void) |
| 682 | { | 681 | { |
| 683 | driver_unregister(&imxfb_driver); | 682 | platform_driver_unregister(&imxfb_driver); |
| 684 | } | 683 | } |
| 685 | 684 | ||
| 686 | module_init(imxfb_init); | 685 | module_init(imxfb_init); |
diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c index f305a5b77b23..7b4cd250bec8 100644 --- a/drivers/video/pxafb.c +++ b/drivers/video/pxafb.c | |||
| @@ -980,17 +980,17 @@ pxafb_freq_policy(struct notifier_block *nb, unsigned long val, void *data) | |||
| 980 | * Power management hooks. Note that we won't be called from IRQ context, | 980 | * Power management hooks. Note that we won't be called from IRQ context, |
| 981 | * unlike the blank functions above, so we may sleep. | 981 | * unlike the blank functions above, so we may sleep. |
| 982 | */ | 982 | */ |
| 983 | static int pxafb_suspend(struct device *dev, pm_message_t state) | 983 | static int pxafb_suspend(struct platform_device *dev, pm_message_t state) |
| 984 | { | 984 | { |
| 985 | struct pxafb_info *fbi = dev_get_drvdata(dev); | 985 | struct pxafb_info *fbi = platform_get_drvdata(dev); |
| 986 | 986 | ||
| 987 | set_ctrlr_state(fbi, C_DISABLE_PM); | 987 | set_ctrlr_state(fbi, C_DISABLE_PM); |
| 988 | return 0; | 988 | return 0; |
| 989 | } | 989 | } |
| 990 | 990 | ||
| 991 | static int pxafb_resume(struct device *dev) | 991 | static int pxafb_resume(struct platform_device *dev) |
| 992 | { | 992 | { |
| 993 | struct pxafb_info *fbi = dev_get_drvdata(dev); | 993 | struct pxafb_info *fbi = platform_get_drvdata(dev); |
| 994 | 994 | ||
| 995 | set_ctrlr_state(fbi, C_ENABLE_PM); | 995 | set_ctrlr_state(fbi, C_ENABLE_PM); |
| 996 | return 0; | 996 | return 0; |
| @@ -1268,7 +1268,7 @@ static int __init pxafb_parse_options(struct device *dev, char *options) | |||
| 1268 | } | 1268 | } |
| 1269 | #endif | 1269 | #endif |
| 1270 | 1270 | ||
| 1271 | int __init pxafb_probe(struct device *dev) | 1271 | int __init pxafb_probe(struct platform_device *dev) |
| 1272 | { | 1272 | { |
| 1273 | struct pxafb_info *fbi; | 1273 | struct pxafb_info *fbi; |
| 1274 | struct pxafb_mach_info *inf; | 1274 | struct pxafb_mach_info *inf; |
| @@ -1276,14 +1276,14 @@ int __init pxafb_probe(struct device *dev) | |||
| 1276 | 1276 | ||
| 1277 | dev_dbg(dev, "pxafb_probe\n"); | 1277 | dev_dbg(dev, "pxafb_probe\n"); |
| 1278 | 1278 | ||
| 1279 | inf = dev->platform_data; | 1279 | inf = dev->dev.platform_data; |
| 1280 | ret = -ENOMEM; | 1280 | ret = -ENOMEM; |
| 1281 | fbi = NULL; | 1281 | fbi = NULL; |
| 1282 | if (!inf) | 1282 | if (!inf) |
| 1283 | goto failed; | 1283 | goto failed; |
| 1284 | 1284 | ||
| 1285 | #ifdef CONFIG_FB_PXA_PARAMETERS | 1285 | #ifdef CONFIG_FB_PXA_PARAMETERS |
| 1286 | ret = pxafb_parse_options(dev, g_options); | 1286 | ret = pxafb_parse_options(&dev->dev, g_options); |
| 1287 | if (ret < 0) | 1287 | if (ret < 0) |
| 1288 | goto failed; | 1288 | goto failed; |
| 1289 | #endif | 1289 | #endif |
| @@ -1293,36 +1293,36 @@ int __init pxafb_probe(struct device *dev) | |||
| 1293 | * a warning is given. */ | 1293 | * a warning is given. */ |
| 1294 | 1294 | ||
| 1295 | if (inf->lccr0 & LCCR0_INVALID_CONFIG_MASK) | 1295 | if (inf->lccr0 & LCCR0_INVALID_CONFIG_MASK) |
| 1296 | dev_warn(dev, "machine LCCR0 setting contains illegal bits: %08x\n", | 1296 | dev_warn(&dev->dev, "machine LCCR0 setting contains illegal bits: %08x\n", |
| 1297 | inf->lccr0 & LCCR0_INVALID_CONFIG_MASK); | 1297 | inf->lccr0 & LCCR0_INVALID_CONFIG_MASK); |
| 1298 | if (inf->lccr3 & LCCR3_INVALID_CONFIG_MASK) | 1298 | if (inf->lccr3 & LCCR3_INVALID_CONFIG_MASK) |
| 1299 | dev_warn(dev, "machine LCCR3 setting contains illegal bits: %08x\n", | 1299 | dev_warn(&dev->dev, "machine LCCR3 setting contains illegal bits: %08x\n", |
| 1300 | inf->lccr3 & LCCR3_INVALID_CONFIG_MASK); | 1300 | inf->lccr3 & LCCR3_INVALID_CONFIG_MASK); |
| 1301 | if (inf->lccr0 & LCCR0_DPD && | 1301 | if (inf->lccr0 & LCCR0_DPD && |
| 1302 | ((inf->lccr0 & LCCR0_PAS) != LCCR0_Pas || | 1302 | ((inf->lccr0 & LCCR0_PAS) != LCCR0_Pas || |
| 1303 | (inf->lccr0 & LCCR0_SDS) != LCCR0_Sngl || | 1303 | (inf->lccr0 & LCCR0_SDS) != LCCR0_Sngl || |
| 1304 | (inf->lccr0 & LCCR0_CMS) != LCCR0_Mono)) | 1304 | (inf->lccr0 & LCCR0_CMS) != LCCR0_Mono)) |
| 1305 | dev_warn(dev, "Double Pixel Data (DPD) mode is only valid in passive mono" | 1305 | dev_warn(&dev->dev, "Double Pixel Data (DPD) mode is only valid in passive mono" |
| 1306 | " single panel mode\n"); | 1306 | " single panel mode\n"); |
| 1307 | if ((inf->lccr0 & LCCR0_PAS) == LCCR0_Act && | 1307 | if ((inf->lccr0 & LCCR0_PAS) == LCCR0_Act && |
| 1308 | (inf->lccr0 & LCCR0_SDS) == LCCR0_Dual) | 1308 | (inf->lccr0 & LCCR0_SDS) == LCCR0_Dual) |
| 1309 | dev_warn(dev, "Dual panel only valid in passive mode\n"); | 1309 | dev_warn(&dev->dev, "Dual panel only valid in passive mode\n"); |
| 1310 | if ((inf->lccr0 & LCCR0_PAS) == LCCR0_Pas && | 1310 | if ((inf->lccr0 & LCCR0_PAS) == LCCR0_Pas && |
| 1311 | (inf->upper_margin || inf->lower_margin)) | 1311 | (inf->upper_margin || inf->lower_margin)) |
| 1312 | dev_warn(dev, "Upper and lower margins must be 0 in passive mode\n"); | 1312 | dev_warn(&dev->dev, "Upper and lower margins must be 0 in passive mode\n"); |
| 1313 | #endif | 1313 | #endif |
| 1314 | 1314 | ||
| 1315 | dev_dbg(dev, "got a %dx%dx%d LCD\n",inf->xres, inf->yres, inf->bpp); | 1315 | dev_dbg(&dev->dev, "got a %dx%dx%d LCD\n",inf->xres, inf->yres, inf->bpp); |
| 1316 | if (inf->xres == 0 || inf->yres == 0 || inf->bpp == 0) { | 1316 | if (inf->xres == 0 || inf->yres == 0 || inf->bpp == 0) { |
| 1317 | dev_err(dev, "Invalid resolution or bit depth\n"); | 1317 | dev_err(&dev->dev, "Invalid resolution or bit depth\n"); |
| 1318 | ret = -EINVAL; | 1318 | ret = -EINVAL; |
| 1319 | goto failed; | 1319 | goto failed; |
| 1320 | } | 1320 | } |
| 1321 | pxafb_backlight_power = inf->pxafb_backlight_power; | 1321 | pxafb_backlight_power = inf->pxafb_backlight_power; |
| 1322 | pxafb_lcd_power = inf->pxafb_lcd_power; | 1322 | pxafb_lcd_power = inf->pxafb_lcd_power; |
| 1323 | fbi = pxafb_init_fbinfo(dev); | 1323 | fbi = pxafb_init_fbinfo(&dev->dev); |
| 1324 | if (!fbi) { | 1324 | if (!fbi) { |
| 1325 | dev_err(dev, "Failed to initialize framebuffer device\n"); | 1325 | dev_err(&dev->dev, "Failed to initialize framebuffer device\n"); |
| 1326 | ret = -ENOMEM; // only reason for pxafb_init_fbinfo to fail is kmalloc | 1326 | ret = -ENOMEM; // only reason for pxafb_init_fbinfo to fail is kmalloc |
| 1327 | goto failed; | 1327 | goto failed; |
| 1328 | } | 1328 | } |
| @@ -1330,14 +1330,14 @@ int __init pxafb_probe(struct device *dev) | |||
| 1330 | /* Initialize video memory */ | 1330 | /* Initialize video memory */ |
| 1331 | ret = pxafb_map_video_memory(fbi); | 1331 | ret = pxafb_map_video_memory(fbi); |
| 1332 | if (ret) { | 1332 | if (ret) { |
| 1333 | dev_err(dev, "Failed to allocate video RAM: %d\n", ret); | 1333 | dev_err(&dev->dev, "Failed to allocate video RAM: %d\n", ret); |
| 1334 | ret = -ENOMEM; | 1334 | ret = -ENOMEM; |
| 1335 | goto failed; | 1335 | goto failed; |
| 1336 | } | 1336 | } |
| 1337 | 1337 | ||
| 1338 | ret = request_irq(IRQ_LCD, pxafb_handle_irq, SA_INTERRUPT, "LCD", fbi); | 1338 | ret = request_irq(IRQ_LCD, pxafb_handle_irq, SA_INTERRUPT, "LCD", fbi); |
| 1339 | if (ret) { | 1339 | if (ret) { |
| 1340 | dev_err(dev, "request_irq failed: %d\n", ret); | 1340 | dev_err(&dev->dev, "request_irq failed: %d\n", ret); |
| 1341 | ret = -EBUSY; | 1341 | ret = -EBUSY; |
| 1342 | goto failed; | 1342 | goto failed; |
| 1343 | } | 1343 | } |
| @@ -1349,11 +1349,11 @@ int __init pxafb_probe(struct device *dev) | |||
| 1349 | pxafb_check_var(&fbi->fb.var, &fbi->fb); | 1349 | pxafb_check_var(&fbi->fb.var, &fbi->fb); |
| 1350 | pxafb_set_par(&fbi->fb); | 1350 | pxafb_set_par(&fbi->fb); |
| 1351 | 1351 | ||
| 1352 | dev_set_drvdata(dev, fbi); | 1352 | platform_set_drvdata(dev, fbi); |
| 1353 | 1353 | ||
| 1354 | ret = register_framebuffer(&fbi->fb); | 1354 | ret = register_framebuffer(&fbi->fb); |
| 1355 | if (ret < 0) { | 1355 | if (ret < 0) { |
| 1356 | dev_err(dev, "Failed to register framebuffer device: %d\n", ret); | 1356 | dev_err(&dev->dev, "Failed to register framebuffer device: %d\n", ret); |
| 1357 | goto failed; | 1357 | goto failed; |
| 1358 | } | 1358 | } |
| 1359 | 1359 | ||
| @@ -1376,19 +1376,20 @@ int __init pxafb_probe(struct device *dev) | |||
| 1376 | return 0; | 1376 | return 0; |
| 1377 | 1377 | ||
| 1378 | failed: | 1378 | failed: |
| 1379 | dev_set_drvdata(dev, NULL); | 1379 | platform_set_drvdata(dev, NULL); |
| 1380 | kfree(fbi); | 1380 | kfree(fbi); |
| 1381 | return ret; | 1381 | return ret; |
| 1382 | } | 1382 | } |
| 1383 | 1383 | ||
| 1384 | static struct device_driver pxafb_driver = { | 1384 | static struct platform_driver pxafb_driver = { |
| 1385 | .name = "pxa2xx-fb", | ||
| 1386 | .bus = &platform_bus_type, | ||
| 1387 | .probe = pxafb_probe, | 1385 | .probe = pxafb_probe, |
| 1388 | #ifdef CONFIG_PM | 1386 | #ifdef CONFIG_PM |
| 1389 | .suspend = pxafb_suspend, | 1387 | .suspend = pxafb_suspend, |
| 1390 | .resume = pxafb_resume, | 1388 | .resume = pxafb_resume, |
| 1391 | #endif | 1389 | #endif |
| 1390 | .driver = { | ||
| 1391 | .name = "pxa2xx-fb", | ||
| 1392 | }, | ||
| 1392 | }; | 1393 | }; |
| 1393 | 1394 | ||
| 1394 | #ifndef MODULE | 1395 | #ifndef MODULE |
| @@ -1415,7 +1416,7 @@ int __devinit pxafb_init(void) | |||
| 1415 | return -ENODEV; | 1416 | return -ENODEV; |
| 1416 | pxafb_setup(option); | 1417 | pxafb_setup(option); |
| 1417 | #endif | 1418 | #endif |
| 1418 | return driver_register(&pxafb_driver); | 1419 | return platform_driver_register(&pxafb_driver); |
| 1419 | } | 1420 | } |
| 1420 | 1421 | ||
| 1421 | module_init(pxafb_init); | 1422 | module_init(pxafb_init); |
diff --git a/drivers/video/q40fb.c b/drivers/video/q40fb.c index bfc41f2c902a..fc91dbf896d2 100644 --- a/drivers/video/q40fb.c +++ b/drivers/video/q40fb.c | |||
| @@ -86,9 +86,8 @@ static struct fb_ops q40fb_ops = { | |||
| 86 | .fb_imageblit = cfb_imageblit, | 86 | .fb_imageblit = cfb_imageblit, |
| 87 | }; | 87 | }; |
| 88 | 88 | ||
| 89 | static int __init q40fb_probe(struct device *device) | 89 | static int __init q40fb_probe(struct platform_device *dev) |
| 90 | { | 90 | { |
| 91 | struct platform_device *dev = to_platform_device(device); | ||
| 92 | struct fb_info *info; | 91 | struct fb_info *info; |
| 93 | 92 | ||
| 94 | if (!MACH_IS_Q40) | 93 | if (!MACH_IS_Q40) |
| @@ -128,10 +127,11 @@ static int __init q40fb_probe(struct device *device) | |||
| 128 | return 0; | 127 | return 0; |
| 129 | } | 128 | } |
| 130 | 129 | ||
| 131 | static struct device_driver q40fb_driver = { | 130 | static struct platform_driver q40fb_driver = { |
| 132 | .name = "q40fb", | ||
| 133 | .bus = &platform_bus_type, | ||
| 134 | .probe = q40fb_probe, | 131 | .probe = q40fb_probe, |
| 132 | .driver = { | ||
| 133 | .name = "q40fb", | ||
| 134 | }, | ||
| 135 | }; | 135 | }; |
| 136 | 136 | ||
| 137 | static struct platform_device q40fb_device = { | 137 | static struct platform_device q40fb_device = { |
| @@ -145,12 +145,12 @@ int __init q40fb_init(void) | |||
| 145 | if (fb_get_options("q40fb", NULL)) | 145 | if (fb_get_options("q40fb", NULL)) |
| 146 | return -ENODEV; | 146 | return -ENODEV; |
| 147 | 147 | ||
| 148 | ret = driver_register(&q40fb_driver); | 148 | ret = platform_driver_register(&q40fb_driver); |
| 149 | 149 | ||
| 150 | if (!ret) { | 150 | if (!ret) { |
| 151 | ret = platform_device_register(&q40fb_device); | 151 | ret = platform_device_register(&q40fb_device); |
| 152 | if (ret) | 152 | if (ret) |
| 153 | driver_unregister(&q40fb_driver); | 153 | platform_driver_unregister(&q40fb_driver); |
| 154 | } | 154 | } |
| 155 | return ret; | 155 | return ret; |
| 156 | } | 156 | } |
diff --git a/drivers/video/s1d13xxxfb.c b/drivers/video/s1d13xxxfb.c index 3edbd14c5c46..e5d0f92eeae3 100644 --- a/drivers/video/s1d13xxxfb.c +++ b/drivers/video/s1d13xxxfb.c | |||
| @@ -503,10 +503,9 @@ s1d13xxxfb_fetch_hw_state(struct fb_info *info) | |||
| 503 | 503 | ||
| 504 | 504 | ||
| 505 | static int | 505 | static int |
| 506 | s1d13xxxfb_remove(struct device *dev) | 506 | s1d13xxxfb_remove(struct platform_device *pdev) |
| 507 | { | 507 | { |
| 508 | struct fb_info *info = dev_get_drvdata(dev); | 508 | struct fb_info *info = platform_get_drvdata(pdev); |
| 509 | struct platform_device *pdev = to_platform_device(dev); | ||
| 510 | struct s1d13xxxfb_par *par = NULL; | 509 | struct s1d13xxxfb_par *par = NULL; |
| 511 | 510 | ||
| 512 | if (info) { | 511 | if (info) { |
| @@ -534,9 +533,8 @@ s1d13xxxfb_remove(struct device *dev) | |||
| 534 | } | 533 | } |
| 535 | 534 | ||
| 536 | static int __devinit | 535 | static int __devinit |
| 537 | s1d13xxxfb_probe(struct device *dev) | 536 | s1d13xxxfb_probe(struct platform_device *pdev) |
| 538 | { | 537 | { |
| 539 | struct platform_device *pdev = to_platform_device(dev); | ||
| 540 | struct s1d13xxxfb_par *default_par; | 538 | struct s1d13xxxfb_par *default_par; |
| 541 | struct fb_info *info; | 539 | struct fb_info *info; |
| 542 | struct s1d13xxxfb_pdata *pdata = NULL; | 540 | struct s1d13xxxfb_pdata *pdata = NULL; |
| @@ -548,8 +546,8 @@ s1d13xxxfb_probe(struct device *dev) | |||
| 548 | printk(KERN_INFO "Epson S1D13XXX FB Driver\n"); | 546 | printk(KERN_INFO "Epson S1D13XXX FB Driver\n"); |
| 549 | 547 | ||
| 550 | /* enable platform-dependent hardware glue, if any */ | 548 | /* enable platform-dependent hardware glue, if any */ |
| 551 | if (dev->platform_data) | 549 | if (pdev->dev.platform_data) |
| 552 | pdata = dev->platform_data; | 550 | pdata = pdev->dev.platform_data; |
| 553 | 551 | ||
| 554 | if (pdata && pdata->platform_init_video) | 552 | if (pdata && pdata->platform_init_video) |
| 555 | pdata->platform_init_video(); | 553 | pdata->platform_init_video(); |
| @@ -572,14 +570,14 @@ s1d13xxxfb_probe(struct device *dev) | |||
| 572 | 570 | ||
| 573 | if (!request_mem_region(pdev->resource[0].start, | 571 | if (!request_mem_region(pdev->resource[0].start, |
| 574 | pdev->resource[0].end - pdev->resource[0].start +1, "s1d13xxxfb mem")) { | 572 | pdev->resource[0].end - pdev->resource[0].start +1, "s1d13xxxfb mem")) { |
| 575 | dev_dbg(dev, "request_mem_region failed\n"); | 573 | dev_dbg(&pdev->dev, "request_mem_region failed\n"); |
| 576 | ret = -EBUSY; | 574 | ret = -EBUSY; |
| 577 | goto bail; | 575 | goto bail; |
| 578 | } | 576 | } |
| 579 | 577 | ||
| 580 | if (!request_mem_region(pdev->resource[1].start, | 578 | if (!request_mem_region(pdev->resource[1].start, |
| 581 | pdev->resource[1].end - pdev->resource[1].start +1, "s1d13xxxfb regs")) { | 579 | pdev->resource[1].end - pdev->resource[1].start +1, "s1d13xxxfb regs")) { |
| 582 | dev_dbg(dev, "request_mem_region failed\n"); | 580 | dev_dbg(&pdev->dev, "request_mem_region failed\n"); |
| 583 | ret = -EBUSY; | 581 | ret = -EBUSY; |
| 584 | goto bail; | 582 | goto bail; |
| 585 | } | 583 | } |
| @@ -640,7 +638,7 @@ s1d13xxxfb_probe(struct device *dev) | |||
| 640 | goto bail; | 638 | goto bail; |
| 641 | } | 639 | } |
| 642 | 640 | ||
| 643 | dev_set_drvdata(&pdev->dev, info); | 641 | platform_set_drvdata(pdev, info); |
| 644 | 642 | ||
| 645 | printk(KERN_INFO "fb%d: %s frame buffer device\n", | 643 | printk(KERN_INFO "fb%d: %s frame buffer device\n", |
| 646 | info->node, info->fix.id); | 644 | info->node, info->fix.id); |
| @@ -648,15 +646,15 @@ s1d13xxxfb_probe(struct device *dev) | |||
| 648 | return 0; | 646 | return 0; |
| 649 | 647 | ||
| 650 | bail: | 648 | bail: |
| 651 | s1d13xxxfb_remove(dev); | 649 | s1d13xxxfb_remove(pdev); |
| 652 | return ret; | 650 | return ret; |
| 653 | 651 | ||
| 654 | } | 652 | } |
| 655 | 653 | ||
| 656 | #ifdef CONFIG_PM | 654 | #ifdef CONFIG_PM |
| 657 | static int s1d13xxxfb_suspend(struct device *dev, pm_message_t state) | 655 | static int s1d13xxxfb_suspend(struct platform_device *dev, pm_message_t state) |
| 658 | { | 656 | { |
| 659 | struct fb_info *info = dev_get_drvdata(dev); | 657 | struct fb_info *info = platform_get_drvdata(dev); |
| 660 | struct s1d13xxxfb_par *s1dfb = info->par; | 658 | struct s1d13xxxfb_par *s1dfb = info->par; |
| 661 | struct s1d13xxxfb_pdata *pdata = NULL; | 659 | struct s1d13xxxfb_pdata *pdata = NULL; |
| 662 | 660 | ||
| @@ -664,8 +662,8 @@ static int s1d13xxxfb_suspend(struct device *dev, pm_message_t state) | |||
| 664 | lcd_enable(s1dfb, 0); | 662 | lcd_enable(s1dfb, 0); |
| 665 | crt_enable(s1dfb, 0); | 663 | crt_enable(s1dfb, 0); |
| 666 | 664 | ||
| 667 | if (dev->platform_data) | 665 | if (dev->dev.platform_data) |
| 668 | pdata = dev->platform_data; | 666 | pdata = dev->dev.platform_data; |
| 669 | 667 | ||
| 670 | #if 0 | 668 | #if 0 |
| 671 | if (!s1dfb->disp_save) | 669 | if (!s1dfb->disp_save) |
| @@ -701,9 +699,9 @@ static int s1d13xxxfb_suspend(struct device *dev, pm_message_t state) | |||
| 701 | return 0; | 699 | return 0; |
| 702 | } | 700 | } |
| 703 | 701 | ||
| 704 | static int s1d13xxxfb_resume(struct device *dev) | 702 | static int s1d13xxxfb_resume(struct platform_device *dev) |
| 705 | { | 703 | { |
| 706 | struct fb_info *info = dev_get_drvdata(dev); | 704 | struct fb_info *info = platform_get_drvdata(dev); |
| 707 | struct s1d13xxxfb_par *s1dfb = info->par; | 705 | struct s1d13xxxfb_par *s1dfb = info->par; |
| 708 | struct s1d13xxxfb_pdata *pdata = NULL; | 706 | struct s1d13xxxfb_pdata *pdata = NULL; |
| 709 | 707 | ||
| @@ -714,8 +712,8 @@ static int s1d13xxxfb_resume(struct device *dev) | |||
| 714 | while ((s1d13xxxfb_readreg(s1dfb, S1DREG_PS_STATUS) & 0x01)) | 712 | while ((s1d13xxxfb_readreg(s1dfb, S1DREG_PS_STATUS) & 0x01)) |
| 715 | udelay(10); | 713 | udelay(10); |
| 716 | 714 | ||
| 717 | if (dev->platform_data) | 715 | if (dev->dev.platform_data) |
| 718 | pdata = dev->platform_data; | 716 | pdata = dev->dev.platform_data; |
| 719 | 717 | ||
| 720 | if (s1dfb->regs_save) { | 718 | if (s1dfb->regs_save) { |
| 721 | /* will write RO regs, *should* get away with it :) */ | 719 | /* will write RO regs, *should* get away with it :) */ |
| @@ -741,15 +739,16 @@ static int s1d13xxxfb_resume(struct device *dev) | |||
| 741 | } | 739 | } |
| 742 | #endif /* CONFIG_PM */ | 740 | #endif /* CONFIG_PM */ |
| 743 | 741 | ||
| 744 | static struct device_driver s1d13xxxfb_driver = { | 742 | static struct platform_driver s1d13xxxfb_driver = { |
| 745 | .name = S1D_DEVICENAME, | ||
| 746 | .bus = &platform_bus_type, | ||
| 747 | .probe = s1d13xxxfb_probe, | 743 | .probe = s1d13xxxfb_probe, |
| 748 | .remove = s1d13xxxfb_remove, | 744 | .remove = s1d13xxxfb_remove, |
| 749 | #ifdef CONFIG_PM | 745 | #ifdef CONFIG_PM |
| 750 | .suspend = s1d13xxxfb_suspend, | 746 | .suspend = s1d13xxxfb_suspend, |
| 751 | .resume = s1d13xxxfb_resume | 747 | .resume = s1d13xxxfb_resume, |
| 752 | #endif | 748 | #endif |
| 749 | .driver = { | ||
| 750 | .name = S1D_DEVICENAME, | ||
| 751 | }, | ||
| 753 | }; | 752 | }; |
| 754 | 753 | ||
| 755 | 754 | ||
| @@ -759,14 +758,14 @@ s1d13xxxfb_init(void) | |||
| 759 | if (fb_get_options("s1d13xxxfb", NULL)) | 758 | if (fb_get_options("s1d13xxxfb", NULL)) |
| 760 | return -ENODEV; | 759 | return -ENODEV; |
| 761 | 760 | ||
| 762 | return driver_register(&s1d13xxxfb_driver); | 761 | return platform_driver_register(&s1d13xxxfb_driver); |
| 763 | } | 762 | } |
| 764 | 763 | ||
| 765 | 764 | ||
| 766 | static void __exit | 765 | static void __exit |
| 767 | s1d13xxxfb_exit(void) | 766 | s1d13xxxfb_exit(void) |
| 768 | { | 767 | { |
| 769 | driver_unregister(&s1d13xxxfb_driver); | 768 | platform_driver_unregister(&s1d13xxxfb_driver); |
| 770 | } | 769 | } |
| 771 | 770 | ||
| 772 | module_init(s1d13xxxfb_init); | 771 | module_init(s1d13xxxfb_init); |
diff --git a/drivers/video/s3c2410fb.c b/drivers/video/s3c2410fb.c index 855a6778b9eb..ce6e749db3a7 100644 --- a/drivers/video/s3c2410fb.c +++ b/drivers/video/s3c2410fb.c | |||
| @@ -634,19 +634,18 @@ static irqreturn_t s3c2410fb_irq(int irq, void *dev_id, struct pt_regs *r) | |||
| 634 | 634 | ||
| 635 | static char driver_name[]="s3c2410fb"; | 635 | static char driver_name[]="s3c2410fb"; |
| 636 | 636 | ||
| 637 | int __init s3c2410fb_probe(struct device *dev) | 637 | int __init s3c2410fb_probe(struct platform_device *pdev) |
| 638 | { | 638 | { |
| 639 | struct s3c2410fb_info *info; | 639 | struct s3c2410fb_info *info; |
| 640 | struct fb_info *fbinfo; | 640 | struct fb_info *fbinfo; |
| 641 | struct platform_device *pdev = to_platform_device(dev); | ||
| 642 | struct s3c2410fb_hw *mregs; | 641 | struct s3c2410fb_hw *mregs; |
| 643 | int ret; | 642 | int ret; |
| 644 | int irq; | 643 | int irq; |
| 645 | int i; | 644 | int i; |
| 646 | 645 | ||
| 647 | mach_info = dev->platform_data; | 646 | mach_info = pdev->dev.platform_data; |
| 648 | if (mach_info == NULL) { | 647 | if (mach_info == NULL) { |
| 649 | dev_err(dev,"no platform data for lcd, cannot attach\n"); | 648 | dev_err(&pdev->dev,"no platform data for lcd, cannot attach\n"); |
| 650 | return -EINVAL; | 649 | return -EINVAL; |
| 651 | } | 650 | } |
| 652 | 651 | ||
| @@ -654,11 +653,11 @@ int __init s3c2410fb_probe(struct device *dev) | |||
| 654 | 653 | ||
| 655 | irq = platform_get_irq(pdev, 0); | 654 | irq = platform_get_irq(pdev, 0); |
| 656 | if (irq < 0) { | 655 | if (irq < 0) { |
| 657 | dev_err(dev, "no irq for device\n"); | 656 | dev_err(&pdev->dev, "no irq for device\n"); |
| 658 | return -ENOENT; | 657 | return -ENOENT; |
| 659 | } | 658 | } |
| 660 | 659 | ||
| 661 | fbinfo = framebuffer_alloc(sizeof(struct s3c2410fb_info), dev); | 660 | fbinfo = framebuffer_alloc(sizeof(struct s3c2410fb_info), &pdev->dev); |
| 662 | if (!fbinfo) { | 661 | if (!fbinfo) { |
| 663 | return -ENOMEM; | 662 | return -ENOMEM; |
| 664 | } | 663 | } |
| @@ -666,7 +665,7 @@ int __init s3c2410fb_probe(struct device *dev) | |||
| 666 | 665 | ||
| 667 | info = fbinfo->par; | 666 | info = fbinfo->par; |
| 668 | info->fb = fbinfo; | 667 | info->fb = fbinfo; |
| 669 | dev_set_drvdata(dev, fbinfo); | 668 | platform_set_drvdata(pdev, fbinfo); |
| 670 | 669 | ||
| 671 | s3c2410fb_init_registers(info); | 670 | s3c2410fb_init_registers(info); |
| 672 | 671 | ||
| @@ -676,7 +675,7 @@ int __init s3c2410fb_probe(struct device *dev) | |||
| 676 | 675 | ||
| 677 | memcpy(&info->regs, &mach_info->regs, sizeof(info->regs)); | 676 | memcpy(&info->regs, &mach_info->regs, sizeof(info->regs)); |
| 678 | 677 | ||
| 679 | info->mach_info = dev->platform_data; | 678 | info->mach_info = pdev->dev.platform_data; |
| 680 | 679 | ||
| 681 | fbinfo->fix.type = FB_TYPE_PACKED_PIXELS; | 680 | fbinfo->fix.type = FB_TYPE_PACKED_PIXELS; |
| 682 | fbinfo->fix.type_aux = 0; | 681 | fbinfo->fix.type_aux = 0; |
| @@ -735,7 +734,7 @@ int __init s3c2410fb_probe(struct device *dev) | |||
| 735 | 734 | ||
| 736 | ret = request_irq(irq, s3c2410fb_irq, SA_INTERRUPT, pdev->name, info); | 735 | ret = request_irq(irq, s3c2410fb_irq, SA_INTERRUPT, pdev->name, info); |
| 737 | if (ret) { | 736 | if (ret) { |
| 738 | dev_err(dev, "cannot get irq %d - err %d\n", irq, ret); | 737 | dev_err(&pdev->dev, "cannot get irq %d - err %d\n", irq, ret); |
| 739 | ret = -EBUSY; | 738 | ret = -EBUSY; |
| 740 | goto release_mem; | 739 | goto release_mem; |
| 741 | } | 740 | } |
| @@ -773,7 +772,7 @@ int __init s3c2410fb_probe(struct device *dev) | |||
| 773 | } | 772 | } |
| 774 | 773 | ||
| 775 | /* create device files */ | 774 | /* create device files */ |
| 776 | device_create_file(dev, &dev_attr_debug); | 775 | device_create_file(&pdev->dev, &dev_attr_debug); |
| 777 | 776 | ||
| 778 | printk(KERN_INFO "fb%d: %s frame buffer device\n", | 777 | printk(KERN_INFO "fb%d: %s frame buffer device\n", |
| 779 | fbinfo->node, fbinfo->fix.id); | 778 | fbinfo->node, fbinfo->fix.id); |
| @@ -816,10 +815,9 @@ static void s3c2410fb_stop_lcd(void) | |||
| 816 | /* | 815 | /* |
| 817 | * Cleanup | 816 | * Cleanup |
| 818 | */ | 817 | */ |
| 819 | static int s3c2410fb_remove(struct device *dev) | 818 | static int s3c2410fb_remove(struct platform_device *pdev) |
| 820 | { | 819 | { |
| 821 | struct platform_device *pdev = to_platform_device(dev); | 820 | struct fb_info *fbinfo = platform_get_drvdata(pdev); |
| 822 | struct fb_info *fbinfo = dev_get_drvdata(dev); | ||
| 823 | struct s3c2410fb_info *info = fbinfo->par; | 821 | struct s3c2410fb_info *info = fbinfo->par; |
| 824 | int irq; | 822 | int irq; |
| 825 | 823 | ||
| @@ -847,9 +845,9 @@ static int s3c2410fb_remove(struct device *dev) | |||
| 847 | 845 | ||
| 848 | /* suspend and resume support for the lcd controller */ | 846 | /* suspend and resume support for the lcd controller */ |
| 849 | 847 | ||
| 850 | static int s3c2410fb_suspend(struct device *dev, pm_message_t state) | 848 | static int s3c2410fb_suspend(struct platform_device *dev, pm_message_t state) |
| 851 | { | 849 | { |
| 852 | struct fb_info *fbinfo = dev_get_drvdata(dev); | 850 | struct fb_info *fbinfo = platform_get_drvdata(dev); |
| 853 | struct s3c2410fb_info *info = fbinfo->par; | 851 | struct s3c2410fb_info *info = fbinfo->par; |
| 854 | 852 | ||
| 855 | s3c2410fb_stop_lcd(); | 853 | s3c2410fb_stop_lcd(); |
| @@ -864,9 +862,9 @@ static int s3c2410fb_suspend(struct device *dev, pm_message_t state) | |||
| 864 | return 0; | 862 | return 0; |
| 865 | } | 863 | } |
| 866 | 864 | ||
| 867 | static int s3c2410fb_resume(struct device *dev) | 865 | static int s3c2410fb_resume(struct platform_device *dev) |
| 868 | { | 866 | { |
| 869 | struct fb_info *fbinfo = dev_get_drvdata(dev); | 867 | struct fb_info *fbinfo = platform_get_drvdata(dev); |
| 870 | struct s3c2410fb_info *info = fbinfo->par; | 868 | struct s3c2410fb_info *info = fbinfo->par; |
| 871 | 869 | ||
| 872 | clk_enable(info->clk); | 870 | clk_enable(info->clk); |
| @@ -882,24 +880,25 @@ static int s3c2410fb_resume(struct device *dev) | |||
| 882 | #define s3c2410fb_resume NULL | 880 | #define s3c2410fb_resume NULL |
| 883 | #endif | 881 | #endif |
| 884 | 882 | ||
| 885 | static struct device_driver s3c2410fb_driver = { | 883 | static struct platform_driver s3c2410fb_driver = { |
| 886 | .name = "s3c2410-lcd", | ||
| 887 | .owner = THIS_MODULE, | ||
| 888 | .bus = &platform_bus_type, | ||
| 889 | .probe = s3c2410fb_probe, | 884 | .probe = s3c2410fb_probe, |
| 885 | .remove = s3c2410fb_remove, | ||
| 890 | .suspend = s3c2410fb_suspend, | 886 | .suspend = s3c2410fb_suspend, |
| 891 | .resume = s3c2410fb_resume, | 887 | .resume = s3c2410fb_resume, |
| 892 | .remove = s3c2410fb_remove | 888 | .driver = { |
| 889 | .name = "s3c2410-lcd", | ||
| 890 | .owner = THIS_MODULE, | ||
| 891 | }, | ||
| 893 | }; | 892 | }; |
| 894 | 893 | ||
| 895 | int __devinit s3c2410fb_init(void) | 894 | int __devinit s3c2410fb_init(void) |
| 896 | { | 895 | { |
| 897 | return driver_register(&s3c2410fb_driver); | 896 | return platform_driver_register(&s3c2410fb_driver); |
| 898 | } | 897 | } |
| 899 | 898 | ||
| 900 | static void __exit s3c2410fb_cleanup(void) | 899 | static void __exit s3c2410fb_cleanup(void) |
| 901 | { | 900 | { |
| 902 | driver_unregister(&s3c2410fb_driver); | 901 | platform_driver_unregister(&s3c2410fb_driver); |
| 903 | } | 902 | } |
| 904 | 903 | ||
| 905 | 904 | ||
diff --git a/drivers/video/sa1100fb.c b/drivers/video/sa1100fb.c index a5184575cfae..2ea1354e439f 100644 --- a/drivers/video/sa1100fb.c +++ b/drivers/video/sa1100fb.c | |||
| @@ -1308,17 +1308,17 @@ sa1100fb_freq_policy(struct notifier_block *nb, unsigned long val, | |||
| 1308 | * Power management hooks. Note that we won't be called from IRQ context, | 1308 | * Power management hooks. Note that we won't be called from IRQ context, |
| 1309 | * unlike the blank functions above, so we may sleep. | 1309 | * unlike the blank functions above, so we may sleep. |
| 1310 | */ | 1310 | */ |
| 1311 | static int sa1100fb_suspend(struct device *dev, pm_message_t state) | 1311 | static int sa1100fb_suspend(struct platform_device *dev, pm_message_t state) |
| 1312 | { | 1312 | { |
| 1313 | struct sa1100fb_info *fbi = dev_get_drvdata(dev); | 1313 | struct sa1100fb_info *fbi = platform_get_drvdata(dev); |
| 1314 | 1314 | ||
| 1315 | set_ctrlr_state(fbi, C_DISABLE_PM); | 1315 | set_ctrlr_state(fbi, C_DISABLE_PM); |
| 1316 | return 0; | 1316 | return 0; |
| 1317 | } | 1317 | } |
| 1318 | 1318 | ||
| 1319 | static int sa1100fb_resume(struct device *dev) | 1319 | static int sa1100fb_resume(struct platform_device *dev) |
| 1320 | { | 1320 | { |
| 1321 | struct sa1100fb_info *fbi = dev_get_drvdata(dev); | 1321 | struct sa1100fb_info *fbi = platform_get_drvdata(dev); |
| 1322 | 1322 | ||
| 1323 | set_ctrlr_state(fbi, C_ENABLE_PM); | 1323 | set_ctrlr_state(fbi, C_ENABLE_PM); |
| 1324 | return 0; | 1324 | return 0; |
| @@ -1452,7 +1452,7 @@ static struct sa1100fb_info * __init sa1100fb_init_fbinfo(struct device *dev) | |||
| 1452 | return fbi; | 1452 | return fbi; |
| 1453 | } | 1453 | } |
| 1454 | 1454 | ||
| 1455 | static int __init sa1100fb_probe(struct device *dev) | 1455 | static int __init sa1100fb_probe(struct platform_device *pdev) |
| 1456 | { | 1456 | { |
| 1457 | struct sa1100fb_info *fbi; | 1457 | struct sa1100fb_info *fbi; |
| 1458 | int ret; | 1458 | int ret; |
| @@ -1460,7 +1460,7 @@ static int __init sa1100fb_probe(struct device *dev) | |||
| 1460 | if (!request_mem_region(0xb0100000, 0x10000, "LCD")) | 1460 | if (!request_mem_region(0xb0100000, 0x10000, "LCD")) |
| 1461 | return -EBUSY; | 1461 | return -EBUSY; |
| 1462 | 1462 | ||
| 1463 | fbi = sa1100fb_init_fbinfo(dev); | 1463 | fbi = sa1100fb_init_fbinfo(&pdev->dev); |
| 1464 | ret = -ENOMEM; | 1464 | ret = -ENOMEM; |
| 1465 | if (!fbi) | 1465 | if (!fbi) |
| 1466 | goto failed; | 1466 | goto failed; |
| @@ -1488,7 +1488,7 @@ static int __init sa1100fb_probe(struct device *dev) | |||
| 1488 | */ | 1488 | */ |
| 1489 | sa1100fb_check_var(&fbi->fb.var, &fbi->fb); | 1489 | sa1100fb_check_var(&fbi->fb.var, &fbi->fb); |
| 1490 | 1490 | ||
| 1491 | dev_set_drvdata(dev, fbi); | 1491 | platform_set_drvdata(pdev, fbi); |
| 1492 | 1492 | ||
| 1493 | ret = register_framebuffer(&fbi->fb); | 1493 | ret = register_framebuffer(&fbi->fb); |
| 1494 | if (ret < 0) | 1494 | if (ret < 0) |
| @@ -1505,18 +1505,19 @@ static int __init sa1100fb_probe(struct device *dev) | |||
| 1505 | return 0; | 1505 | return 0; |
| 1506 | 1506 | ||
| 1507 | failed: | 1507 | failed: |
| 1508 | dev_set_drvdata(dev, NULL); | 1508 | platform_set_drvdata(pdev, NULL); |
| 1509 | kfree(fbi); | 1509 | kfree(fbi); |
| 1510 | release_mem_region(0xb0100000, 0x10000); | 1510 | release_mem_region(0xb0100000, 0x10000); |
| 1511 | return ret; | 1511 | return ret; |
| 1512 | } | 1512 | } |
| 1513 | 1513 | ||
| 1514 | static struct device_driver sa1100fb_driver = { | 1514 | static struct platform_driver sa1100fb_driver = { |
| 1515 | .name = "sa11x0-fb", | ||
| 1516 | .bus = &platform_bus_type, | ||
| 1517 | .probe = sa1100fb_probe, | 1515 | .probe = sa1100fb_probe, |
| 1518 | .suspend = sa1100fb_suspend, | 1516 | .suspend = sa1100fb_suspend, |
| 1519 | .resume = sa1100fb_resume, | 1517 | .resume = sa1100fb_resume, |
| 1518 | .driver = { | ||
| 1519 | .name = "sa11x0-fb", | ||
| 1520 | }, | ||
| 1520 | }; | 1521 | }; |
| 1521 | 1522 | ||
| 1522 | int __init sa1100fb_init(void) | 1523 | int __init sa1100fb_init(void) |
| @@ -1524,7 +1525,7 @@ int __init sa1100fb_init(void) | |||
| 1524 | if (fb_get_options("sa1100fb", NULL)) | 1525 | if (fb_get_options("sa1100fb", NULL)) |
| 1525 | return -ENODEV; | 1526 | return -ENODEV; |
| 1526 | 1527 | ||
| 1527 | return driver_register(&sa1100fb_driver); | 1528 | return platform_driver_register(&sa1100fb_driver); |
| 1528 | } | 1529 | } |
| 1529 | 1530 | ||
| 1530 | int __init sa1100fb_setup(char *options) | 1531 | int __init sa1100fb_setup(char *options) |
diff --git a/drivers/video/sgivwfb.c b/drivers/video/sgivwfb.c index 2e8769dd345a..7054660767e4 100644 --- a/drivers/video/sgivwfb.c +++ b/drivers/video/sgivwfb.c | |||
| @@ -750,9 +750,8 @@ int __init sgivwfb_setup(char *options) | |||
| 750 | /* | 750 | /* |
| 751 | * Initialisation | 751 | * Initialisation |
| 752 | */ | 752 | */ |
| 753 | static int __init sgivwfb_probe(struct device *device) | 753 | static int __init sgivwfb_probe(struct platform_device *dev) |
| 754 | { | 754 | { |
| 755 | struct platform_device *dev = to_platform_device(device); | ||
| 756 | struct sgivw_par *par; | 755 | struct sgivw_par *par; |
| 757 | struct fb_info *info; | 756 | struct fb_info *info; |
| 758 | char *monitor; | 757 | char *monitor; |
| @@ -813,7 +812,7 @@ static int __init sgivwfb_probe(struct device *device) | |||
| 813 | goto fail_register_framebuffer; | 812 | goto fail_register_framebuffer; |
| 814 | } | 813 | } |
| 815 | 814 | ||
| 816 | dev_set_drvdata(&dev->dev, info); | 815 | platform_set_drvdata(dev, info); |
| 817 | 816 | ||
| 818 | printk(KERN_INFO "fb%d: SGI DBE frame buffer device, using %ldK of video memory at %#lx\n", | 817 | printk(KERN_INFO "fb%d: SGI DBE frame buffer device, using %ldK of video memory at %#lx\n", |
| 819 | info->node, sgivwfb_mem_size >> 10, sgivwfb_mem_phys); | 818 | info->node, sgivwfb_mem_size >> 10, sgivwfb_mem_phys); |
| @@ -831,9 +830,9 @@ fail_ioremap_regs: | |||
| 831 | return -ENXIO; | 830 | return -ENXIO; |
| 832 | } | 831 | } |
| 833 | 832 | ||
| 834 | static int sgivwfb_remove(struct device *device) | 833 | static int sgivwfb_remove(struct platform_device *dev) |
| 835 | { | 834 | { |
| 836 | struct fb_info *info = dev_get_drvdata(device); | 835 | struct fb_info *info = platform_get_drvdata(dev); |
| 837 | 836 | ||
| 838 | if (info) { | 837 | if (info) { |
| 839 | struct sgivw_par *par = info->par; | 838 | struct sgivw_par *par = info->par; |
| @@ -847,11 +846,12 @@ static int sgivwfb_remove(struct device *device) | |||
| 847 | return 0; | 846 | return 0; |
| 848 | } | 847 | } |
| 849 | 848 | ||
| 850 | static struct device_driver sgivwfb_driver = { | 849 | static struct platform_driver sgivwfb_driver = { |
| 851 | .name = "sgivwfb", | ||
| 852 | .bus = &platform_bus_type, | ||
| 853 | .probe = sgivwfb_probe, | 850 | .probe = sgivwfb_probe, |
| 854 | .remove = sgivwfb_remove, | 851 | .remove = sgivwfb_remove, |
| 852 | .driver = { | ||
| 853 | .name = "sgivwfb", | ||
| 854 | }, | ||
| 855 | }; | 855 | }; |
| 856 | 856 | ||
| 857 | static struct platform_device *sgivwfb_device; | 857 | static struct platform_device *sgivwfb_device; |
| @@ -867,7 +867,7 @@ int __init sgivwfb_init(void) | |||
| 867 | return -ENODEV; | 867 | return -ENODEV; |
| 868 | sgivwfb_setup(option); | 868 | sgivwfb_setup(option); |
| 869 | #endif | 869 | #endif |
| 870 | ret = driver_register(&sgivwfb_driver); | 870 | ret = platform_driver_register(&sgivwfb_driver); |
| 871 | if (!ret) { | 871 | if (!ret) { |
| 872 | sgivwfb_device = platform_device_alloc("sgivwfb", 0); | 872 | sgivwfb_device = platform_device_alloc("sgivwfb", 0); |
| 873 | if (sgivwfb_device) { | 873 | if (sgivwfb_device) { |
| @@ -875,7 +875,7 @@ int __init sgivwfb_init(void) | |||
| 875 | } else | 875 | } else |
| 876 | ret = -ENOMEM; | 876 | ret = -ENOMEM; |
| 877 | if (ret) { | 877 | if (ret) { |
| 878 | driver_unregister(&sgivwfb_driver); | 878 | platform_driver_unregister(&sgivwfb_driver); |
| 879 | platform_device_put(sgivwfb_device); | 879 | platform_device_put(sgivwfb_device); |
| 880 | } | 880 | } |
| 881 | } | 881 | } |
| @@ -890,7 +890,7 @@ MODULE_LICENSE("GPL"); | |||
| 890 | static void __exit sgivwfb_exit(void) | 890 | static void __exit sgivwfb_exit(void) |
| 891 | { | 891 | { |
| 892 | platform_device_unregister(sgivwfb_device); | 892 | platform_device_unregister(sgivwfb_device); |
| 893 | driver_unregister(&sgivwfb_driver); | 893 | platform_driver_unregister(&sgivwfb_driver); |
| 894 | } | 894 | } |
| 895 | 895 | ||
| 896 | module_exit(sgivwfb_exit); | 896 | module_exit(sgivwfb_exit); |
diff --git a/drivers/video/vesafb.c b/drivers/video/vesafb.c index e25eae1a78c1..2c3aa2fcfd91 100644 --- a/drivers/video/vesafb.c +++ b/drivers/video/vesafb.c | |||
| @@ -245,9 +245,8 @@ static int __init vesafb_setup(char *options) | |||
| 245 | return 0; | 245 | return 0; |
| 246 | } | 246 | } |
| 247 | 247 | ||
| 248 | static int __init vesafb_probe(struct device *device) | 248 | static int __init vesafb_probe(struct platform_device *dev) |
| 249 | { | 249 | { |
| 250 | struct platform_device *dev = to_platform_device(device); | ||
| 251 | struct fb_info *info; | 250 | struct fb_info *info; |
| 252 | int i, err; | 251 | int i, err; |
| 253 | unsigned int size_vmode; | 252 | unsigned int size_vmode; |
| @@ -480,10 +479,11 @@ err: | |||
| 480 | return err; | 479 | return err; |
| 481 | } | 480 | } |
| 482 | 481 | ||
| 483 | static struct device_driver vesafb_driver = { | 482 | static struct platform_driver vesafb_driver = { |
| 484 | .name = "vesafb", | ||
| 485 | .bus = &platform_bus_type, | ||
| 486 | .probe = vesafb_probe, | 483 | .probe = vesafb_probe, |
| 484 | .driver = { | ||
| 485 | .name = "vesafb", | ||
| 486 | }, | ||
| 487 | }; | 487 | }; |
| 488 | 488 | ||
| 489 | static struct platform_device vesafb_device = { | 489 | static struct platform_device vesafb_device = { |
| @@ -498,12 +498,12 @@ static int __init vesafb_init(void) | |||
| 498 | /* ignore error return of fb_get_options */ | 498 | /* ignore error return of fb_get_options */ |
| 499 | fb_get_options("vesafb", &option); | 499 | fb_get_options("vesafb", &option); |
| 500 | vesafb_setup(option); | 500 | vesafb_setup(option); |
| 501 | ret = driver_register(&vesafb_driver); | 501 | ret = platform_driver_register(&vesafb_driver); |
| 502 | 502 | ||
| 503 | if (!ret) { | 503 | if (!ret) { |
| 504 | ret = platform_device_register(&vesafb_device); | 504 | ret = platform_device_register(&vesafb_device); |
| 505 | if (ret) | 505 | if (ret) |
| 506 | driver_unregister(&vesafb_driver); | 506 | platform_driver_unregister(&vesafb_driver); |
| 507 | } | 507 | } |
| 508 | return ret; | 508 | return ret; |
| 509 | } | 509 | } |
diff --git a/drivers/video/vfb.c b/drivers/video/vfb.c index 8794dc5d2466..ffa1ad474226 100644 --- a/drivers/video/vfb.c +++ b/drivers/video/vfb.c | |||
| @@ -403,9 +403,8 @@ static void vfb_platform_release(struct device *device) | |||
| 403 | // This is called when the reference count goes to zero. | 403 | // This is called when the reference count goes to zero. |
| 404 | } | 404 | } |
| 405 | 405 | ||
| 406 | static int __init vfb_probe(struct device *device) | 406 | static int __init vfb_probe(struct platform_device *dev) |
| 407 | { | 407 | { |
| 408 | struct platform_device *dev = to_platform_device(device); | ||
| 409 | struct fb_info *info; | 408 | struct fb_info *info; |
| 410 | int retval = -ENOMEM; | 409 | int retval = -ENOMEM; |
| 411 | 410 | ||
| @@ -447,7 +446,7 @@ static int __init vfb_probe(struct device *device) | |||
| 447 | retval = register_framebuffer(info); | 446 | retval = register_framebuffer(info); |
| 448 | if (retval < 0) | 447 | if (retval < 0) |
| 449 | goto err2; | 448 | goto err2; |
| 450 | dev_set_drvdata(&dev->dev, info); | 449 | platform_set_drvdata(dev, info); |
| 451 | 450 | ||
| 452 | printk(KERN_INFO | 451 | printk(KERN_INFO |
| 453 | "fb%d: Virtual frame buffer device, using %ldK of video memory\n", | 452 | "fb%d: Virtual frame buffer device, using %ldK of video memory\n", |
| @@ -462,9 +461,9 @@ err: | |||
| 462 | return retval; | 461 | return retval; |
| 463 | } | 462 | } |
| 464 | 463 | ||
| 465 | static int vfb_remove(struct device *device) | 464 | static int vfb_remove(struct platform_device *dev) |
| 466 | { | 465 | { |
| 467 | struct fb_info *info = dev_get_drvdata(device); | 466 | struct fb_info *info = platform_get_drvdata(dev); |
| 468 | 467 | ||
| 469 | if (info) { | 468 | if (info) { |
| 470 | unregister_framebuffer(info); | 469 | unregister_framebuffer(info); |
| @@ -474,11 +473,12 @@ static int vfb_remove(struct device *device) | |||
| 474 | return 0; | 473 | return 0; |
| 475 | } | 474 | } |
| 476 | 475 | ||
| 477 | static struct device_driver vfb_driver = { | 476 | static struct platform_driver vfb_driver = { |
| 478 | .name = "vfb", | ||
| 479 | .bus = &platform_bus_type, | ||
| 480 | .probe = vfb_probe, | 477 | .probe = vfb_probe, |
| 481 | .remove = vfb_remove, | 478 | .remove = vfb_remove, |
| 479 | .driver = { | ||
| 480 | .name = "vfb", | ||
| 481 | }, | ||
| 482 | }; | 482 | }; |
| 483 | 483 | ||
| 484 | static struct platform_device vfb_device = { | 484 | static struct platform_device vfb_device = { |
| @@ -504,12 +504,12 @@ static int __init vfb_init(void) | |||
| 504 | if (!vfb_enable) | 504 | if (!vfb_enable) |
| 505 | return -ENXIO; | 505 | return -ENXIO; |
| 506 | 506 | ||
| 507 | ret = driver_register(&vfb_driver); | 507 | ret = platform_driver_register(&vfb_driver); |
| 508 | 508 | ||
| 509 | if (!ret) { | 509 | if (!ret) { |
| 510 | ret = platform_device_register(&vfb_device); | 510 | ret = platform_device_register(&vfb_device); |
| 511 | if (ret) | 511 | if (ret) |
| 512 | driver_unregister(&vfb_driver); | 512 | platform_driver_unregister(&vfb_driver); |
| 513 | } | 513 | } |
| 514 | return ret; | 514 | return ret; |
| 515 | } | 515 | } |
| @@ -520,7 +520,7 @@ module_init(vfb_init); | |||
| 520 | static void __exit vfb_exit(void) | 520 | static void __exit vfb_exit(void) |
| 521 | { | 521 | { |
| 522 | platform_device_unregister(&vfb_device); | 522 | platform_device_unregister(&vfb_device); |
| 523 | driver_unregister(&vfb_driver); | 523 | platform_driver_unregister(&vfb_driver); |
| 524 | } | 524 | } |
| 525 | 525 | ||
| 526 | module_exit(vfb_exit); | 526 | module_exit(vfb_exit); |
diff --git a/drivers/video/w100fb.c b/drivers/video/w100fb.c index 48e70f153c4b..daa46051f55d 100644 --- a/drivers/video/w100fb.c +++ b/drivers/video/w100fb.c | |||
| @@ -437,9 +437,9 @@ static void w100fb_restore_vidmem(struct w100fb_par *par) | |||
| 437 | } | 437 | } |
| 438 | } | 438 | } |
| 439 | 439 | ||
| 440 | static int w100fb_suspend(struct device *dev, pm_message_t state) | 440 | static int w100fb_suspend(struct platform_device *dev, pm_message_t state) |
| 441 | { | 441 | { |
| 442 | struct fb_info *info = dev_get_drvdata(dev); | 442 | struct fb_info *info = platform_get_drvdata(dev); |
| 443 | struct w100fb_par *par=info->par; | 443 | struct w100fb_par *par=info->par; |
| 444 | struct w100_tg_info *tg = par->mach->tg; | 444 | struct w100_tg_info *tg = par->mach->tg; |
| 445 | 445 | ||
| @@ -452,9 +452,9 @@ static int w100fb_suspend(struct device *dev, pm_message_t state) | |||
| 452 | return 0; | 452 | return 0; |
| 453 | } | 453 | } |
| 454 | 454 | ||
| 455 | static int w100fb_resume(struct device *dev) | 455 | static int w100fb_resume(struct platform_device *dev) |
| 456 | { | 456 | { |
| 457 | struct fb_info *info = dev_get_drvdata(dev); | 457 | struct fb_info *info = platform_get_drvdata(dev); |
| 458 | struct w100fb_par *par=info->par; | 458 | struct w100fb_par *par=info->par; |
| 459 | struct w100_tg_info *tg = par->mach->tg; | 459 | struct w100_tg_info *tg = par->mach->tg; |
| 460 | 460 | ||
| @@ -473,13 +473,12 @@ static int w100fb_resume(struct device *dev) | |||
| 473 | #endif | 473 | #endif |
| 474 | 474 | ||
| 475 | 475 | ||
| 476 | int __init w100fb_probe(struct device *dev) | 476 | int __init w100fb_probe(struct platform_device *pdev) |
| 477 | { | 477 | { |
| 478 | int err = -EIO; | 478 | int err = -EIO; |
| 479 | struct w100fb_mach_info *inf; | 479 | struct w100fb_mach_info *inf; |
| 480 | struct fb_info *info = NULL; | 480 | struct fb_info *info = NULL; |
| 481 | struct w100fb_par *par; | 481 | struct w100fb_par *par; |
| 482 | struct platform_device *pdev = to_platform_device(dev); | ||
| 483 | struct resource *mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 482 | struct resource *mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
| 484 | unsigned int chip_id; | 483 | unsigned int chip_id; |
| 485 | 484 | ||
| @@ -522,9 +521,9 @@ int __init w100fb_probe(struct device *dev) | |||
| 522 | } | 521 | } |
| 523 | 522 | ||
| 524 | par = info->par; | 523 | par = info->par; |
| 525 | dev_set_drvdata(dev, info); | 524 | platform_set_drvdata(pdev, info); |
| 526 | 525 | ||
| 527 | inf = dev->platform_data; | 526 | inf = pdev->dev.platform_data; |
| 528 | par->chip_id = chip_id; | 527 | par->chip_id = chip_id; |
| 529 | par->mach = inf; | 528 | par->mach = inf; |
| 530 | par->fastpll_mode = 0; | 529 | par->fastpll_mode = 0; |
| @@ -600,10 +599,10 @@ int __init w100fb_probe(struct device *dev) | |||
| 600 | goto out; | 599 | goto out; |
| 601 | } | 600 | } |
| 602 | 601 | ||
| 603 | device_create_file(dev, &dev_attr_fastpllclk); | 602 | device_create_file(&pdev->dev, &dev_attr_fastpllclk); |
| 604 | device_create_file(dev, &dev_attr_reg_read); | 603 | device_create_file(&pdev->dev, &dev_attr_reg_read); |
| 605 | device_create_file(dev, &dev_attr_reg_write); | 604 | device_create_file(&pdev->dev, &dev_attr_reg_write); |
| 606 | device_create_file(dev, &dev_attr_flip); | 605 | device_create_file(&pdev->dev, &dev_attr_flip); |
| 607 | 606 | ||
| 608 | printk(KERN_INFO "fb%d: %s frame buffer device\n", info->node, info->fix.id); | 607 | printk(KERN_INFO "fb%d: %s frame buffer device\n", info->node, info->fix.id); |
| 609 | return 0; | 608 | return 0; |
| @@ -622,15 +621,15 @@ out: | |||
| 622 | } | 621 | } |
| 623 | 622 | ||
| 624 | 623 | ||
| 625 | static int w100fb_remove(struct device *dev) | 624 | static int w100fb_remove(struct platform_device *pdev) |
| 626 | { | 625 | { |
| 627 | struct fb_info *info = dev_get_drvdata(dev); | 626 | struct fb_info *info = platform_get_drvdata(pdev); |
| 628 | struct w100fb_par *par=info->par; | 627 | struct w100fb_par *par=info->par; |
| 629 | 628 | ||
| 630 | device_remove_file(dev, &dev_attr_fastpllclk); | 629 | device_remove_file(&pdev->dev, &dev_attr_fastpllclk); |
| 631 | device_remove_file(dev, &dev_attr_reg_read); | 630 | device_remove_file(&pdev->dev, &dev_attr_reg_read); |
| 632 | device_remove_file(dev, &dev_attr_reg_write); | 631 | device_remove_file(&pdev->dev, &dev_attr_reg_write); |
| 633 | device_remove_file(dev, &dev_attr_flip); | 632 | device_remove_file(&pdev->dev, &dev_attr_flip); |
| 634 | 633 | ||
| 635 | unregister_framebuffer(info); | 634 | unregister_framebuffer(info); |
| 636 | 635 | ||
| @@ -1448,23 +1447,24 @@ static void w100_vsync(void) | |||
| 1448 | writel(0x00000002, remapped_regs + mmGEN_INT_STATUS); | 1447 | writel(0x00000002, remapped_regs + mmGEN_INT_STATUS); |
| 1449 | } | 1448 | } |
| 1450 | 1449 | ||
| 1451 | static struct device_driver w100fb_driver = { | 1450 | static struct platform_driver w100fb_driver = { |
| 1452 | .name = "w100fb", | ||
| 1453 | .bus = &platform_bus_type, | ||
| 1454 | .probe = w100fb_probe, | 1451 | .probe = w100fb_probe, |
| 1455 | .remove = w100fb_remove, | 1452 | .remove = w100fb_remove, |
| 1456 | .suspend = w100fb_suspend, | 1453 | .suspend = w100fb_suspend, |
| 1457 | .resume = w100fb_resume, | 1454 | .resume = w100fb_resume, |
| 1455 | .driver = { | ||
| 1456 | .name = "w100fb", | ||
| 1457 | }, | ||
| 1458 | }; | 1458 | }; |
| 1459 | 1459 | ||
| 1460 | int __devinit w100fb_init(void) | 1460 | int __devinit w100fb_init(void) |
| 1461 | { | 1461 | { |
| 1462 | return driver_register(&w100fb_driver); | 1462 | return platform_driver_register(&w100fb_driver); |
| 1463 | } | 1463 | } |
| 1464 | 1464 | ||
| 1465 | void __exit w100fb_cleanup(void) | 1465 | void __exit w100fb_cleanup(void) |
| 1466 | { | 1466 | { |
| 1467 | driver_unregister(&w100fb_driver); | 1467 | platform_driver_unregister(&w100fb_driver); |
| 1468 | } | 1468 | } |
| 1469 | 1469 | ||
| 1470 | module_init(w100fb_init); | 1470 | module_init(w100fb_init); |
diff --git a/include/asm-powerpc/auxvec.h b/include/asm-powerpc/auxvec.h index 79d8c4732309..19a099b62cd6 100644 --- a/include/asm-powerpc/auxvec.h +++ b/include/asm-powerpc/auxvec.h | |||
| @@ -14,8 +14,6 @@ | |||
| 14 | /* The vDSO location. We have to use the same value as x86 for glibc's | 14 | /* The vDSO location. We have to use the same value as x86 for glibc's |
| 15 | * sake :-) | 15 | * sake :-) |
| 16 | */ | 16 | */ |
| 17 | #ifdef __powerpc64__ | ||
| 18 | #define AT_SYSINFO_EHDR 33 | 17 | #define AT_SYSINFO_EHDR 33 |
| 19 | #endif | ||
| 20 | 18 | ||
| 21 | #endif | 19 | #endif |
diff --git a/include/asm-powerpc/elf.h b/include/asm-powerpc/elf.h index feac3458d71f..3dcd65edf978 100644 --- a/include/asm-powerpc/elf.h +++ b/include/asm-powerpc/elf.h | |||
| @@ -269,14 +269,12 @@ extern int dcache_bsize; | |||
| 269 | extern int icache_bsize; | 269 | extern int icache_bsize; |
| 270 | extern int ucache_bsize; | 270 | extern int ucache_bsize; |
| 271 | 271 | ||
| 272 | #ifdef __powerpc64__ | 272 | /* vDSO has arch_setup_additional_pages */ |
| 273 | #define ARCH_HAS_SETUP_ADDITIONAL_PAGES | ||
| 273 | struct linux_binprm; | 274 | struct linux_binprm; |
| 274 | #define ARCH_HAS_SETUP_ADDITIONAL_PAGES /* vDSO has arch_setup_additional_pages */ | 275 | extern int arch_setup_additional_pages(struct linux_binprm *bprm, |
| 275 | extern int arch_setup_additional_pages(struct linux_binprm *bprm, int executable_stack); | 276 | int executable_stack); |
| 276 | #define VDSO_AUX_ENT(a,b) NEW_AUX_ENT(a,b); | 277 | #define VDSO_AUX_ENT(a,b) NEW_AUX_ENT(a,b); |
| 277 | #else | ||
| 278 | #define VDSO_AUX_ENT(a,b) | ||
| 279 | #endif /* __powerpc64__ */ | ||
| 280 | 278 | ||
| 281 | /* | 279 | /* |
| 282 | * The requirements here are: | 280 | * The requirements here are: |
diff --git a/include/asm-powerpc/irq.h b/include/asm-powerpc/irq.h index c9fbcede0ef9..8eb7e857ec4c 100644 --- a/include/asm-powerpc/irq.h +++ b/include/asm-powerpc/irq.h | |||
| @@ -389,6 +389,7 @@ extern u64 ppc64_interrupt_controller; | |||
| 389 | #define SIU_INT_TIMER4 ((uint)0x0f + CPM_IRQ_OFFSET) | 389 | #define SIU_INT_TIMER4 ((uint)0x0f + CPM_IRQ_OFFSET) |
| 390 | #define SIU_INT_TMCNT ((uint)0x10 + CPM_IRQ_OFFSET) | 390 | #define SIU_INT_TMCNT ((uint)0x10 + CPM_IRQ_OFFSET) |
| 391 | #define SIU_INT_PIT ((uint)0x11 + CPM_IRQ_OFFSET) | 391 | #define SIU_INT_PIT ((uint)0x11 + CPM_IRQ_OFFSET) |
| 392 | #define SIU_INT_PCI ((uint)0x12 + CPM_IRQ_OFFSET) | ||
| 392 | #define SIU_INT_IRQ1 ((uint)0x13 + CPM_IRQ_OFFSET) | 393 | #define SIU_INT_IRQ1 ((uint)0x13 + CPM_IRQ_OFFSET) |
| 393 | #define SIU_INT_IRQ2 ((uint)0x14 + CPM_IRQ_OFFSET) | 394 | #define SIU_INT_IRQ2 ((uint)0x14 + CPM_IRQ_OFFSET) |
| 394 | #define SIU_INT_IRQ3 ((uint)0x15 + CPM_IRQ_OFFSET) | 395 | #define SIU_INT_IRQ3 ((uint)0x15 + CPM_IRQ_OFFSET) |
diff --git a/include/asm-powerpc/processor.h b/include/asm-powerpc/processor.h index f6f186b56b0f..d12382d292d4 100644 --- a/include/asm-powerpc/processor.h +++ b/include/asm-powerpc/processor.h | |||
| @@ -177,8 +177,8 @@ struct thread_struct { | |||
| 177 | #ifdef CONFIG_PPC64 | 177 | #ifdef CONFIG_PPC64 |
| 178 | unsigned long start_tb; /* Start purr when proc switched in */ | 178 | unsigned long start_tb; /* Start purr when proc switched in */ |
| 179 | unsigned long accum_tb; /* Total accumilated purr for process */ | 179 | unsigned long accum_tb; /* Total accumilated purr for process */ |
| 180 | unsigned long vdso_base; /* base of the vDSO library */ | ||
| 181 | #endif | 180 | #endif |
| 181 | unsigned long vdso_base; /* base of the vDSO library */ | ||
| 182 | unsigned long dabr; /* Data address breakpoint register */ | 182 | unsigned long dabr; /* Data address breakpoint register */ |
| 183 | #ifdef CONFIG_ALTIVEC | 183 | #ifdef CONFIG_ALTIVEC |
| 184 | /* Complete AltiVec register set */ | 184 | /* Complete AltiVec register set */ |
diff --git a/include/asm-powerpc/sparsemem.h b/include/asm-powerpc/sparsemem.h index 58d2aab416f8..ba1b34fdb967 100644 --- a/include/asm-powerpc/sparsemem.h +++ b/include/asm-powerpc/sparsemem.h | |||
| @@ -8,8 +8,8 @@ | |||
| 8 | * MAX_PHYSMEM_BITS 2^N: how much memory we can have in that space | 8 | * MAX_PHYSMEM_BITS 2^N: how much memory we can have in that space |
| 9 | */ | 9 | */ |
| 10 | #define SECTION_SIZE_BITS 24 | 10 | #define SECTION_SIZE_BITS 24 |
| 11 | #define MAX_PHYSADDR_BITS 38 | 11 | #define MAX_PHYSADDR_BITS 44 |
| 12 | #define MAX_PHYSMEM_BITS 36 | 12 | #define MAX_PHYSMEM_BITS 44 |
| 13 | 13 | ||
| 14 | #ifdef CONFIG_MEMORY_HOTPLUG | 14 | #ifdef CONFIG_MEMORY_HOTPLUG |
| 15 | extern void create_section_mapping(unsigned long start, unsigned long end); | 15 | extern void create_section_mapping(unsigned long start, unsigned long end); |
diff --git a/include/asm-powerpc/systemcfg.h b/include/asm-powerpc/systemcfg.h deleted file mode 100644 index 36b5cbe466f1..000000000000 --- a/include/asm-powerpc/systemcfg.h +++ /dev/null | |||
| @@ -1,64 +0,0 @@ | |||
| 1 | #ifndef _SYSTEMCFG_H | ||
| 2 | #define _SYSTEMCFG_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | * Copyright (C) 2002 Peter Bergner <bergner@vnet.ibm.com>, IBM | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or | ||
| 8 | * modify it under the terms of the GNU General Public License | ||
| 9 | * as published by the Free Software Foundation; either version | ||
| 10 | * 2 of the License, or (at your option) any later version. | ||
| 11 | */ | ||
| 12 | |||
| 13 | /* Change Activity: | ||
| 14 | * 2002/09/30 : bergner : Created | ||
| 15 | * End Change Activity | ||
| 16 | */ | ||
| 17 | |||
| 18 | /* | ||
| 19 | * If the major version changes we are incompatible. | ||
| 20 | * Minor version changes are a hint. | ||
| 21 | */ | ||
| 22 | #define SYSTEMCFG_MAJOR 1 | ||
| 23 | #define SYSTEMCFG_MINOR 1 | ||
| 24 | |||
| 25 | #ifndef __ASSEMBLY__ | ||
| 26 | |||
| 27 | #include <linux/unistd.h> | ||
| 28 | |||
| 29 | #define SYSCALL_MAP_SIZE ((__NR_syscalls + 31) / 32) | ||
| 30 | |||
| 31 | struct systemcfg { | ||
| 32 | __u8 eye_catcher[16]; /* Eyecatcher: SYSTEMCFG:PPC64 0x00 */ | ||
| 33 | struct { /* Systemcfg version numbers */ | ||
| 34 | __u32 major; /* Major number 0x10 */ | ||
| 35 | __u32 minor; /* Minor number 0x14 */ | ||
| 36 | } version; | ||
| 37 | |||
| 38 | __u32 platform; /* Platform flags 0x18 */ | ||
| 39 | __u32 processor; /* Processor type 0x1C */ | ||
| 40 | __u64 processorCount; /* # of physical processors 0x20 */ | ||
| 41 | __u64 physicalMemorySize; /* Size of real memory(B) 0x28 */ | ||
| 42 | __u64 tb_orig_stamp; /* Timebase at boot 0x30 */ | ||
| 43 | __u64 tb_ticks_per_sec; /* Timebase tics / sec 0x38 */ | ||
| 44 | __u64 tb_to_xs; /* Inverse of TB to 2^20 0x40 */ | ||
| 45 | __u64 stamp_xsec; /* 0x48 */ | ||
| 46 | __u64 tb_update_count; /* Timebase atomicity ctr 0x50 */ | ||
| 47 | __u32 tz_minuteswest; /* Minutes west of Greenwich 0x58 */ | ||
| 48 | __u32 tz_dsttime; /* Type of dst correction 0x5C */ | ||
| 49 | /* next four are no longer used except to be exported to /proc */ | ||
| 50 | __u32 dcache_size; /* L1 d-cache size 0x60 */ | ||
| 51 | __u32 dcache_line_size; /* L1 d-cache line size 0x64 */ | ||
| 52 | __u32 icache_size; /* L1 i-cache size 0x68 */ | ||
| 53 | __u32 icache_line_size; /* L1 i-cache line size 0x6C */ | ||
| 54 | __u32 syscall_map_64[SYSCALL_MAP_SIZE]; /* map of available syscalls 0x70 */ | ||
| 55 | __u32 syscall_map_32[SYSCALL_MAP_SIZE]; /* map of available syscalls */ | ||
| 56 | }; | ||
| 57 | |||
| 58 | #ifdef __KERNEL__ | ||
| 59 | extern struct systemcfg *_systemcfg; /* to be renamed */ | ||
| 60 | #endif | ||
| 61 | |||
| 62 | #endif /* __ASSEMBLY__ */ | ||
| 63 | |||
| 64 | #endif /* _SYSTEMCFG_H */ | ||
diff --git a/include/asm-powerpc/topology.h b/include/asm-powerpc/topology.h index 2512e3836bf4..015d28746e1b 100644 --- a/include/asm-powerpc/topology.h +++ b/include/asm-powerpc/topology.h | |||
| @@ -9,15 +9,7 @@ | |||
| 9 | 9 | ||
| 10 | static inline int cpu_to_node(int cpu) | 10 | static inline int cpu_to_node(int cpu) |
| 11 | { | 11 | { |
| 12 | int node; | 12 | return numa_cpu_lookup_table[cpu]; |
| 13 | |||
| 14 | node = numa_cpu_lookup_table[cpu]; | ||
| 15 | |||
| 16 | #ifdef DEBUG_NUMA | ||
| 17 | BUG_ON(node == -1); | ||
| 18 | #endif | ||
| 19 | |||
| 20 | return node; | ||
| 21 | } | 13 | } |
| 22 | 14 | ||
| 23 | #define parent_node(node) (node) | 15 | #define parent_node(node) (node) |
| @@ -37,8 +29,6 @@ static inline int node_to_first_cpu(int node) | |||
| 37 | #define pcibus_to_node(node) (-1) | 29 | #define pcibus_to_node(node) (-1) |
| 38 | #define pcibus_to_cpumask(bus) (cpu_online_map) | 30 | #define pcibus_to_cpumask(bus) (cpu_online_map) |
| 39 | 31 | ||
| 40 | #define nr_cpus_node(node) (nr_cpus_in_node[node]) | ||
| 41 | |||
| 42 | /* sched_domains SD_NODE_INIT for PPC64 machines */ | 32 | /* sched_domains SD_NODE_INIT for PPC64 machines */ |
| 43 | #define SD_NODE_INIT (struct sched_domain) { \ | 33 | #define SD_NODE_INIT (struct sched_domain) { \ |
| 44 | .span = CPU_MASK_NONE, \ | 34 | .span = CPU_MASK_NONE, \ |
diff --git a/include/asm-ppc64/udbg.h b/include/asm-powerpc/udbg.h index e3b927991851..a383383bc4d4 100644 --- a/include/asm-ppc64/udbg.h +++ b/include/asm-powerpc/udbg.h | |||
| @@ -1,9 +1,3 @@ | |||
| 1 | #ifndef __UDBG_HDR | ||
| 2 | #define __UDBG_HDR | ||
| 3 | |||
| 4 | #include <linux/compiler.h> | ||
| 5 | #include <linux/init.h> | ||
| 6 | |||
| 7 | /* | 1 | /* |
| 8 | * c 2001 PPC 64 Team, IBM Corp | 2 | * c 2001 PPC 64 Team, IBM Corp |
| 9 | * | 3 | * |
| @@ -13,6 +7,12 @@ | |||
| 13 | * 2 of the License, or (at your option) any later version. | 7 | * 2 of the License, or (at your option) any later version. |
| 14 | */ | 8 | */ |
| 15 | 9 | ||
| 10 | #ifndef _ASM_POWERPC_UDBG_H | ||
| 11 | #define _ASM_POWERPC_UDBG_H | ||
| 12 | |||
| 13 | #include <linux/compiler.h> | ||
| 14 | #include <linux/init.h> | ||
| 15 | |||
| 16 | extern void (*udbg_putc)(unsigned char c); | 16 | extern void (*udbg_putc)(unsigned char c); |
| 17 | extern unsigned char (*udbg_getc)(void); | 17 | extern unsigned char (*udbg_getc)(void); |
| 18 | extern int (*udbg_getc_poll)(void); | 18 | extern int (*udbg_getc_poll)(void); |
| @@ -28,4 +28,4 @@ extern void udbg_init_uart(void __iomem *comport, unsigned int speed); | |||
| 28 | 28 | ||
| 29 | struct device_node; | 29 | struct device_node; |
| 30 | extern void udbg_init_scc(struct device_node *np); | 30 | extern void udbg_init_scc(struct device_node *np); |
| 31 | #endif | 31 | #endif /* _ASM_POWERPC_UDBG_H */ |
diff --git a/include/asm-ppc64/vdso.h b/include/asm-powerpc/vdso.h index 85d8a7be25c4..85d8a7be25c4 100644 --- a/include/asm-ppc64/vdso.h +++ b/include/asm-powerpc/vdso.h | |||
diff --git a/include/asm-powerpc/vdso_datapage.h b/include/asm-powerpc/vdso_datapage.h new file mode 100644 index 000000000000..fc323b51366b --- /dev/null +++ b/include/asm-powerpc/vdso_datapage.h | |||
| @@ -0,0 +1,108 @@ | |||
| 1 | #ifndef _VDSO_DATAPAGE_H | ||
| 2 | #define _VDSO_DATAPAGE_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | * Copyright (C) 2002 Peter Bergner <bergner@vnet.ibm.com>, IBM | ||
| 6 | * Copyright (C) 2005 Benjamin Herrenschmidy <benh@kernel.crashing.org>, | ||
| 7 | * IBM Corp. | ||
| 8 | * | ||
| 9 | * This program is free software; you can redistribute it and/or | ||
| 10 | * modify it under the terms of the GNU General Public License | ||
| 11 | * as published by the Free Software Foundation; either version | ||
| 12 | * 2 of the License, or (at your option) any later version. | ||
| 13 | */ | ||
| 14 | |||
| 15 | |||
| 16 | /* | ||
| 17 | * Note about this structure: | ||
| 18 | * | ||
| 19 | * This structure was historically called systemcfg and exposed to | ||
| 20 | * userland via /proc/ppc64/systemcfg. Unfortunately, this became an | ||
| 21 | * ABI issue as some proprietary software started relying on being able | ||
| 22 | * to mmap() it, thus we have to keep the base layout at least for a | ||
| 23 | * few kernel versions. | ||
| 24 | * | ||
| 25 | * However, since ppc32 doesn't suffer from this backward handicap, | ||
| 26 | * a simpler version of the data structure is used there with only the | ||
| 27 | * fields actually used by the vDSO. | ||
| 28 | * | ||
| 29 | */ | ||
| 30 | |||
| 31 | /* | ||
| 32 | * If the major version changes we are incompatible. | ||
| 33 | * Minor version changes are a hint. | ||
| 34 | */ | ||
| 35 | #define SYSTEMCFG_MAJOR 1 | ||
| 36 | #define SYSTEMCFG_MINOR 1 | ||
| 37 | |||
| 38 | #ifndef __ASSEMBLY__ | ||
| 39 | |||
| 40 | #include <linux/unistd.h> | ||
| 41 | |||
| 42 | #define SYSCALL_MAP_SIZE ((__NR_syscalls + 31) / 32) | ||
| 43 | |||
| 44 | /* | ||
| 45 | * So here is the ppc64 backward compatible version | ||
| 46 | */ | ||
| 47 | |||
| 48 | #ifdef CONFIG_PPC64 | ||
| 49 | |||
| 50 | struct vdso_data { | ||
| 51 | __u8 eye_catcher[16]; /* Eyecatcher: SYSTEMCFG:PPC64 0x00 */ | ||
| 52 | struct { /* Systemcfg version numbers */ | ||
| 53 | __u32 major; /* Major number 0x10 */ | ||
| 54 | __u32 minor; /* Minor number 0x14 */ | ||
| 55 | } version; | ||
| 56 | |||
| 57 | __u32 platform; /* Platform flags 0x18 */ | ||
| 58 | __u32 processor; /* Processor type 0x1C */ | ||
| 59 | __u64 processorCount; /* # of physical processors 0x20 */ | ||
| 60 | __u64 physicalMemorySize; /* Size of real memory(B) 0x28 */ | ||
| 61 | __u64 tb_orig_stamp; /* Timebase at boot 0x30 */ | ||
| 62 | __u64 tb_ticks_per_sec; /* Timebase tics / sec 0x38 */ | ||
| 63 | __u64 tb_to_xs; /* Inverse of TB to 2^20 0x40 */ | ||
| 64 | __u64 stamp_xsec; /* 0x48 */ | ||
| 65 | __u64 tb_update_count; /* Timebase atomicity ctr 0x50 */ | ||
| 66 | __u32 tz_minuteswest; /* Minutes west of Greenwich 0x58 */ | ||
| 67 | __u32 tz_dsttime; /* Type of dst correction 0x5C */ | ||
| 68 | __u32 dcache_size; /* L1 d-cache size 0x60 */ | ||
| 69 | __u32 dcache_line_size; /* L1 d-cache line size 0x64 */ | ||
| 70 | __u32 icache_size; /* L1 i-cache size 0x68 */ | ||
| 71 | __u32 icache_line_size; /* L1 i-cache line size 0x6C */ | ||
| 72 | |||
| 73 | /* those additional ones don't have to be located anywhere | ||
| 74 | * special as they were not part of the original systemcfg | ||
| 75 | */ | ||
| 76 | __s64 wtom_clock_sec; /* Wall to monotonic clock */ | ||
| 77 | __s32 wtom_clock_nsec; | ||
| 78 | __u32 syscall_map_64[SYSCALL_MAP_SIZE]; /* map of syscalls */ | ||
| 79 | __u32 syscall_map_32[SYSCALL_MAP_SIZE]; /* map of syscalls */ | ||
| 80 | }; | ||
| 81 | |||
| 82 | #else /* CONFIG_PPC64 */ | ||
| 83 | |||
| 84 | /* | ||
| 85 | * And here is the simpler 32 bits version | ||
| 86 | */ | ||
| 87 | struct vdso_data { | ||
| 88 | __u64 tb_orig_stamp; /* Timebase at boot 0x30 */ | ||
| 89 | __u64 tb_ticks_per_sec; /* Timebase tics / sec 0x38 */ | ||
| 90 | __u64 tb_to_xs; /* Inverse of TB to 2^20 0x40 */ | ||
| 91 | __u64 stamp_xsec; /* 0x48 */ | ||
| 92 | __u32 tb_update_count; /* Timebase atomicity ctr 0x50 */ | ||
| 93 | __u32 tz_minuteswest; /* Minutes west of Greenwich 0x58 */ | ||
| 94 | __u32 tz_dsttime; /* Type of dst correction 0x5C */ | ||
| 95 | __s32 wtom_clock_sec; /* Wall to monotonic clock */ | ||
| 96 | __s32 wtom_clock_nsec; | ||
| 97 | __u32 syscall_map_32[SYSCALL_MAP_SIZE]; /* map of syscalls */ | ||
| 98 | }; | ||
| 99 | |||
| 100 | #endif /* CONFIG_PPC64 */ | ||
| 101 | |||
| 102 | #ifdef __KERNEL__ | ||
| 103 | extern struct vdso_data *vdso_data; | ||
| 104 | #endif | ||
| 105 | |||
| 106 | #endif /* __ASSEMBLY__ */ | ||
| 107 | |||
| 108 | #endif /* _SYSTEMCFG_H */ | ||
diff --git a/include/asm-ppc/page.h b/include/asm-ppc/page.h index fc44f7ca62d7..538e0c8ab243 100644 --- a/include/asm-ppc/page.h +++ b/include/asm-ppc/page.h | |||
| @@ -1,9 +1,12 @@ | |||
| 1 | #ifndef _PPC_PAGE_H | 1 | #ifndef _PPC_PAGE_H |
| 2 | #define _PPC_PAGE_H | 2 | #define _PPC_PAGE_H |
| 3 | 3 | ||
| 4 | #include <linux/config.h> | ||
| 5 | #include <asm/asm-compat.h> | ||
| 6 | |||
| 4 | /* PAGE_SHIFT determines the page size */ | 7 | /* PAGE_SHIFT determines the page size */ |
| 5 | #define PAGE_SHIFT 12 | 8 | #define PAGE_SHIFT 12 |
| 6 | #define PAGE_SIZE (1UL << PAGE_SHIFT) | 9 | #define PAGE_SIZE (ASM_CONST(1) << PAGE_SHIFT) |
| 7 | 10 | ||
| 8 | /* | 11 | /* |
| 9 | * Subtle: this is an int (not an unsigned long) and so it | 12 | * Subtle: this is an int (not an unsigned long) and so it |
| @@ -169,5 +172,8 @@ extern __inline__ int get_order(unsigned long size) | |||
| 169 | #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ | 172 | #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ |
| 170 | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) | 173 | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) |
| 171 | 174 | ||
| 175 | /* We do define AT_SYSINFO_EHDR but don't use the gate mecanism */ | ||
| 176 | #define __HAVE_ARCH_GATE_AREA 1 | ||
| 177 | |||
| 172 | #endif /* __KERNEL__ */ | 178 | #endif /* __KERNEL__ */ |
| 173 | #endif /* _PPC_PAGE_H */ | 179 | #endif /* _PPC_PAGE_H */ |
diff --git a/include/asm-ppc64/mmzone.h b/include/asm-ppc64/mmzone.h index 15e777ce0f4a..54958d6cae04 100644 --- a/include/asm-ppc64/mmzone.h +++ b/include/asm-ppc64/mmzone.h | |||
| @@ -8,15 +8,14 @@ | |||
| 8 | #define _ASM_MMZONE_H_ | 8 | #define _ASM_MMZONE_H_ |
| 9 | 9 | ||
| 10 | #include <linux/config.h> | 10 | #include <linux/config.h> |
| 11 | #include <asm/smp.h> | ||
| 12 | 11 | ||
| 13 | /* generic non-linear memory support: | 12 | /* |
| 13 | * generic non-linear memory support: | ||
| 14 | * | 14 | * |
| 15 | * 1) we will not split memory into more chunks than will fit into the | 15 | * 1) we will not split memory into more chunks than will fit into the |
| 16 | * flags field of the struct page | 16 | * flags field of the struct page |
| 17 | */ | 17 | */ |
| 18 | 18 | ||
| 19 | |||
| 20 | #ifdef CONFIG_NEED_MULTIPLE_NODES | 19 | #ifdef CONFIG_NEED_MULTIPLE_NODES |
| 21 | 20 | ||
| 22 | extern struct pglist_data *node_data[]; | 21 | extern struct pglist_data *node_data[]; |
| @@ -30,44 +29,11 @@ extern struct pglist_data *node_data[]; | |||
| 30 | */ | 29 | */ |
| 31 | 30 | ||
| 32 | extern int numa_cpu_lookup_table[]; | 31 | extern int numa_cpu_lookup_table[]; |
| 33 | extern char *numa_memory_lookup_table; | ||
| 34 | extern cpumask_t numa_cpumask_lookup_table[]; | 32 | extern cpumask_t numa_cpumask_lookup_table[]; |
| 35 | extern int nr_cpus_in_node[]; | ||
| 36 | #ifdef CONFIG_MEMORY_HOTPLUG | 33 | #ifdef CONFIG_MEMORY_HOTPLUG |
| 37 | extern unsigned long max_pfn; | 34 | extern unsigned long max_pfn; |
| 38 | #endif | 35 | #endif |
| 39 | 36 | ||
| 40 | /* 16MB regions */ | ||
| 41 | #define MEMORY_INCREMENT_SHIFT 24 | ||
| 42 | #define MEMORY_INCREMENT (1UL << MEMORY_INCREMENT_SHIFT) | ||
| 43 | |||
| 44 | /* NUMA debugging, will not work on a DLPAR machine */ | ||
| 45 | #undef DEBUG_NUMA | ||
| 46 | |||
| 47 | static inline int pa_to_nid(unsigned long pa) | ||
| 48 | { | ||
| 49 | int nid; | ||
| 50 | |||
| 51 | #ifdef CONFIG_MEMORY_HOTPLUG | ||
| 52 | /* kludge hot added sections default to node 0 */ | ||
| 53 | if (pa >= (max_pfn << PAGE_SHIFT)) | ||
| 54 | return 0; | ||
| 55 | #endif | ||
| 56 | nid = numa_memory_lookup_table[pa >> MEMORY_INCREMENT_SHIFT]; | ||
| 57 | |||
| 58 | #ifdef DEBUG_NUMA | ||
| 59 | /* the physical address passed in is not in the map for the system */ | ||
| 60 | if (nid == -1) { | ||
| 61 | printk("bad address: %lx\n", pa); | ||
| 62 | BUG(); | ||
| 63 | } | ||
| 64 | #endif | ||
| 65 | |||
| 66 | return nid; | ||
| 67 | } | ||
| 68 | |||
| 69 | #define node_localnr(pfn, nid) ((pfn) - NODE_DATA(nid)->node_start_pfn) | ||
| 70 | |||
| 71 | /* | 37 | /* |
| 72 | * Following are macros that each numa implmentation must define. | 38 | * Following are macros that each numa implmentation must define. |
| 73 | */ | 39 | */ |
| @@ -75,39 +41,10 @@ static inline int pa_to_nid(unsigned long pa) | |||
| 75 | #define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn) | 41 | #define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn) |
| 76 | #define node_end_pfn(nid) (NODE_DATA(nid)->node_end_pfn) | 42 | #define node_end_pfn(nid) (NODE_DATA(nid)->node_end_pfn) |
| 77 | 43 | ||
| 78 | #ifdef CONFIG_DISCONTIGMEM | ||
| 79 | |||
| 80 | /* | ||
| 81 | * Given a kernel address, find the home node of the underlying memory. | ||
| 82 | */ | ||
| 83 | #define kvaddr_to_nid(kaddr) pa_to_nid(__pa(kaddr)) | ||
| 84 | |||
| 85 | #define pfn_to_nid(pfn) pa_to_nid((unsigned long)(pfn) << PAGE_SHIFT) | ||
| 86 | |||
| 87 | /* Written this way to avoid evaluating arguments twice */ | ||
| 88 | #define discontigmem_pfn_to_page(pfn) \ | ||
| 89 | ({ \ | ||
| 90 | unsigned long __tmp = pfn; \ | ||
| 91 | (NODE_DATA(pfn_to_nid(__tmp))->node_mem_map + \ | ||
| 92 | node_localnr(__tmp, pfn_to_nid(__tmp))); \ | ||
| 93 | }) | ||
| 94 | |||
| 95 | #define discontigmem_page_to_pfn(p) \ | ||
| 96 | ({ \ | ||
| 97 | struct page *__tmp = p; \ | ||
| 98 | (((__tmp) - page_zone(__tmp)->zone_mem_map) + \ | ||
| 99 | page_zone(__tmp)->zone_start_pfn); \ | ||
| 100 | }) | ||
| 101 | |||
| 102 | /* XXX fix for discontiguous physical memory */ | ||
| 103 | #define discontigmem_pfn_valid(pfn) ((pfn) < num_physpages) | ||
| 104 | |||
| 105 | #endif /* CONFIG_DISCONTIGMEM */ | ||
| 106 | |||
| 107 | #endif /* CONFIG_NEED_MULTIPLE_NODES */ | 44 | #endif /* CONFIG_NEED_MULTIPLE_NODES */ |
| 108 | 45 | ||
| 109 | #ifdef CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID | 46 | #ifdef CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID |
| 110 | #define early_pfn_to_nid(pfn) pa_to_nid(((unsigned long)pfn) << PAGE_SHIFT) | 47 | extern int __init early_pfn_to_nid(unsigned long pfn); |
| 111 | #endif | 48 | #endif |
| 112 | 49 | ||
| 113 | #endif /* _ASM_MMZONE_H_ */ | 50 | #endif /* _ASM_MMZONE_H_ */ |
diff --git a/include/asm-ppc64/page.h b/include/asm-ppc64/page.h index e32f1187aa29..3efc3288f7e9 100644 --- a/include/asm-ppc64/page.h +++ b/include/asm-ppc64/page.h | |||
| @@ -279,11 +279,6 @@ extern u64 ppc64_pft_size; /* Log 2 of page table size */ | |||
| 279 | 279 | ||
| 280 | #define __va(x) ((void *)((unsigned long)(x) + KERNELBASE)) | 280 | #define __va(x) ((void *)((unsigned long)(x) + KERNELBASE)) |
| 281 | 281 | ||
| 282 | #ifdef CONFIG_DISCONTIGMEM | ||
| 283 | #define page_to_pfn(page) discontigmem_page_to_pfn(page) | ||
| 284 | #define pfn_to_page(pfn) discontigmem_pfn_to_page(pfn) | ||
| 285 | #define pfn_valid(pfn) discontigmem_pfn_valid(pfn) | ||
| 286 | #endif | ||
| 287 | #ifdef CONFIG_FLATMEM | 282 | #ifdef CONFIG_FLATMEM |
| 288 | #define pfn_to_page(pfn) (mem_map + (pfn)) | 283 | #define pfn_to_page(pfn) (mem_map + (pfn)) |
| 289 | #define page_to_pfn(page) ((unsigned long)((page) - mem_map)) | 284 | #define page_to_pfn(page) ((unsigned long)((page) - mem_map)) |
diff --git a/include/linux/libata.h b/include/linux/libata.h index 6f0752219f64..1464a7586de8 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
| @@ -29,6 +29,7 @@ | |||
| 29 | #include <linux/delay.h> | 29 | #include <linux/delay.h> |
| 30 | #include <linux/interrupt.h> | 30 | #include <linux/interrupt.h> |
| 31 | #include <linux/pci.h> | 31 | #include <linux/pci.h> |
| 32 | #include <linux/dma-mapping.h> | ||
| 32 | #include <asm/io.h> | 33 | #include <asm/io.h> |
| 33 | #include <linux/ata.h> | 34 | #include <linux/ata.h> |
| 34 | #include <linux/workqueue.h> | 35 | #include <linux/workqueue.h> |
| @@ -404,6 +405,7 @@ struct ata_port_info { | |||
| 404 | unsigned long mwdma_mask; | 405 | unsigned long mwdma_mask; |
| 405 | unsigned long udma_mask; | 406 | unsigned long udma_mask; |
| 406 | const struct ata_port_operations *port_ops; | 407 | const struct ata_port_operations *port_ops; |
| 408 | void *private_data; | ||
| 407 | }; | 409 | }; |
| 408 | 410 | ||
| 409 | struct ata_timing { | 411 | struct ata_timing { |
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index 1a165b7ae01b..17e336f40b47 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h | |||
| @@ -43,4 +43,19 @@ extern int platform_device_add_data(struct platform_device *pdev, void *data, si | |||
| 43 | extern int platform_device_add(struct platform_device *pdev); | 43 | extern int platform_device_add(struct platform_device *pdev); |
| 44 | extern void platform_device_put(struct platform_device *pdev); | 44 | extern void platform_device_put(struct platform_device *pdev); |
| 45 | 45 | ||
| 46 | struct platform_driver { | ||
| 47 | int (*probe)(struct platform_device *); | ||
| 48 | int (*remove)(struct platform_device *); | ||
| 49 | void (*shutdown)(struct platform_device *); | ||
| 50 | int (*suspend)(struct platform_device *, pm_message_t state); | ||
| 51 | int (*resume)(struct platform_device *); | ||
| 52 | struct device_driver driver; | ||
| 53 | }; | ||
| 54 | |||
| 55 | extern int platform_driver_register(struct platform_driver *); | ||
| 56 | extern void platform_driver_unregister(struct platform_driver *); | ||
| 57 | |||
| 58 | #define platform_get_drvdata(_dev) dev_get_drvdata(&(_dev)->dev) | ||
| 59 | #define platform_set_drvdata(_dev,data) dev_set_drvdata(&(_dev)->dev, (data)) | ||
| 60 | |||
| 46 | #endif /* _PLATFORM_DEVICE_H_ */ | 61 | #endif /* _PLATFORM_DEVICE_H_ */ |
diff --git a/net/ipv4/tcp_vegas.c b/net/ipv4/tcp_vegas.c index 4376814d29fb..b7d296a8ac6d 100644 --- a/net/ipv4/tcp_vegas.c +++ b/net/ipv4/tcp_vegas.c | |||
| @@ -236,7 +236,7 @@ static void tcp_vegas_cong_avoid(struct sock *sk, u32 ack, | |||
| 236 | /* We don't have enough RTT samples to do the Vegas | 236 | /* We don't have enough RTT samples to do the Vegas |
| 237 | * calculation, so we'll behave like Reno. | 237 | * calculation, so we'll behave like Reno. |
| 238 | */ | 238 | */ |
| 239 | tcp_reno_cong_avoid(sk, ack, seq_rtt, in_flight, cnt); | 239 | tcp_reno_cong_avoid(sk, ack, seq_rtt, in_flight, flag); |
| 240 | } else { | 240 | } else { |
| 241 | u32 rtt, target_cwnd, diff; | 241 | u32 rtt, target_cwnd, diff; |
| 242 | 242 | ||
diff --git a/sound/arm/pxa2xx-ac97.c b/sound/arm/pxa2xx-ac97.c index d1f9da498729..c96c8a2aa1c2 100644 --- a/sound/arm/pxa2xx-ac97.c +++ b/sound/arm/pxa2xx-ac97.c | |||
| @@ -275,9 +275,9 @@ static int pxa2xx_ac97_do_resume(snd_card_t *card) | |||
| 275 | return 0; | 275 | return 0; |
| 276 | } | 276 | } |
| 277 | 277 | ||
| 278 | static int pxa2xx_ac97_suspend(struct device *_dev, pm_message_t state) | 278 | static int pxa2xx_ac97_suspend(struct platform_device *dev, pm_message_t state) |
| 279 | { | 279 | { |
| 280 | snd_card_t *card = dev_get_drvdata(_dev); | 280 | snd_card_t *card = platform_get_drvdata(dev); |
| 281 | int ret = 0; | 281 | int ret = 0; |
| 282 | 282 | ||
| 283 | if (card) | 283 | if (card) |
| @@ -286,9 +286,9 @@ static int pxa2xx_ac97_suspend(struct device *_dev, pm_message_t state) | |||
| 286 | return ret; | 286 | return ret; |
| 287 | } | 287 | } |
| 288 | 288 | ||
| 289 | static int pxa2xx_ac97_resume(struct device *_dev) | 289 | static int pxa2xx_ac97_resume(struct platform_device *dev) |
| 290 | { | 290 | { |
| 291 | snd_card_t *card = dev_get_drvdata(_dev); | 291 | snd_card_t *card = platform_get_drvdata(dev); |
| 292 | int ret = 0; | 292 | int ret = 0; |
| 293 | 293 | ||
| 294 | if (card) | 294 | if (card) |
| @@ -302,7 +302,7 @@ static int pxa2xx_ac97_resume(struct device *_dev) | |||
| 302 | #define pxa2xx_ac97_resume NULL | 302 | #define pxa2xx_ac97_resume NULL |
| 303 | #endif | 303 | #endif |
| 304 | 304 | ||
| 305 | static int pxa2xx_ac97_probe(struct device *dev) | 305 | static int pxa2xx_ac97_probe(struct platform_device *dev) |
| 306 | { | 306 | { |
| 307 | snd_card_t *card; | 307 | snd_card_t *card; |
| 308 | ac97_bus_t *ac97_bus; | 308 | ac97_bus_t *ac97_bus; |
| @@ -315,8 +315,8 @@ static int pxa2xx_ac97_probe(struct device *dev) | |||
| 315 | if (!card) | 315 | if (!card) |
| 316 | goto err; | 316 | goto err; |
| 317 | 317 | ||
| 318 | card->dev = dev; | 318 | card->dev = &dev->dev; |
| 319 | strncpy(card->driver, dev->driver->name, sizeof(card->driver)); | 319 | strncpy(card->driver, dev->dev.driver->name, sizeof(card->driver)); |
| 320 | 320 | ||
| 321 | ret = pxa2xx_pcm_new(card, &pxa2xx_ac97_pcm_client, &pxa2xx_ac97_pcm); | 321 | ret = pxa2xx_pcm_new(card, &pxa2xx_ac97_pcm_client, &pxa2xx_ac97_pcm); |
| 322 | if (ret) | 322 | if (ret) |
| @@ -347,13 +347,13 @@ static int pxa2xx_ac97_probe(struct device *dev) | |||
| 347 | snprintf(card->shortname, sizeof(card->shortname), | 347 | snprintf(card->shortname, sizeof(card->shortname), |
| 348 | "%s", snd_ac97_get_short_name(pxa2xx_ac97_ac97)); | 348 | "%s", snd_ac97_get_short_name(pxa2xx_ac97_ac97)); |
| 349 | snprintf(card->longname, sizeof(card->longname), | 349 | snprintf(card->longname, sizeof(card->longname), |
| 350 | "%s (%s)", dev->driver->name, card->mixername); | 350 | "%s (%s)", dev->dev.driver->name, card->mixername); |
| 351 | 351 | ||
| 352 | snd_card_set_pm_callback(card, pxa2xx_ac97_do_suspend, | 352 | snd_card_set_pm_callback(card, pxa2xx_ac97_do_suspend, |
| 353 | pxa2xx_ac97_do_resume, NULL); | 353 | pxa2xx_ac97_do_resume, NULL); |
| 354 | ret = snd_card_register(card); | 354 | ret = snd_card_register(card); |
| 355 | if (ret == 0) { | 355 | if (ret == 0) { |
| 356 | dev_set_drvdata(dev, card); | 356 | platform_set_drvdata(dev, card); |
| 357 | return 0; | 357 | return 0; |
| 358 | } | 358 | } |
| 359 | 359 | ||
| @@ -368,13 +368,13 @@ static int pxa2xx_ac97_probe(struct device *dev) | |||
| 368 | return ret; | 368 | return ret; |
| 369 | } | 369 | } |
| 370 | 370 | ||
| 371 | static int pxa2xx_ac97_remove(struct device *dev) | 371 | static int pxa2xx_ac97_remove(struct platform_device *dev) |
| 372 | { | 372 | { |
| 373 | snd_card_t *card = dev_get_drvdata(dev); | 373 | snd_card_t *card = platform_get_drvdata(dev); |
| 374 | 374 | ||
| 375 | if (card) { | 375 | if (card) { |
| 376 | snd_card_free(card); | 376 | snd_card_free(card); |
| 377 | dev_set_drvdata(dev, NULL); | 377 | platform_set_drvdata(dev, NULL); |
| 378 | GCR |= GCR_ACLINK_OFF; | 378 | GCR |= GCR_ACLINK_OFF; |
| 379 | free_irq(IRQ_AC97, NULL); | 379 | free_irq(IRQ_AC97, NULL); |
| 380 | pxa_set_cken(CKEN2_AC97, 0); | 380 | pxa_set_cken(CKEN2_AC97, 0); |
| @@ -383,23 +383,24 @@ static int pxa2xx_ac97_remove(struct device *dev) | |||
| 383 | return 0; | 383 | return 0; |
| 384 | } | 384 | } |
| 385 | 385 | ||
| 386 | static struct device_driver pxa2xx_ac97_driver = { | 386 | static struct platform_driver pxa2xx_ac97_driver = { |
| 387 | .name = "pxa2xx-ac97", | ||
| 388 | .bus = &platform_bus_type, | ||
| 389 | .probe = pxa2xx_ac97_probe, | 387 | .probe = pxa2xx_ac97_probe, |
| 390 | .remove = pxa2xx_ac97_remove, | 388 | .remove = pxa2xx_ac97_remove, |
| 391 | .suspend = pxa2xx_ac97_suspend, | 389 | .suspend = pxa2xx_ac97_suspend, |
| 392 | .resume = pxa2xx_ac97_resume, | 390 | .resume = pxa2xx_ac97_resume, |
| 391 | .driver = { | ||
| 392 | .name = "pxa2xx-ac97", | ||
| 393 | }, | ||
| 393 | }; | 394 | }; |
| 394 | 395 | ||
| 395 | static int __init pxa2xx_ac97_init(void) | 396 | static int __init pxa2xx_ac97_init(void) |
| 396 | { | 397 | { |
| 397 | return driver_register(&pxa2xx_ac97_driver); | 398 | return platform_driver_register(&pxa2xx_ac97_driver); |
| 398 | } | 399 | } |
| 399 | 400 | ||
| 400 | static void __exit pxa2xx_ac97_exit(void) | 401 | static void __exit pxa2xx_ac97_exit(void) |
| 401 | { | 402 | { |
| 402 | driver_unregister(&pxa2xx_ac97_driver); | 403 | platform_driver_unregister(&pxa2xx_ac97_driver); |
| 403 | } | 404 | } |
| 404 | 405 | ||
| 405 | module_init(pxa2xx_ac97_init); | 406 | module_init(pxa2xx_ac97_init); |
diff --git a/sound/core/init.c b/sound/core/init.c index d9ee27ae9a51..33813f92ab52 100644 --- a/sound/core/init.c +++ b/sound/core/init.c | |||
| @@ -674,23 +674,24 @@ struct snd_generic_device { | |||
| 674 | snd_card_t *card; | 674 | snd_card_t *card; |
| 675 | }; | 675 | }; |
| 676 | 676 | ||
| 677 | #define get_snd_generic_card(dev) container_of(to_platform_device(dev), struct snd_generic_device, pdev)->card | 677 | #define get_snd_generic_card(dev) container_of(dev, struct snd_generic_device, pdev)->card |
| 678 | 678 | ||
| 679 | #define SND_GENERIC_NAME "snd_generic" | 679 | #define SND_GENERIC_NAME "snd_generic" |
| 680 | 680 | ||
| 681 | #ifdef CONFIG_PM | 681 | #ifdef CONFIG_PM |
| 682 | static int snd_generic_suspend(struct device *dev, pm_message_t state); | 682 | static int snd_generic_suspend(struct platform_device *dev, pm_message_t state); |
| 683 | static int snd_generic_resume(struct device *dev); | 683 | static int snd_generic_resume(struct platform_device *dev); |
| 684 | #endif | 684 | #endif |
| 685 | 685 | ||
| 686 | /* initialized in sound.c */ | 686 | /* initialized in sound.c */ |
| 687 | struct device_driver snd_generic_driver = { | 687 | struct platform_driver snd_generic_driver = { |
| 688 | .name = SND_GENERIC_NAME, | ||
| 689 | .bus = &platform_bus_type, | ||
| 690 | #ifdef CONFIG_PM | 688 | #ifdef CONFIG_PM |
| 691 | .suspend = snd_generic_suspend, | 689 | .suspend = snd_generic_suspend, |
| 692 | .resume = snd_generic_resume, | 690 | .resume = snd_generic_resume, |
| 693 | #endif | 691 | #endif |
| 692 | .driver = { | ||
| 693 | .name = SND_GENERIC_NAME, | ||
| 694 | }, | ||
| 694 | }; | 695 | }; |
| 695 | 696 | ||
| 696 | void snd_generic_device_release(struct device *dev) | 697 | void snd_generic_device_release(struct device *dev) |
| @@ -821,7 +822,7 @@ int snd_card_set_pm_callback(snd_card_t *card, | |||
| 821 | 822 | ||
| 822 | #ifdef CONFIG_SND_GENERIC_DRIVER | 823 | #ifdef CONFIG_SND_GENERIC_DRIVER |
| 823 | /* suspend/resume callbacks for snd_generic platform device */ | 824 | /* suspend/resume callbacks for snd_generic platform device */ |
| 824 | static int snd_generic_suspend(struct device *dev, pm_message_t state) | 825 | static int snd_generic_suspend(struct platform_device *dev, pm_message_t state) |
| 825 | { | 826 | { |
| 826 | snd_card_t *card; | 827 | snd_card_t *card; |
| 827 | 828 | ||
| @@ -834,7 +835,7 @@ static int snd_generic_suspend(struct device *dev, pm_message_t state) | |||
| 834 | return 0; | 835 | return 0; |
| 835 | } | 836 | } |
| 836 | 837 | ||
| 837 | static int snd_generic_resume(struct device *dev) | 838 | static int snd_generic_resume(struct platform_device *dev) |
| 838 | { | 839 | { |
| 839 | snd_card_t *card; | 840 | snd_card_t *card; |
| 840 | 841 | ||
diff --git a/sound/core/sound.c b/sound/core/sound.c index 1139dd8ca8eb..6e7cad1e947e 100644 --- a/sound/core/sound.c +++ b/sound/core/sound.c | |||
| @@ -32,7 +32,7 @@ | |||
| 32 | #include <sound/initval.h> | 32 | #include <sound/initval.h> |
| 33 | #include <linux/kmod.h> | 33 | #include <linux/kmod.h> |
| 34 | #include <linux/devfs_fs_kernel.h> | 34 | #include <linux/devfs_fs_kernel.h> |
| 35 | #include <linux/device.h> | 35 | #include <linux/platform_device.h> |
| 36 | 36 | ||
| 37 | #define SNDRV_OS_MINORS 256 | 37 | #define SNDRV_OS_MINORS 256 |
| 38 | 38 | ||
| @@ -329,7 +329,7 @@ int __exit snd_minor_info_done(void) | |||
| 329 | */ | 329 | */ |
| 330 | 330 | ||
| 331 | #ifdef CONFIG_SND_GENERIC_DRIVER | 331 | #ifdef CONFIG_SND_GENERIC_DRIVER |
| 332 | extern struct device_driver snd_generic_driver; | 332 | extern struct platform_driver snd_generic_driver; |
| 333 | #endif | 333 | #endif |
| 334 | 334 | ||
| 335 | static int __init alsa_sound_init(void) | 335 | static int __init alsa_sound_init(void) |
| @@ -357,7 +357,7 @@ static int __init alsa_sound_init(void) | |||
| 357 | } | 357 | } |
| 358 | snd_info_minor_register(); | 358 | snd_info_minor_register(); |
| 359 | #ifdef CONFIG_SND_GENERIC_DRIVER | 359 | #ifdef CONFIG_SND_GENERIC_DRIVER |
| 360 | driver_register(&snd_generic_driver); | 360 | platform_driver_register(&snd_generic_driver); |
| 361 | #endif | 361 | #endif |
| 362 | for (controlnum = 0; controlnum < cards_limit; controlnum++) | 362 | for (controlnum = 0; controlnum < cards_limit; controlnum++) |
| 363 | devfs_mk_cdev(MKDEV(major, controlnum<<5), S_IFCHR | device_mode, "snd/controlC%d", controlnum); | 363 | devfs_mk_cdev(MKDEV(major, controlnum<<5), S_IFCHR | device_mode, "snd/controlC%d", controlnum); |
| @@ -375,7 +375,7 @@ static void __exit alsa_sound_exit(void) | |||
| 375 | devfs_remove("snd/controlC%d", controlnum); | 375 | devfs_remove("snd/controlC%d", controlnum); |
| 376 | 376 | ||
| 377 | #ifdef CONFIG_SND_GENERIC_DRIVER | 377 | #ifdef CONFIG_SND_GENERIC_DRIVER |
| 378 | driver_unregister(&snd_generic_driver); | 378 | platform_driver_unregister(&snd_generic_driver); |
| 379 | #endif | 379 | #endif |
| 380 | snd_info_minor_unregister(); | 380 | snd_info_minor_unregister(); |
| 381 | snd_info_done(); | 381 | snd_info_done(); |
