scsi: pm80xx: Set phy_attached to zero when device is gone
Subsystems (2)
PATCH 1/1 scsi: pm80xx: Set phy_attached to zero when device is gone
From: Igor Pylypiv <[email protected]>
Set phy_attached to zero when device is gone.
Signed-off-by Igor Pylypiv <[email protected]>
Signed-off-by Pranav Prasad <[email protected]>
--- drivers/scsi/pm8001/pm8001_sas.c | 1 + 1 file changed, 1 insertion(+)
drivers/scsi/pm8001/pm8001_sas.c +1 -0
@@ -706,6 +706,7 @@ static void pm8001_dev_gone_notify(struct domain_device *dev)spin_lock_irqsave (&pm8001_ha->lock, flags); }PM8001_CHIP_DISP ->dereg_dev_req (pm8001_ha, device_id); + pm8001_ha->phy[pm8001_dev->attached_phy].phy_attached =0 ;pm8001_free_dev (pm8001_dev); }else {pm8001_dbg (pm8001_ha,DISC ,"Found dev has gone.\n" );
Signature · 1 line
2.40.1.606.ga4b1b128d6-goog
Quoted 15 lines · Pranav Prasad
From: Igor Pylypiv <[email protected]>
Set
phy_attachedto zero when device is gone.Signed-off-by Igor Pylypiv <[email protected]>Signed-off-by Pranav Prasad <[email protected]>--- drivers/scsi/pm8001/pm8001_sas.c | 1 + 1 file changed, 1 insertion(+)drivers/scsi/pm8001/pm8001_sas.c +0
-0
drivers/scsi/pm8001/pm8001_sas.c static void pm8001_dev_gone_notify(struct domain_device *dev) · line 709
Quoted 4 lines
drivers/scsi/pm8001/pm8001_sas.c +1
-0@@ -706,6 +706,7 @@ static void pm8001_dev_gone_notify(struct domain_device *dev)spin_lock_irqsave (&pm8001_ha->lock, flags); }PM8001_CHIP_DISP ->dereg_dev_req (pm8001_ha, device_id); + pm8001_ha->phy[pm8001_dev->attached_phy].phy_attached =0 ;
Can you factor stuff like this out, so that maintaining these values is easier and less error prone?
Check this:
~/linux/drivers/scsi/pm8001> git grep "phy_attached = 0" | wc -l 21
Quoted 3 lines
drivers/scsi/pm8001/pm8001_sas.c +0
-0pm8001_free_dev (pm8001_dev); }else {pm8001_dbg (pm8001_ha,DISC ,"Found dev has gone.\n" );