Lines Matching refs:rc

200 	int rc;  in jedec_dimm_adjust_offset()  local
213 rc = 0; in jedec_dimm_adjust_offset()
217 rc = EINVAL; in jedec_dimm_adjust_offset()
228 rc = smbus_writeb(sc->smbus, (JEDEC_DTI_PAGE | JEDEC_LSA_PAGE_SET1), in jedec_dimm_adjust_offset()
230 if (rc != 0) { in jedec_dimm_adjust_offset()
233 orig_offset, rc); in jedec_dimm_adjust_offset()
240 return (rc); in jedec_dimm_adjust_offset()
267 int rc; in jedec_dimm_attach() local
292 rc = smbus_readb(sc->smbus, sc->spd_addr, SPD_OFFSET_DRAM_TYPE, &byte); in jedec_dimm_attach()
293 if (rc != 0) { in jedec_dimm_attach()
294 device_printf(dev, "failed to read dram_type: %d\n", rc); in jedec_dimm_attach()
317 rc = EINVAL; in jedec_dimm_attach()
329 rc = jedec_dimm_capacity(sc, type, &sc->capacity_mb); in jedec_dimm_attach()
330 if (rc != 0) { in jedec_dimm_attach()
334 rc = jedec_dimm_mfg_date(sc, type, &sc->mfg_year, &sc->mfg_week); in jedec_dimm_attach()
335 if (rc != 0) { in jedec_dimm_attach()
339 rc = jedec_dimm_field_to_str(sc, sc->part_str, sizeof(sc->part_str), in jedec_dimm_attach()
341 if (rc != 0) { in jedec_dimm_attach()
345 rc = jedec_dimm_field_to_str(sc, sc->serial_str, sizeof(sc->serial_str), in jedec_dimm_attach()
347 if (rc != 0) { in jedec_dimm_attach()
363 rc = smbus_readb(sc->smbus, sc->spd_addr, tsod_present_offset, &byte); in jedec_dimm_attach()
364 if (rc != 0) { in jedec_dimm_attach()
366 rc); in jedec_dimm_attach()
371 rc = jedec_dimm_readw_be(sc, TSOD_REG_MANUFACTURER, &vendorid); in jedec_dimm_attach()
372 if (rc != 0) { in jedec_dimm_attach()
375 rc = 0; in jedec_dimm_attach()
378 rc = jedec_dimm_readw_be(sc, TSOD_REG_DEV_REV, &devid); in jedec_dimm_attach()
379 if (rc != 0) { in jedec_dimm_attach()
381 rc = 0; in jedec_dimm_attach()
458 return (rc); in jedec_dimm_attach()
500 int rc; in jedec_dimm_capacity() local
520 rc = smbus_readb(sc->smbus, sc->spd_addr, bus_width_offset, in jedec_dimm_capacity()
522 if (rc != 0) { in jedec_dimm_capacity()
523 device_printf(sc->dev, "failed to read bus_width: %d\n", rc); in jedec_dimm_capacity()
527 rc = smbus_readb(sc->smbus, sc->spd_addr, dimm_ranks_offset, in jedec_dimm_capacity()
529 if (rc != 0) { in jedec_dimm_capacity()
530 device_printf(sc->dev, "failed to read dimm_ranks: %d\n", rc); in jedec_dimm_capacity()
534 rc = smbus_readb(sc->smbus, sc->spd_addr, sdram_capacity_offset, in jedec_dimm_capacity()
536 if (rc != 0) { in jedec_dimm_capacity()
538 rc); in jedec_dimm_capacity()
542 rc = smbus_readb(sc->smbus, sc->spd_addr, sdram_width_offset, in jedec_dimm_capacity()
544 if (rc != 0) { in jedec_dimm_capacity()
545 device_printf(sc->dev, "failed to read sdram_width: %d\n", rc); in jedec_dimm_capacity()
551 rc = smbus_readb(sc->smbus, sc->spd_addr, sdram_pkg_type_offset, in jedec_dimm_capacity()
553 if (rc != 0) { in jedec_dimm_capacity()
555 "failed to read sdram_pkg_type: %d\n", rc); in jedec_dimm_capacity()
567 rc = EINVAL; in jedec_dimm_capacity()
580 rc = EINVAL; in jedec_dimm_capacity()
585 rc = EINVAL; in jedec_dimm_capacity()
602 rc = EINVAL; in jedec_dimm_capacity()
607 rc = EINVAL; in jedec_dimm_capacity()
618 rc = EINVAL; in jedec_dimm_capacity()
641 return (rc); in jedec_dimm_capacity()
680 int rc; in jedec_dimm_dump() local
687 rc = smbus_readb(sc->smbus, sc->spd_addr, i, &bytes[i]); in jedec_dimm_dump()
688 if (rc != 0) { in jedec_dimm_dump()
690 "unable to read page0:0x%02x: %d\n", i, rc); in jedec_dimm_dump()
700 rc = smbus_writeb(sc->smbus, in jedec_dimm_dump()
702 if (rc != 0) { in jedec_dimm_dump()
708 rc); in jedec_dimm_dump()
714 rc = smbus_readb(sc->smbus, sc->spd_addr, i, in jedec_dimm_dump()
716 if (rc != 0) { in jedec_dimm_dump()
718 "unable to read page1:0x%02x: %d\n", i, rc); in jedec_dimm_dump()
732 if ((rc2 != 0) && (rc == 0)) { in jedec_dimm_dump()
733 rc = rc2; in jedec_dimm_dump()
737 return (rc); in jedec_dimm_dump()
773 int rc; in jedec_dimm_field_to_str() local
776 rc = jedec_dimm_adjust_offset(sc, offset, &new_offset, &page_changed); in jedec_dimm_field_to_str()
777 if (rc != 0) { in jedec_dimm_field_to_str()
785 rc = EINVAL; in jedec_dimm_field_to_str()
790 rc = EINVAL; in jedec_dimm_field_to_str()
806 rc = EINVAL; in jedec_dimm_field_to_str()
814 rc = EINVAL; in jedec_dimm_field_to_str()
824 rc = smbus_readb(sc->smbus, sc->spd_addr, (new_offset + i), in jedec_dimm_field_to_str()
826 if (rc != 0) { in jedec_dimm_field_to_str()
829 (new_offset + i), rc); in jedec_dimm_field_to_str()
861 if ((rc2 != 0) && (rc == 0)) { in jedec_dimm_field_to_str()
862 rc = rc2; in jedec_dimm_field_to_str()
866 return (rc); in jedec_dimm_field_to_str()
897 int rc; in jedec_dimm_mfg_date() local
928 rc = smbus_writeb(sc->smbus, in jedec_dimm_mfg_date()
930 if (rc != 0) { in jedec_dimm_mfg_date()
933 year_offset, rc); in jedec_dimm_mfg_date()
940 rc = EINVAL; in jedec_dimm_mfg_date()
945 rc = smbus_readb(sc->smbus, sc->spd_addr, year_offset, &year_bcd); in jedec_dimm_mfg_date()
946 if (rc != 0) { in jedec_dimm_mfg_date()
947 device_printf(sc->dev, "failed to read mfg year: %d\n", rc); in jedec_dimm_mfg_date()
951 rc = smbus_readb(sc->smbus, sc->spd_addr, week_offset, &week_bcd); in jedec_dimm_mfg_date()
952 if (rc != 0) { in jedec_dimm_mfg_date()
953 device_printf(sc->dev, "failed to read mfg week: %d\n", rc); in jedec_dimm_mfg_date()
974 return (rc); in jedec_dimm_mfg_date()
992 int rc; in jedec_dimm_probe() local
1006 rc = ENXIO; in jedec_dimm_probe()
1011 rc = smbus_readb(smbus, addr, SPD_OFFSET_DRAM_TYPE, &byte); in jedec_dimm_probe()
1012 if (rc != 0) { in jedec_dimm_probe()
1021 rc = BUS_PROBE_DEFAULT; in jedec_dimm_probe()
1025 rc = BUS_PROBE_DEFAULT; in jedec_dimm_probe()
1029 rc = ENXIO; in jedec_dimm_probe()
1034 return (rc); in jedec_dimm_probe()
1055 int rc; in jedec_dimm_readw_be() local
1057 rc = smbus_readw(sc->smbus, sc->tsod_addr, reg, val); in jedec_dimm_readw_be()
1058 if (rc != 0) { in jedec_dimm_readw_be()
1064 return (rc); in jedec_dimm_readw_be()
1079 int rc; in jedec_dimm_reset_page0() local
1084 rc = smbus_writeb(sc->smbus, (JEDEC_DTI_PAGE | JEDEC_LSA_PAGE_SET0), in jedec_dimm_reset_page0()
1086 if (rc != 0) { in jedec_dimm_reset_page0()
1087 device_printf(sc->dev, "unable to restore page: %d\n", rc); in jedec_dimm_reset_page0()
1090 return (rc); in jedec_dimm_reset_page0()
1103 int rc; in jedec_dimm_temp_sysctl() local
1110 rc = jedec_dimm_readw_be(sc, TSOD_REG_TEMPERATURE, &val); in jedec_dimm_temp_sysctl()
1111 if (rc != 0) { in jedec_dimm_temp_sysctl()
1129 rc = sysctl_handle_int(oidp, &temp, 0, req); in jedec_dimm_temp_sysctl()
1132 return (rc); in jedec_dimm_temp_sysctl()