mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-21 06:01:23 +00:00
scsi: aacraid: Refactor reset_host store function
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>
This commit is contained in:
parent
d1471eb0fa
commit
97a4e8ac3f
1 changed files with 3 additions and 6 deletions
|
@ -1375,18 +1375,15 @@ static ssize_t aac_store_reset_adapter(struct device *device,
|
||||||
const char *buf, size_t count)
|
const char *buf, size_t count)
|
||||||
{
|
{
|
||||||
int retval = -EACCES;
|
int retval = -EACCES;
|
||||||
int bled = 0;
|
|
||||||
struct aac_dev *aac;
|
|
||||||
|
|
||||||
|
|
||||||
if (!capable(CAP_SYS_ADMIN))
|
if (!capable(CAP_SYS_ADMIN))
|
||||||
return retval;
|
return retval;
|
||||||
|
|
||||||
aac = (struct aac_dev *)class_to_shost(device)->hostdata;
|
retval = aac_reset_adapter(shost_priv(class_to_shost(device)),
|
||||||
bled = buf[0] == '!' ? 1:0;
|
buf[0] == '!', IOP_HWSOFT_RESET);
|
||||||
retval = aac_reset_adapter(aac, bled, IOP_HWSOFT_RESET);
|
|
||||||
if (retval >= 0)
|
if (retval >= 0)
|
||||||
retval = count;
|
retval = count;
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue