if (ap->flags & ATA_FLAG_SATA && ap->ops->scr_read)
hardreset = sata_std_hardreset;
- return ata_drive_probe_reset(ap, ata_std_softreset, hardreset,
+ return ata_drive_probe_reset(ap, NULL,
+ ata_std_softreset, hardreset,
ata_std_postreset, classes);
}
/**
* ata_drive_probe_reset - Perform probe reset with given methods
* @ap: port to reset
+ * @probeinit: probeinit method (can be NULL)
* @softreset: softreset method (can be NULL)
* @hardreset: hardreset method (can be NULL)
* @postreset: postreset method (can be NULL)
* if classification fails, and any error code from reset
* methods.
*/
-int ata_drive_probe_reset(struct ata_port *ap,
+int ata_drive_probe_reset(struct ata_port *ap, ata_probeinit_fn_t probeinit,
ata_reset_fn_t softreset, ata_reset_fn_t hardreset,
ata_postreset_fn_t postreset, unsigned int *classes)
{
int rc = -EINVAL;
+ if (probeinit)
+ probeinit(ap);
+
if (softreset) {
rc = do_probe_reset(ap, softreset, postreset, classes);
if (rc == 0)
/* typedefs */
typedef void (*ata_qc_cb_t) (struct ata_queued_cmd *qc);
+typedef void (*ata_probeinit_fn_t)(struct ata_port *);
typedef int (*ata_reset_fn_t)(struct ata_port *, int, unsigned int *);
typedef void (*ata_postreset_fn_t)(struct ata_port *ap, unsigned int *);
extern void sata_phy_reset(struct ata_port *ap);
extern void ata_bus_reset(struct ata_port *ap);
extern int ata_drive_probe_reset(struct ata_port *ap,
+ ata_probeinit_fn_t probeinit,
ata_reset_fn_t softreset, ata_reset_fn_t hardreset,
ata_postreset_fn_t postreset, unsigned int *classes);
extern int ata_std_softreset(struct ata_port *ap, int verbose,