Re: [PATCH 07/12] libata-hp-prep: store attached SCSI device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2006-05-29 at 15:25 +0900, Tejun Heo wrote:
> @@ -2743,16 +2743,22 @@ void ata_scsi_simulate(struct ata_device
>  
>  void ata_scsi_scan_host(struct ata_port *ap)
>  {
> -	struct ata_device *dev;
>  	unsigned int i;
>  
>  	if (ap->flags & ATA_FLAG_DISABLED)
>  		return;
>  
>  	for (i = 0; i < ATA_MAX_DEVICES; i++) {
> -		dev = &ap->device[i];
> +		struct ata_device *dev = &ap->device[i];
> +		struct scsi_device *sdev;
> +
> +		if (!ata_dev_enabled(dev) || dev->sdev)
> +			continue;
>  
> -		if (ata_dev_enabled(dev))
> -			scsi_scan_target(&ap->host->shost_gendev, 0, i, 0, 0);
> +		sdev = __scsi_add_device(ap->host, 0, i, 0, NULL);
Is it better to use macro scsi_add_device() than invoking
__scsi_add_device() directly here? I know this is only a trivial change.

> +		if (!IS_ERR(sdev)) {
> +			dev->sdev = sdev;
> +			scsi_device_put(sdev);
> +		}
>  	}
>  }

Thanks,
Forrest
-
: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux