Skip to content

Commit

Permalink
USB: Fix a bug on appledisplay.c regarding signedness
Browse files Browse the repository at this point in the history
brightness status is reported by the Apple Cinema Displays as an
'unsigned char' (u8) value, but the code used 'char' instead.

Note that he driver was developed on the PowerPC architecture,
where the two types are synonymous, which is not always the case.

Fixed that.  Otherwise the driver will interpret brightness
levels > 127 as negative, and fail to load.

Signed-off-by: pancho horrillo <pancho@pancho.name>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
panchoh authored and gregkh committed Dec 23, 2009
1 parent c983202 commit 37e9066
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/usb/misc/appledisplay.c
Expand Up @@ -73,8 +73,8 @@ struct appledisplay {
struct usb_device *udev; /* usb device */
struct urb *urb; /* usb request block */
struct backlight_device *bd; /* backlight device */
char *urbdata; /* interrupt URB data buffer */
char *msgdata; /* control message data buffer */
u8 *urbdata; /* interrupt URB data buffer */
u8 *msgdata; /* control message data buffer */

struct delayed_work work;
int button_pressed;
Expand Down

0 comments on commit 37e9066

Please sign in to comment.