Lines Matching refs:ret
78 int ret; in lan78xx_read_raw_otp() local
81 ret = lan7x_read_reg(udev, LAN78XX_OTP_PWR_DN, &buf); in lan78xx_read_raw_otp()
82 if (ret) in lan78xx_read_raw_otp()
83 return ret; in lan78xx_read_raw_otp()
87 ret = lan7x_write_reg(udev, LAN78XX_OTP_PWR_DN, 0); in lan78xx_read_raw_otp()
88 if (ret) in lan78xx_read_raw_otp()
89 return ret; in lan78xx_read_raw_otp()
91 ret = lan7x_wait_for_bit(udev, "LAN78XX_OTP_PWR_DN_PWRDN_N", in lan78xx_read_raw_otp()
95 if (ret) in lan78xx_read_raw_otp()
96 return ret; in lan78xx_read_raw_otp()
100 ret = lan7x_write_reg(udev, LAN78XX_OTP_ADDR1, in lan78xx_read_raw_otp()
103 if (ret) in lan78xx_read_raw_otp()
104 return ret; in lan78xx_read_raw_otp()
105 ret = lan7x_write_reg(udev, LAN78XX_OTP_ADDR2, in lan78xx_read_raw_otp()
107 if (ret) in lan78xx_read_raw_otp()
108 return ret; in lan78xx_read_raw_otp()
110 ret = lan7x_write_reg(udev, LAN78XX_OTP_FUNC_CMD, in lan78xx_read_raw_otp()
112 if (ret) in lan78xx_read_raw_otp()
113 return ret; in lan78xx_read_raw_otp()
114 ret = lan7x_write_reg(udev, LAN78XX_OTP_CMD_GO, in lan78xx_read_raw_otp()
117 if (ret) in lan78xx_read_raw_otp()
118 return ret; in lan78xx_read_raw_otp()
120 ret = lan7x_wait_for_bit(udev, "LAN78XX_OTP_STATUS_BUSY", in lan78xx_read_raw_otp()
124 if (ret) in lan78xx_read_raw_otp()
125 return ret; in lan78xx_read_raw_otp()
127 ret = lan7x_read_reg(udev, LAN78XX_OTP_RD_DATA, &buf); in lan78xx_read_raw_otp()
128 if (ret) in lan78xx_read_raw_otp()
129 return ret; in lan78xx_read_raw_otp()
141 int ret; in lan78xx_read_otp() local
143 ret = lan78xx_read_raw_otp(udev, 0, 1, &sig); in lan78xx_read_otp()
145 if (!ret) { in lan78xx_read_otp()
152 ret = lan78xx_read_raw_otp(udev, offset, length, data); in lan78xx_read_otp()
153 if (ret) in lan78xx_read_otp()
154 return ret; in lan78xx_read_otp()
158 return ret; in lan78xx_read_otp()
164 int ret; in lan78xx_read_otp_mac() local
168 ret = lan78xx_read_otp(udev, in lan78xx_read_otp_mac()
172 if (!ret && is_valid_ethaddr(enetaddr)) { in lan78xx_read_otp_mac()
187 int ret; in lan78xx_update_flowcontrol() local
189 ret = lan7x_update_flowcontrol(udev, dev, &flow, &fct_flow); in lan78xx_update_flowcontrol()
190 if (ret) in lan78xx_update_flowcontrol()
191 return ret; in lan78xx_update_flowcontrol()
193 ret = lan7x_write_reg(udev, LAN78XX_FCT_FLOW, fct_flow); in lan78xx_update_flowcontrol()
194 if (ret) in lan78xx_update_flowcontrol()
195 return ret; in lan78xx_update_flowcontrol()
204 int ret; in lan78xx_read_mac() local
213 ret = lan7x_read_reg(udev, HW_CFG, &val); in lan78xx_read_mac()
214 if (ret) in lan78xx_read_mac()
215 return ret; in lan78xx_read_mac()
218 ret = lan7x_write_reg(udev, HW_CFG, val); in lan78xx_read_mac()
219 if (ret) in lan78xx_read_mac()
228 ret = lan7x_read_eeprom_mac(enetaddr, udev); in lan78xx_read_mac()
229 if (!ret) in lan78xx_read_mac()
235 ret = lan7x_write_reg(udev, HW_CFG, saved); in lan78xx_read_mac()
236 if (ret) in lan78xx_read_mac()
237 return ret; in lan78xx_read_mac()
280 int ret; in lan78xx_basic_reset() local
283 ret = lan7x_basic_reset(udev, dev); in lan78xx_basic_reset()
284 if (ret) in lan78xx_basic_reset()
285 return ret; in lan78xx_basic_reset()
288 ret = lan7x_read_reg(udev, ID_REV, &val); in lan78xx_basic_reset()
289 if (ret) in lan78xx_basic_reset()
290 return ret; in lan78xx_basic_reset()
296 ret = lan7x_read_reg(udev, LAN78XX_USB_CFG0, &val); in lan78xx_basic_reset()
297 if (ret) in lan78xx_basic_reset()
298 return ret; in lan78xx_basic_reset()
310 int ret; in lan78xx_write_hwaddr() local
313 ret = lan7x_write_reg(udev, RX_ADDRL, addr_lo); in lan78xx_write_hwaddr()
314 if (ret) in lan78xx_write_hwaddr()
315 return ret; in lan78xx_write_hwaddr()
317 ret = lan7x_write_reg(udev, RX_ADDRH, addr_hi); in lan78xx_write_hwaddr()
318 if (ret) in lan78xx_write_hwaddr()
319 return ret; in lan78xx_write_hwaddr()
321 ret = lan7x_write_reg(udev, LAN78XX_MAF_LO(0), addr_lo); in lan78xx_write_hwaddr()
322 if (ret) in lan78xx_write_hwaddr()
323 return ret; in lan78xx_write_hwaddr()
325 ret = lan7x_write_reg(udev, LAN78XX_MAF_HI(0), in lan78xx_write_hwaddr()
327 if (ret) in lan78xx_write_hwaddr()
328 return ret; in lan78xx_write_hwaddr()
340 int ret; in lan78xx_eth_start() local
344 ret = lan78xx_write_hwaddr(dev); in lan78xx_eth_start()
345 if (ret) in lan78xx_eth_start()
346 return ret; in lan78xx_eth_start()
348 ret = lan7x_write_reg(udev, LAN78XX_BURST_CAP, 0); in lan78xx_eth_start()
349 if (ret) in lan78xx_eth_start()
350 return ret; in lan78xx_eth_start()
352 ret = lan7x_write_reg(udev, LAN78XX_BULK_IN_DLY, DEFAULT_BULK_IN_DELAY); in lan78xx_eth_start()
353 if (ret) in lan78xx_eth_start()
354 return ret; in lan78xx_eth_start()
356 ret = lan7x_write_reg(udev, INT_STS, 0xFFFFFFFF); in lan78xx_eth_start()
357 if (ret) in lan78xx_eth_start()
358 return ret; in lan78xx_eth_start()
361 ret = lan7x_write_reg(udev, LAN78XX_FCT_RX_FIFO_END, in lan78xx_eth_start()
363 if (ret) in lan78xx_eth_start()
364 return ret; in lan78xx_eth_start()
366 ret = lan7x_write_reg(udev, LAN78XX_FCT_TX_FIFO_END, in lan78xx_eth_start()
368 if (ret) in lan78xx_eth_start()
369 return ret; in lan78xx_eth_start()
372 ret = lan7x_write_reg(udev, FLOW, 0); in lan78xx_eth_start()
373 if (ret) in lan78xx_eth_start()
374 return ret; in lan78xx_eth_start()
377 ret = lan78xx_set_receive_filter(udev); in lan78xx_eth_start()
378 if (ret) in lan78xx_eth_start()
379 return ret; in lan78xx_eth_start()
382 ret = lan7x_eth_phylib_connect(dev, &priv->ueth); in lan78xx_eth_start()
383 if (ret) in lan78xx_eth_start()
384 return ret; in lan78xx_eth_start()
385 ret = lan7x_eth_phylib_config_start(dev); in lan78xx_eth_start()
386 if (ret) in lan78xx_eth_start()
387 return ret; in lan78xx_eth_start()
393 ret = lan7x_read_reg(udev, MAC_CR, &write_buf); in lan78xx_eth_start()
394 if (ret) in lan78xx_eth_start()
395 return ret; in lan78xx_eth_start()
397 ret = lan7x_write_reg(udev, MAC_CR, write_buf); in lan78xx_eth_start()
398 if (ret) in lan78xx_eth_start()
399 return ret; in lan78xx_eth_start()
412 int ret; in lan78xx_read_rom_hwaddr() local
414 ret = lan78xx_read_mac(pdata->enetaddr, udev, priv); in lan78xx_read_rom_hwaddr()
415 if (ret) in lan78xx_read_rom_hwaddr()
427 int ret; in lan78xx_eth_probe() local
442 ret = usb_ether_register(dev, ueth, RX_URB_SIZE); in lan78xx_eth_probe()
443 if (ret) in lan78xx_eth_probe()
444 return ret; in lan78xx_eth_probe()