hmmm... is it really acceptable that libata is referencing libsas? I didn't think that it would be. libsas uses libata, not the other way around.Yeah, I didn't expect that either. Is there any other way? If so, is patch v1 OK?
Add a new flag only for libsas?
#include <linux/libata.h>Why drop the const ?
#include <linux/hdreg.h>
#include <linux/uaccess.h>
@@ -2745,10 +2746,17 @@ static struct ata_device *__ata_scsi_find_dev(struct ata_port *ap,
* Associated ATA device, or %NULL if not found.
*/
struct ata_device *
-ata_scsi_find_dev(struct ata_port *ap, const struct scsi_device *scsidev)
+ata_scsi_find_dev(struct ata_port *ap, struct scsi_device *scsidev)
{
- struct ata_device *dev = __ata_scsi_find_dev(ap, scsidev);
+ struct ata_device *dev;
+
+ if (ap->flags & ATA_FLAG_SAS_HOST) {
And this is SAS host. Not necessarily libsas (even though with ipr libata usage gone, it would be the only user).