diff options
| -rw-r--r-- | drivers/scsi/scsi_transport_spi.c | 11 | ||||
| -rw-r--r-- | include/scsi/scsi_transport_spi.h | 1 | 
2 files changed, 11 insertions, 1 deletions
diff --git a/drivers/scsi/scsi_transport_spi.c b/drivers/scsi/scsi_transport_spi.c index e7b9570c818..02134fce217 100644 --- a/drivers/scsi/scsi_transport_spi.c +++ b/drivers/scsi/scsi_transport_spi.c @@ -1082,6 +1082,7 @@ static int spi_device_match(struct attribute_container *cont,  {  	struct scsi_device *sdev;  	struct Scsi_Host *shost; +	struct spi_internal *i;  	if (!scsi_is_sdev_device(dev))  		return 0; @@ -1094,6 +1095,9 @@ static int spi_device_match(struct attribute_container *cont,  	/* Note: this class has no device attributes, so it has  	 * no per-HBA allocation and thus we don't need to distinguish  	 * the attribute containers for the device */ +	i = to_spi_internal(shost->transportt); +	if (i->f->deny_binding && i->f->deny_binding(sdev->sdev_target)) +		return 0;  	return 1;  } @@ -1101,6 +1105,7 @@ static int spi_target_match(struct attribute_container *cont,  			    struct device *dev)  {  	struct Scsi_Host *shost; +	struct scsi_target *starget;  	struct spi_internal *i;  	if (!scsi_is_target_device(dev)) @@ -1112,7 +1117,11 @@ static int spi_target_match(struct attribute_container *cont,  		return 0;  	i = to_spi_internal(shost->transportt); -	 +	starget = to_scsi_target(dev); + +	if (i->f->deny_binding && i->f->deny_binding(starget)) +		return 0; +  	return &i->t.target_attrs.ac == cont;  } diff --git a/include/scsi/scsi_transport_spi.h b/include/scsi/scsi_transport_spi.h index d8ef86006e0..6bdc4afb248 100644 --- a/include/scsi/scsi_transport_spi.h +++ b/include/scsi/scsi_transport_spi.h @@ -120,6 +120,7 @@ struct spi_function_template {  	void	(*set_hold_mcs)(struct scsi_target *, int);  	void	(*get_signalling)(struct Scsi_Host *);  	void	(*set_signalling)(struct Scsi_Host *, enum spi_signal_type); +	int	(*deny_binding)(struct scsi_target *);  	/* The driver sets these to tell the transport class it  	 * wants the attributes displayed in sysfs.  If the show_ flag  	 * is not set, the attribute will be private to the transport  |