scsi: aacraid: Refactor reset_host store function
authorRaghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>
Wed, 27 Dec 2017 04:34:28 +0000 (20:34 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 4 Jan 2018 04:26:41 +0000 (23:26 -0500)
Refactored the reset_host store function to make consistent across code
bases

Signed-off-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/aacraid/linit.c

index 5eb07223087bdea970234beaabe44cf430c635ff..b2273e3cba6247b0964600490bf4fe0ad7c90255 100644 (file)
@@ -1375,18 +1375,15 @@ static ssize_t aac_store_reset_adapter(struct device *device,
                                       const char *buf, size_t count)
 {
        int retval = -EACCES;
-       int bled = 0;
-       struct aac_dev *aac;
-
 
        if (!capable(CAP_SYS_ADMIN))
                return retval;
 
-       aac = (struct aac_dev *)class_to_shost(device)->hostdata;
-       bled = buf[0] == '!' ? 1:0;
-       retval = aac_reset_adapter(aac, bled, IOP_HWSOFT_RESET);
+       retval = aac_reset_adapter(shost_priv(class_to_shost(device)),
+                                       buf[0] == '!', IOP_HWSOFT_RESET);
        if (retval >= 0)
                retval = count;
+
        return retval;
 }