Lines Matching refs:ret
52 int ret; in ipath_parse_ushort() local
55 ret = -EINVAL; in ipath_parse_ushort()
62 ret = -EINVAL; in ipath_parse_ushort()
68 ret = end + 1 - str; in ipath_parse_ushort()
69 if (ret == 0) in ipath_parse_ushort()
70 ret = -EINVAL; in ipath_parse_ushort()
73 return ret; in ipath_parse_ushort()
93 ssize_t ret; in show_status() local
96 ret = -EINVAL; in show_status()
100 ret = scnprintf(buf, PAGE_SIZE, "0x%llx\n", in show_status()
104 return ret; in show_status()
128 ssize_t ret; in show_status_str() local
131 ret = -EINVAL; in show_status_str()
153 ret = strlen(buf); in show_status_str()
156 return ret; in show_status_str()
193 int ret; in store_lmc() local
195 ret = ipath_parse_ushort(buf, &lmc); in store_lmc()
196 if (ret < 0) in store_lmc()
200 ret = -EINVAL; in store_lmc()
210 return ret; in store_lmc()
229 int ret; in store_lid() local
231 ret = ipath_parse_ushort(buf, &lid); in store_lid()
232 if (ret < 0) in store_lid()
236 ret = -EINVAL; in store_lid()
246 return ret; in store_lid()
265 int ret; in store_mlid() local
267 ret = ipath_parse_ushort(buf, &mlid); in store_mlid()
268 if (ret < 0 || mlid < IPATH_MULTICAST_LID_BASE) in store_mlid()
277 return ret; in store_mlid()
301 ssize_t ret; in store_guid() local
328 ret = strlen(buf); in store_guid()
333 ret = -EINVAL; in store_guid()
336 return ret; in store_guid()
395 int ret; in store_jint_max_packets() local
397 ret = ipath_parse_ushort(buf, &v); in store_jint_max_packets()
398 if (ret < 0) in store_jint_max_packets()
403 return ret; in store_jint_max_packets()
422 int ret; in store_jint_idle_ticks() local
424 ret = ipath_parse_ushort(buf, &v); in store_jint_idle_ticks()
425 if (ret < 0) in store_jint_idle_ticks()
430 return ret; in store_jint_idle_ticks()
545 int ret; in store_reset() local
548 ret = -EINVAL; in store_reset()
560 ret = -EINVAL; in store_reset()
563 ret = ipath_reset_device(dd->ipath_unit); in store_reset()
565 return ret<0 ? ret : count; in store_reset()
574 int ret, r; in store_link_state() local
577 ret = ipath_parse_ushort(buf, &state); in store_link_state()
578 if (ret < 0) in store_link_state()
583 ret = r; in store_link_state()
591 return ret; in store_link_state()
608 ssize_t ret; in store_mtu() local
612 ret = ipath_parse_ushort(buf, &mtu); in store_mtu()
613 if (ret < 0) in store_mtu()
618 ret = r; in store_mtu()
624 return ret; in store_mtu()
642 ssize_t ret; in store_enabled() local
645 ret = ipath_parse_ushort(buf, &enable); in store_enabled()
646 if (ret < 0) { in store_enabled()
657 ret = ipath_init_chip(dd, 1); in store_enabled()
658 if (ret) in store_enabled()
674 return ret; in store_enabled()
683 int ret, r; in store_rx_pol_inv() local
686 ret = ipath_parse_ushort(buf, &val); in store_rx_pol_inv()
687 if (ret < 0) in store_rx_pol_inv()
692 ret = r; in store_rx_pol_inv()
700 return ret; in store_rx_pol_inv()
709 int ret; in store_led_override() local
712 ret = ipath_parse_ushort(buf, &val); in store_led_override()
713 if (ret > 0) in store_led_override()
717 return ret; in store_led_override()
752 int ret; in show_hrtbt_enb() local
754 ret = dd->ipath_f_get_ib_cfg(dd, IPATH_IB_CFG_HRTBT); in show_hrtbt_enb()
755 if (ret >= 0) in show_hrtbt_enb()
756 ret = scnprintf(buf, PAGE_SIZE, "%d\n", ret); in show_hrtbt_enb()
757 return ret; in show_hrtbt_enb()
766 int ret, r; in store_hrtbt_enb() local
769 ret = ipath_parse_ushort(buf, &val); in store_hrtbt_enb()
770 if (ret >= 0 && val > 3) in store_hrtbt_enb()
771 ret = -EINVAL; in store_hrtbt_enb()
772 if (ret < 0) { in store_hrtbt_enb()
786 ret = r; in store_hrtbt_enb()
793 return ret; in store_hrtbt_enb()
805 int ret; in show_lwid_enb() local
807 ret = dd->ipath_f_get_ib_cfg(dd, IPATH_IB_CFG_LWID_ENB); in show_lwid_enb()
808 if (ret >= 0) in show_lwid_enb()
809 ret = scnprintf(buf, PAGE_SIZE, "%d\n", ret); in show_lwid_enb()
810 return ret; in show_lwid_enb()
819 int ret, r; in store_lwid_enb() local
822 ret = ipath_parse_ushort(buf, &val); in store_lwid_enb()
823 if (ret >= 0 && (val == 0 || val > 3)) in store_lwid_enb()
824 ret = -EINVAL; in store_lwid_enb()
825 if (ret < 0) { in store_lwid_enb()
833 ret = r; in store_lwid_enb()
836 return ret; in store_lwid_enb()
846 int ret; in show_lwid() local
848 ret = dd->ipath_f_get_ib_cfg(dd, IPATH_IB_CFG_LWID); in show_lwid()
849 if (ret >= 0) in show_lwid()
850 ret = scnprintf(buf, PAGE_SIZE, "%d\n", ret); in show_lwid()
851 return ret; in show_lwid()
862 int ret; in show_spd_enb() local
864 ret = dd->ipath_f_get_ib_cfg(dd, IPATH_IB_CFG_SPD_ENB); in show_spd_enb()
865 if (ret >= 0) in show_spd_enb()
866 ret = scnprintf(buf, PAGE_SIZE, "%d\n", ret); in show_spd_enb()
867 return ret; in show_spd_enb()
876 int ret, r; in store_spd_enb() local
879 ret = ipath_parse_ushort(buf, &val); in store_spd_enb()
880 if (ret >= 0 && (val == 0 || val > (IPATH_IB_SDR | IPATH_IB_DDR))) in store_spd_enb()
881 ret = -EINVAL; in store_spd_enb()
882 if (ret < 0) { in store_spd_enb()
890 ret = r; in store_spd_enb()
893 return ret; in store_spd_enb()
902 int ret; in show_spd() local
904 ret = dd->ipath_f_get_ib_cfg(dd, IPATH_IB_CFG_SPD); in show_spd()
905 if (ret >= 0) in show_spd()
906 ret = scnprintf(buf, PAGE_SIZE, "%d\n", ret); in show_spd()
907 return ret; in show_spd()
918 int ret; in show_rx_polinv_enb() local
920 ret = dd->ipath_f_get_ib_cfg(dd, IPATH_IB_CFG_RXPOL_ENB); in show_rx_polinv_enb()
921 if (ret >= 0) in show_rx_polinv_enb()
922 ret = scnprintf(buf, PAGE_SIZE, "%d\n", ret); in show_rx_polinv_enb()
923 return ret; in show_rx_polinv_enb()
932 int ret, r; in store_rx_polinv_enb() local
935 ret = ipath_parse_ushort(buf, &val); in store_rx_polinv_enb()
936 if (ret >= 0 && val > 1) { in store_rx_polinv_enb()
939 ret = -EINVAL; in store_rx_polinv_enb()
945 ret = r; in store_rx_polinv_enb()
948 return ret; in store_rx_polinv_enb()
959 int ret; in show_lanerev_enb() local
961 ret = dd->ipath_f_get_ib_cfg(dd, IPATH_IB_CFG_LREV_ENB); in show_lanerev_enb()
962 if (ret >= 0) in show_lanerev_enb()
963 ret = scnprintf(buf, PAGE_SIZE, "%d\n", ret); in show_lanerev_enb()
964 return ret; in show_lanerev_enb()
973 int ret, r; in store_lanerev_enb() local
976 ret = ipath_parse_ushort(buf, &val); in store_lanerev_enb()
977 if (ret >= 0 && val > 1) { in store_lanerev_enb()
978 ret = -EINVAL; in store_lanerev_enb()
986 ret = r; in store_lanerev_enb()
989 return ret; in store_lanerev_enb()
1011 int ret, stat; in store_tempsense() local
1014 ret = ipath_parse_ushort(buf, &val); in store_tempsense()
1015 if (ret <= 0) { in store_tempsense()
1023 ret = -1; in store_tempsense()
1029 ret = -1; in store_tempsense()
1035 ret = -1; in store_tempsense()
1040 return ret; in store_tempsense()
1051 int ret; in show_tempsense() local
1055 ret = -ENXIO; in show_tempsense()
1059 ret = ipath_tempsense_read(dd, idx); in show_tempsense()
1060 if (ret < 0) in show_tempsense()
1062 regvals[idx] = ret; in show_tempsense()
1065 ret = scnprintf(buf, PAGE_SIZE, "%d %d %02X %02X %d %d\n", in show_tempsense()
1071 return ret; in show_tempsense()
1174 int ret; in ipath_expose_reset() local
1177 ret = device_create_file(dev, &dev_attr_reset); in ipath_expose_reset()
1181 ret = 0; in ipath_expose_reset()
1183 return ret; in ipath_expose_reset()
1188 int ret; in ipath_device_create_group() local
1190 ret = sysfs_create_group(&dev->kobj, &dev_attr_group); in ipath_device_create_group()
1191 if (ret) in ipath_device_create_group()
1194 ret = sysfs_create_group(&dev->kobj, &dev_counter_attr_group); in ipath_device_create_group()
1195 if (ret) in ipath_device_create_group()
1199 ret = device_create_file(dev, &dev_attr_jint_idle_ticks); in ipath_device_create_group()
1200 if (ret) in ipath_device_create_group()
1202 ret = device_create_file(dev, &dev_attr_jint_max_packets); in ipath_device_create_group()
1203 if (ret) in ipath_device_create_group()
1206 ret = sysfs_create_group(&dev->kobj, &dev_ibcfg_attr_group); in ipath_device_create_group()
1207 if (ret) in ipath_device_create_group()
1222 return ret; in ipath_device_create_group()