Skip to content

Commit 92c9c3b

Browse files
Pavan Hollagregkh
authored andcommitted
usb: typec: Fix fast_role_swap_current show function
The current implementation mistakenly performs a & operation on the output of sysfs_emit. This patch performs the & operation before calling sysfs_emit. Fixes: 662a601 ("usb: typec: Separate USB Power Delivery from USB Type-C") Cc: stable <[email protected]> Reported-by: Benson Leung <[email protected]> Signed-off-by: Pavan Holla <[email protected]> Reviewed-by: Heikki Krogerus <[email protected]> Reviewed-by: Benson Leung <[email protected]> Message-ID: <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent c4a8bfa commit 92c9c3b

File tree

1 file changed

+1
-1
lines changed
  • drivers/usb/typec

1 file changed

+1
-1
lines changed

drivers/usb/typec/pd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ peak_current_show(struct device *dev, struct device_attribute *attr, char *buf)
9595
static ssize_t
9696
fast_role_swap_current_show(struct device *dev, struct device_attribute *attr, char *buf)
9797
{
98-
return sysfs_emit(buf, "%u\n", to_pdo(dev)->pdo >> PDO_FIXED_FRS_CURR_SHIFT) & 3;
98+
return sysfs_emit(buf, "%u\n", (to_pdo(dev)->pdo >> PDO_FIXED_FRS_CURR_SHIFT) & 3);
9999
}
100100
static DEVICE_ATTR_RO(fast_role_swap_current);
101101

0 commit comments

Comments
 (0)