Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 97a4e8ac authored by Raghava Aditya Renukunta's avatar Raghava Aditya Renukunta Committed by Martin K. Petersen
Browse files

scsi: aacraid: Refactor reset_host store function



Refactored the reset_host store function to make consistent across code
bases

Signed-off-by: default avatarRaghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent d1471eb0
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -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;
}