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

Commit 6a744637 authored by Matthew Garrett's avatar Matthew Garrett Committed by Jeff Garzik
Browse files

ata: Don't require newlines for link_power_management_policy



sysfs attributes shouldn't require newlines. Make it possible to set the
link power management policy without a trailing newline.

Signed-off-by: default avatarMatthew Garrett <mjg@redhat.com>
Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
parent 4192be64
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -154,8 +154,7 @@ static ssize_t ata_scsi_lpm_put(struct device *dev,
	 */
	 */
	for (i = 1; i < ARRAY_SIZE(link_pm_policy); i++) {
	for (i = 1; i < ARRAY_SIZE(link_pm_policy); i++) {
		const int len = strlen(link_pm_policy[i].name);
		const int len = strlen(link_pm_policy[i].name);
		if (strncmp(link_pm_policy[i].name, buf, len) == 0 &&
		if (strncmp(link_pm_policy[i].name, buf, len) == 0) {
		   buf[len] == '\n') {
			policy = link_pm_policy[i].value;
			policy = link_pm_policy[i].value;
			break;
			break;
		}
		}