From: Thomas Jarosch Date: Wed, 30 Aug 2006 14:09:44 +0000 (+0000) Subject: libftdi: (tomj) fix ftdi_read_pins on PowerPC systems X-Git-Tag: v0.8~10 X-Git-Url: http://developer.intra2net.com/git/?p=libftdi;a=commitdiff_plain;h=85f3c596c5ac4285544d0f1f7671a3900989fe2f libftdi: (tomj) fix ftdi_read_pins on PowerPC systems --- diff --git a/ChangeLog b/ChangeLog index 7a828bc..ca65a94 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ New in 0.8 ---------- +* Fix ftdi_read_pins on PowerPC systems (Thomas Fischl) * Automatically detach ftdi_sio kernel driver (Uwe Bonnes and Intra2net) * Configurable flow control (Lorenz Moesenlechner and Matthias Kranz) diff --git a/src/ftdi.c b/src/ftdi.c index 8b9dd05..adb43c3 100644 --- a/src/ftdi.c +++ b/src/ftdi.c @@ -769,11 +769,9 @@ int ftdi_set_bitmode(struct ftdi_context *ftdi, unsigned char bitmask, unsigned int ftdi_read_pins(struct ftdi_context *ftdi, unsigned char *pins) { - unsigned short usb_val; - if (usb_control_msg(ftdi->usb_dev, 0xC0, 0x0C, 0, ftdi->index, (char *)&usb_val, 1, ftdi->usb_read_timeout) != 1) + if (usb_control_msg(ftdi->usb_dev, 0xC0, 0x0C, 0, ftdi->index, (char *)pins, 1, ftdi->usb_read_timeout) != 1) ftdi_error_return(-1, "read pins failed"); - *pins = (unsigned char)usb_val; return 0; }