Skip to content

Commit

Permalink
misc: surface_sam: Replace scnprintf with sysfs_emit where appropriate
Browse files Browse the repository at this point in the history
  • Loading branch information
qzed committed Feb 3, 2021
1 parent 9abc6fa commit 452ca80
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions drivers/misc/surface_aggregator/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
{
struct ssam_device *sdev = to_ssam_device(dev);

// FIXME: we should use sysfs_emit here, but that's not available on < 5.10
return scnprintf(buf, PAGE_SIZE, "ssam:d%02Xc%02Xt%02Xi%02Xf%02X\n",
return sysfs_emit(buf, "ssam:d%02Xc%02Xt%02Xi%02Xf%02X\n",
sdev->uid.domain, sdev->uid.category, sdev->uid.target,
sdev->uid.instance, sdev->uid.function);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,7 @@ static ssize_t ssam_base_hub_state_show(struct device *dev,
connected = hub->state == SSAM_BASE_HUB_CONNECTED;
mutex_unlock(&hub->lock);

// FIXME: we should use sysfs_emit here, but that's not available on < 5.10
return scnprintf(buf, PAGE_SIZE, "%d\n", connected);
return sysfs_emit(buf, "%d\n", connected);
}

static struct device_attribute ssam_base_hub_attr_state =
Expand Down
3 changes: 1 addition & 2 deletions drivers/misc/surface_aggregator/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,7 @@ static ssize_t firmware_version_show(struct device *dev,
b = ((version >> 8) & 0xffff);
c = version & 0xff;

// FIXME: we should use sysfs_emit here, but that's not available on < 5.10
return scnprintf(buf, PAGE_SIZE, "%u.%u.%u\n", a, b, c);
return sysfs_emit(buf, "%u.%u.%u\n", a, b, c);
}
static DEVICE_ATTR_RO(firmware_version);

Expand Down

0 comments on commit 452ca80

Please sign in to comment.