Skip to content

Commit 7120438

Browse files
ndreysScott Wood
authored andcommitted
powerpc: Convert fsl_rstcr_restart to a reset handler
Convert fsl_rstcr_restart into a function to be registered with register_reset_handler(). Signed-off-by: Andrey Smirnov <[email protected]> [scottwood: Converted mvme7100 as well] Signed-off-by: Scott Wood <[email protected]>
1 parent ad24747 commit 7120438

33 files changed

+38
-67
lines changed

arch/powerpc/platforms/85xx/bsc913x_qds.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ define_machine(bsc9132_qds) {
7272
.pcibios_fixup_bus = fsl_pcibios_fixup_bus,
7373
#endif
7474
.get_irq = mpic_get_irq,
75-
.restart = fsl_rstcr_restart,
7675
.calibrate_decr = generic_calibrate_decr,
7776
.progress = udbg_progress,
7877
};

arch/powerpc/platforms/85xx/bsc913x_rdb.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ define_machine(bsc9131_rdb) {
5959
.setup_arch = bsc913x_rdb_setup_arch,
6060
.init_IRQ = bsc913x_rdb_pic_init,
6161
.get_irq = mpic_get_irq,
62-
.restart = fsl_rstcr_restart,
6362
.calibrate_decr = generic_calibrate_decr,
6463
.progress = udbg_progress,
6564
};

arch/powerpc/platforms/85xx/c293pcie.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ define_machine(c293_pcie) {
6565
.setup_arch = c293_pcie_setup_arch,
6666
.init_IRQ = c293_pcie_pic_init,
6767
.get_irq = mpic_get_irq,
68-
.restart = fsl_rstcr_restart,
6968
.calibrate_decr = generic_calibrate_decr,
7069
.progress = udbg_progress,
7170
};

arch/powerpc/platforms/85xx/corenet_generic.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,6 @@ define_machine(corenet_generic) {
225225
#else
226226
.get_irq = mpic_get_coreint_irq,
227227
#endif
228-
.restart = fsl_rstcr_restart,
229228
.calibrate_decr = generic_calibrate_decr,
230229
.progress = udbg_progress,
231230
#ifdef CONFIG_PPC64

arch/powerpc/platforms/85xx/ge_imp3a.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,6 @@ define_machine(ge_imp3a) {
215215
.pcibios_fixup_phb = fsl_pcibios_fixup_phb,
216216
#endif
217217
.get_irq = mpic_get_irq,
218-
.restart = fsl_rstcr_restart,
219218
.calibrate_decr = generic_calibrate_decr,
220219
.progress = udbg_progress,
221220
};

arch/powerpc/platforms/85xx/mpc8536_ds.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ define_machine(mpc8536_ds) {
7777
.pcibios_fixup_phb = fsl_pcibios_fixup_phb,
7878
#endif
7979
.get_irq = mpic_get_irq,
80-
.restart = fsl_rstcr_restart,
8180
.calibrate_decr = generic_calibrate_decr,
8281
.progress = udbg_progress,
8382
};

arch/powerpc/platforms/85xx/mpc85xx_ads.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ define_machine(mpc85xx_ads) {
170170
.init_IRQ = mpc85xx_ads_pic_init,
171171
.show_cpuinfo = mpc85xx_ads_show_cpuinfo,
172172
.get_irq = mpic_get_irq,
173-
.restart = fsl_rstcr_restart,
174173
.calibrate_decr = generic_calibrate_decr,
175174
.progress = udbg_progress,
176175
};

arch/powerpc/platforms/85xx/mpc85xx_cds.c

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ static int mpc85xx_exclude_device(struct pci_controller *hose,
8383
return PCIBIOS_SUCCESSFUL;
8484
}
8585

86-
static void __noreturn mpc85xx_cds_restart(char *cmd)
86+
static int mpc85xx_cds_restart(struct notifier_block *this,
87+
unsigned long mode, void *cmd)
8788
{
8889
struct pci_dev *dev;
8990
u_char tmp;
@@ -108,12 +109,25 @@ static void __noreturn mpc85xx_cds_restart(char *cmd)
108109
}
109110

110111
/*
111-
* If we can't find the VIA chip (maybe the P2P bridge is disabled)
112-
* or the VIA chip reset didn't work, just use the default reset.
112+
* If we can't find the VIA chip (maybe the P2P bridge is
113+
* disabled) or the VIA chip reset didn't work, just return
114+
* and let default reset sequence happen.
113115
*/
114-
fsl_rstcr_restart(NULL);
116+
return NOTIFY_DONE;
115117
}
116118

119+
static int mpc85xx_cds_restart_register(void)
120+
{
121+
static struct notifier_block restart_handler;
122+
123+
restart_handler.notifier_call = mpc85xx_cds_restart;
124+
restart_handler.priority = 192;
125+
126+
return register_restart_handler(&restart_handler);
127+
}
128+
machine_arch_initcall(mpc85xx_cds, mpc85xx_cds_restart_register);
129+
130+
117131
static void __init mpc85xx_cds_pci_irq_fixup(struct pci_dev *dev)
118132
{
119133
u_char c;
@@ -380,11 +394,8 @@ define_machine(mpc85xx_cds) {
380394
.show_cpuinfo = mpc85xx_cds_show_cpuinfo,
381395
.get_irq = mpic_get_irq,
382396
#ifdef CONFIG_PCI
383-
.restart = mpc85xx_cds_restart,
384397
.pcibios_fixup_bus = mpc85xx_cds_fixup_bus,
385398
.pcibios_fixup_phb = fsl_pcibios_fixup_phb,
386-
#else
387-
.restart = fsl_rstcr_restart,
388399
#endif
389400
.calibrate_decr = generic_calibrate_decr,
390401
.progress = udbg_progress,

arch/powerpc/platforms/85xx/mpc85xx_ds.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,6 @@ define_machine(mpc8544_ds) {
204204
.pcibios_fixup_phb = fsl_pcibios_fixup_phb,
205205
#endif
206206
.get_irq = mpic_get_irq,
207-
.restart = fsl_rstcr_restart,
208207
.calibrate_decr = generic_calibrate_decr,
209208
.progress = udbg_progress,
210209
};
@@ -219,7 +218,6 @@ define_machine(mpc8572_ds) {
219218
.pcibios_fixup_phb = fsl_pcibios_fixup_phb,
220219
#endif
221220
.get_irq = mpic_get_irq,
222-
.restart = fsl_rstcr_restart,
223221
.calibrate_decr = generic_calibrate_decr,
224222
.progress = udbg_progress,
225223
};
@@ -234,7 +232,6 @@ define_machine(p2020_ds) {
234232
.pcibios_fixup_phb = fsl_pcibios_fixup_phb,
235233
#endif
236234
.get_irq = mpic_get_irq,
237-
.restart = fsl_rstcr_restart,
238235
.calibrate_decr = generic_calibrate_decr,
239236
.progress = udbg_progress,
240237
};

arch/powerpc/platforms/85xx/mpc85xx_mds.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,6 @@ define_machine(mpc8568_mds) {
393393
.setup_arch = mpc85xx_mds_setup_arch,
394394
.init_IRQ = mpc85xx_mds_pic_init,
395395
.get_irq = mpic_get_irq,
396-
.restart = fsl_rstcr_restart,
397396
.calibrate_decr = generic_calibrate_decr,
398397
.progress = udbg_progress,
399398
#ifdef CONFIG_PCI
@@ -413,7 +412,6 @@ define_machine(mpc8569_mds) {
413412
.setup_arch = mpc85xx_mds_setup_arch,
414413
.init_IRQ = mpc85xx_mds_pic_init,
415414
.get_irq = mpic_get_irq,
416-
.restart = fsl_rstcr_restart,
417415
.calibrate_decr = generic_calibrate_decr,
418416
.progress = udbg_progress,
419417
#ifdef CONFIG_PCI
@@ -434,7 +432,6 @@ define_machine(p1021_mds) {
434432
.setup_arch = mpc85xx_mds_setup_arch,
435433
.init_IRQ = mpc85xx_mds_pic_init,
436434
.get_irq = mpic_get_irq,
437-
.restart = fsl_rstcr_restart,
438435
.calibrate_decr = generic_calibrate_decr,
439436
.progress = udbg_progress,
440437
#ifdef CONFIG_PCI

0 commit comments

Comments
 (0)