aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2005-11-09 17:32:44 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2005-11-09 17:32:44 -0500
commit3ae5eaec1d2d9c0cf53745352e7d4b152810ba24 (patch)
treed8825be54cefb6ad6707478d719c8e30605bee7b /arch/arm
parent00d3dcdd96646be6059cc21f2efa94c4edc1eda5 (diff)
[DRIVER MODEL] Convert platform drivers to use struct platform_driver
This allows us to eliminate the casts in the drivers, and eventually remove the use of the device_driver function pointer methods for platform device drivers. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/common/locomo.c38
-rw-r--r--arch/arm/common/sa1111.c42
-rw-r--r--arch/arm/common/scoop.c30
-rw-r--r--arch/arm/mach-pxa/corgi_ssp.c17
-rw-r--r--arch/arm/mach-sa1100/neponset.c31
5 files changed, 80 insertions, 78 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
553static int locomo_suspend(struct device *dev, pm_message_t state) 553static 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
597static int locomo_resume(struct device *dev) 597static 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
763static int locomo_probe(struct device *dev) 763static 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
777static int locomo_remove(struct device *dev) 776static 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 */
795static struct device_driver locomo_device_driver = { 794static 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
1133static void __exit locomo_exit(void) 1133static 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
804static int sa1111_suspend(struct device *dev, pm_message_t state) 804static 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 */
862static int sa1111_resume(struct device *dev) 862static 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
925static int sa1111_probe(struct device *dev) 925static 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
939static int sa1111_remove(struct device *dev) 938static 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 */
965static struct device_driver sa1111_device_driver = { 964static 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
1263static void __exit sa1111_exit(void) 1263static 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
101static int scoop_suspend(struct device *dev, pm_message_t state) 101static 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
112static int scoop_resume(struct device *dev) 112static 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
126int __init scoop_probe(struct device *dev) 126int __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
167static int scoop_remove(struct device *dev) 166static 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
178static struct device_driver scoop_driver = { 177static 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
187int __init scoop_init(void) 187int __init scoop_init(void)
188{ 188{
189 return driver_register(&scoop_driver); 189 return platform_driver_register(&scoop_driver);
190} 190}
191 191
192subsys_initcall(scoop_init); 192subsys_initcall(scoop_init);
diff --git a/arch/arm/mach-pxa/corgi_ssp.c b/arch/arm/mach-pxa/corgi_ssp.c
index 591e5f32dbec..9f835f32b938 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
194static int __init corgi_ssp_probe(struct device *dev) 194static 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
219static int corgi_ssp_remove(struct device *dev) 219static 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
225static int corgi_ssp_suspend(struct device *dev, pm_message_t state) 225static 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
233static int corgi_ssp_resume(struct device *dev) 233static 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
244static struct device_driver corgissp_driver = { 244static 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
253int __init corgi_ssp_init(void) 254int __init corgi_ssp_init(void)
254{ 255{
255 return driver_register(&corgissp_driver); 256 return platform_driver_register(&corgissp_driver);
256} 257}
257 258
258arch_initcall(corgi_ssp_init); 259arch_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
140static int neponset_probe(struct device *dev) 140static 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 */
181static int neponset_suspend(struct device *dev, pm_message_t state) 181static 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
196static int neponset_resume(struct device *dev) 196static 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
212static struct device_driver neponset_device_driver = { 212static 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
220static struct resource neponset_resources[] = { 221static struct resource neponset_resources[] = {
@@ -293,7 +294,7 @@ static struct platform_device *devices[] __initdata = {
293 294
294static int __init neponset_init(void) 295static 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.