@@ -588,7 +588,7 @@ static int ft260_i2c_write_read(struct ft260_device *dev, struct i2c_msg *msgs)
588
588
589
589
if (ft260_debug ) {
590
590
if (wr_len == 2 )
591
- read_off = be16_to_cpu (* (u16 * )msgs [0 ].buf );
591
+ read_off = be16_to_cpu (* (__be16 * )msgs [0 ].buf );
592
592
else
593
593
read_off = * msgs [0 ].buf ;
594
594
@@ -830,7 +830,7 @@ static int ft260_byte_show(struct hid_device *hdev, int id, u8 *cfg, int len,
830
830
}
831
831
832
832
static int ft260_word_show (struct hid_device * hdev , int id , u8 * cfg , int len ,
833
- u16 * field , u8 * buf )
833
+ __le16 * field , u8 * buf )
834
834
{
835
835
int ret ;
836
836
@@ -859,9 +859,9 @@ static int ft260_word_show(struct hid_device *hdev, int id, u8 *cfg, int len,
859
859
860
860
#define FT260_I2CST_ATTR_SHOW (name ) \
861
861
FT260_ATTR_SHOW(name, ft260_get_i2c_status_report, \
862
- FT260_I2C_STATUS, u16 , ft260_word_show)
862
+ FT260_I2C_STATUS, __le16 , ft260_word_show)
863
863
864
- #define FT260_ATTR_STORE (name , reptype , id , req , type , func ) \
864
+ #define FT260_ATTR_STORE (name , reptype , id , req , type , ctype , func ) \
865
865
static ssize_t name##_store(struct device *kdev, \
866
866
struct device_attribute *attr, \
867
867
const char *buf, size_t count) \
@@ -871,7 +871,7 @@ static int ft260_word_show(struct hid_device *hdev, int id, u8 *cfg, int len,
871
871
type name; \
872
872
int ret; \
873
873
\
874
- if (!func(buf, 10, &name)) { \
874
+ if (!func(buf, 10, (ctype *) &name)) { \
875
875
rep.name = name; \
876
876
rep.report = id; \
877
877
rep.request = req; \
@@ -887,11 +887,11 @@ static int ft260_word_show(struct hid_device *hdev, int id, u8 *cfg, int len,
887
887
888
888
#define FT260_BYTE_ATTR_STORE (name , reptype , req ) \
889
889
FT260_ATTR_STORE(name, reptype, FT260_SYSTEM_SETTINGS, req, \
890
- u8, kstrtou8)
890
+ u8, u8, kstrtou8)
891
891
892
892
#define FT260_WORD_ATTR_STORE (name , reptype , req ) \
893
893
FT260_ATTR_STORE(name, reptype, FT260_SYSTEM_SETTINGS, req, \
894
- u16, kstrtou16)
894
+ __le16, u16, kstrtou16)
895
895
896
896
FT260_SSTAT_ATTR_SHOW (chip_mode );
897
897
static DEVICE_ATTR_RO (chip_mode );
0 commit comments