@@ -534,18 +534,6 @@ static int ioat_probe(struct ioatdma_device *ioat_dma)
534
534
return err ;
535
535
}
536
536
537
- static int ioat_register (struct ioatdma_device * ioat_dma )
538
- {
539
- int err = dma_async_device_register (& ioat_dma -> dma_dev );
540
-
541
- if (err ) {
542
- ioat_disable_interrupts (ioat_dma );
543
- dma_pool_destroy (ioat_dma -> completion_pool );
544
- }
545
-
546
- return err ;
547
- }
548
-
549
537
static void ioat_dma_remove (struct ioatdma_device * ioat_dma )
550
538
{
551
539
struct dma_device * dma = & ioat_dma -> dma_dev ;
@@ -1181,9 +1169,9 @@ static int ioat3_dma_probe(struct ioatdma_device *ioat_dma, int dca)
1181
1169
ioat_chan -> reg_base + IOAT_DCACTRL_OFFSET );
1182
1170
}
1183
1171
1184
- err = ioat_register ( ioat_dma );
1172
+ err = dma_async_device_register ( & ioat_dma -> dma_dev );
1185
1173
if (err )
1186
- return err ;
1174
+ goto err_disable_interrupts ;
1187
1175
1188
1176
ioat_kobject_add (ioat_dma , & ioat_ktype );
1189
1177
@@ -1192,20 +1180,29 @@ static int ioat3_dma_probe(struct ioatdma_device *ioat_dma, int dca)
1192
1180
1193
1181
/* disable relaxed ordering */
1194
1182
err = pcie_capability_read_word (pdev , PCI_EXP_DEVCTL , & val16 );
1195
- if (err )
1196
- return pcibios_err_to_errno (err );
1183
+ if (err ) {
1184
+ err = pcibios_err_to_errno (err );
1185
+ goto err_disable_interrupts ;
1186
+ }
1197
1187
1198
1188
/* clear relaxed ordering enable */
1199
1189
val16 &= ~PCI_EXP_DEVCTL_RELAX_EN ;
1200
1190
err = pcie_capability_write_word (pdev , PCI_EXP_DEVCTL , val16 );
1201
- if (err )
1202
- return pcibios_err_to_errno (err );
1191
+ if (err ) {
1192
+ err = pcibios_err_to_errno (err );
1193
+ goto err_disable_interrupts ;
1194
+ }
1203
1195
1204
1196
if (ioat_dma -> cap & IOAT_CAP_DPS )
1205
1197
writeb (ioat_pending_level + 1 ,
1206
1198
ioat_dma -> reg_base + IOAT_PREFETCH_LIMIT_OFFSET );
1207
1199
1208
1200
return 0 ;
1201
+
1202
+ err_disable_interrupts :
1203
+ ioat_disable_interrupts (ioat_dma );
1204
+ dma_pool_destroy (ioat_dma -> completion_pool );
1205
+ return err ;
1209
1206
}
1210
1207
1211
1208
static void ioat_shutdown (struct pci_dev * pdev )
0 commit comments