···2121#include <linux/init.h>2222#include <linux/platform_device.h>2323#include <linux/suspend.h>2424+#include <linux/sysdev.h>24252526#include <asm/hardware.h>2627#include <asm/arch/irqs.h>···166165167166 SLEEP_SAVE_PSTR,168167169169- SLEEP_SAVE_ICMR,170168 SLEEP_SAVE_CKEN,171169172170 SLEEP_SAVE_SIZE···184184 SAVE(GAFR1_L); SAVE(GAFR1_U);185185 SAVE(GAFR2_L); SAVE(GAFR2_U);186186187187- SAVE(ICMR); ICMR = 0;188187 SAVE(CKEN);189188 SAVE(PSTR);190189···209210 PSSR = PSSR_RDH | PSSR_PH;210211211212 RESTORE(CKEN);212212-213213- ICLR = 0;214214- ICCR = 1;215215- RESTORE(ICMR);216213 RESTORE(PSTR);217214}218215···299304 &pxa25x_device_assp,300305};301306307307+static struct sys_device pxa25x_sysdev[] = {308308+ {309309+ .cls = &pxa_irq_sysclass,310310+ },311311+};312312+302313static int __init pxa25x_init(void)303314{304304- int ret = 0;315315+ int i, ret = 0;305316306317 /* Only add HWUART for PXA255/26x; PXA210/250/27x do not have it. */307318 if (cpu_is_pxa25x())···321320322321 pxa25x_init_pm();323322323323+ for (i = 0; i < ARRAY_SIZE(pxa25x_sysdev); i++) {324324+ ret = sysdev_register(&pxa25x_sysdev[i]);325325+ if (ret)326326+ pr_err("failed to register sysdev[%d]\n", i);327327+ }328328+324329 ret = platform_add_devices(pxa25x_devices,325330 ARRAY_SIZE(pxa25x_devices));331331+ if (ret)332332+ return ret;326333 }334334+327335 /* Only add HWUART for PXA255/26x; PXA210/250/27x do not have it. */328336 if (cpu_is_pxa25x())329337 ret = platform_device_register(&pxa_device_hwuart);
+20-6
arch/arm/mach-pxa/pxa27x.c
···1616#include <linux/init.h>1717#include <linux/suspend.h>1818#include <linux/platform_device.h>1919+#include <linux/sysdev.h>19202021#include <asm/hardware.h>2122#include <asm/irq.h>···197196198197 SLEEP_SAVE_PSTR,199198200200- SLEEP_SAVE_ICMR,201199 SLEEP_SAVE_CKEN,202200203201 SLEEP_SAVE_MDREFR,···223223 SAVE(PWER); SAVE(PCFR); SAVE(PRER);224224 SAVE(PFER); SAVE(PKWR);225225226226- SAVE(ICMR); ICMR = 0;227226 SAVE(CKEN);228227 SAVE(PSTR);229228···255256256257 RESTORE(CKEN);257258258258- ICLR = 0;259259- ICCR = 1;260260- RESTORE(ICMR);261259 RESTORE(PSTR);262260}263261···405409 &pxa27x_device_ssp3,406410};407411412412+static struct sys_device pxa27x_sysdev[] = {413413+ {414414+ .id = 0,415415+ .cls = &pxa_irq_sysclass,416416+ }, {417417+ .id = 1,418418+ .cls = &pxa_irq_sysclass,419419+ },420420+};421421+408422static int __init pxa27x_init(void)409423{410410- int ret = 0;424424+ int i, ret = 0;425425+411426 if (cpu_is_pxa27x()) {412427 clks_register(pxa27x_clks, ARRAY_SIZE(pxa27x_clks));413428···427420428421 pxa27x_init_pm();429422423423+ for (i = 0; i < ARRAY_SIZE(pxa27x_sysdev); i++) {424424+ ret = sysdev_register(&pxa27x_sysdev[i]);425425+ if (ret)426426+ pr_err("failed to register sysdev[%d]\n", i);427427+ }428428+430429 ret = platform_add_devices(devices, ARRAY_SIZE(devices));431430 }431431+432432 return ret;433433}434434
+21-3
arch/arm/mach-pxa/pxa3xx.c
···2020#include <linux/platform_device.h>2121#include <linux/irq.h>2222#include <linux/io.h>2323+#include <linux/sysdev.h>23242425#include <asm/hardware.h>2526#include <asm/arch/pxa3xx-regs.h>···453452 &pxa3xx_device_ssp4,454453};455454455455+static struct sys_device pxa3xx_sysdev[] = {456456+ {457457+ .id = 0,458458+ .cls = &pxa_irq_sysclass,459459+ }, {460460+ .id = 1,461461+ .cls = &pxa_irq_sysclass,462462+ },463463+};464464+456465static int __init pxa3xx_init(void)457466{458458- int ret = 0;467467+ int i, ret = 0;459468460469 if (cpu_is_pxa3xx()) {461470 clks_register(pxa3xx_clks, ARRAY_SIZE(pxa3xx_clks));···475464476465 pxa3xx_init_pm();477466478478- return platform_add_devices(devices, ARRAY_SIZE(devices));467467+ for (i = 0; i < ARRAY_SIZE(pxa3xx_sysdev); i++) {468468+ ret = sysdev_register(&pxa3xx_sysdev[i]);469469+ if (ret)470470+ pr_err("failed to register sysdev[%d]\n", i);471471+ }472472+473473+ ret = platform_add_devices(devices, ARRAY_SIZE(devices));479474 }480480- return 0;475475+476476+ return ret;481477}482478483479subsys_initcall(pxa3xx_init);