host-drivers/base-driver/vca/plx87xx/plx_hw.c
int plx_check_eeprom(struct plx_device *xdev)
{
	u32 val;
	u32 crc;

	val = plx_mmio_read(&xdev->mmio, PLX_EEP_STATUS_CONTROL);

	switch ((val & PLX_EEP_EEPPRSNT_MASK) >> PLX_EEP_EEPPRSNT_SHIFT) {
		case PLX_EEP_EEPPRSNT_NOT_PRESENT:
			dev_err(&xdev->pdev->dev, "EEPROM not present\n");
			return -EIO;
		case PLX_EEP_EEPRRSNT_SIGNATURE_OK:
			dev_dbg(&xdev->pdev->dev, "EEPROM present, signature valid\n");
			break;
		case PLX_EEP_EEPRRSNT_SIGNATURE_FAIL:
			dev_err(&xdev->pdev->dev, "EEPROM present, signature fail\n");
			return -EIO;
		default:
			dev_err(&xdev->pdev->dev, "Unknown EEPROM status\n");
			return -EIO;
	}

	crc = plx_mmio_read(&xdev->mmio, PLX_EEP_CRC);
	dev_info(&xdev->pdev->dev, "EEPROM CRC: 0x%08x\n", crc);

	if (val & PLX_EEP_EEPCRC_ERR_MASK) {
		dev_err(&xdev->pdev->dev, "EEPROM CRC check fail");
		return -EIO;
	}
	else {
		dev_info(&xdev->pdev->dev, "EEPROM CRC check OK\n");
	}

	return 0;
}
/*
 * plx_check_eeprom - Check EEPROM validity and content CRC
 *
 * @xdev: pointer to plx_device instance
 *
 * RETURNS: 0 on success and errno on failure
 */
Check EEPROM validity and content CRC
@xdev: pointer to plx_device instance

0 on success and errno on failure
Check EEPROM validity and content CRC @xdev : pointer to plx_device instance 0 on success and errno on failure
int plx_check_eeprom(struct plx_device *xdev)
{
	u32 val;
	u32 crc;
	val = plx_mmio_read(&xdev->mmio, PLX_EEP_STATUS_CONTROL);
	switch ((val & PLX_EEP_EEPPRSNT_MASK) >> PLX_EEP_EEPPRSNT_SHIFT) {
		case PLX_EEP_EEPPRSNT_NOT_PRESENT:
			dev_err(&xdev->pdev->dev, "EEPROM not present\n");
			return -EIO;
		case PLX_EEP_EEPRRSNT_SIGNATURE_OK:
			dev_dbg(&xdev->pdev->dev, "EEPROM present, signature valid\n");
			break;
		case PLX_EEP_EEPRRSNT_SIGNATURE_FAIL:
			dev_err(&xdev->pdev->dev, "EEPROM present, signature fail\n");
			return -EIO;
		default:
			dev_err(&xdev->pdev->dev, "Unknown EEPROM status\n");
			return -EIO;
	}
	crc = plx_mmio_read(&xdev->mmio, PLX_EEP_CRC);
	dev_info(&xdev->pdev->dev, "EEPROM CRC: 0x%08x\n", crc);
	if (val & PLX_EEP_EEPCRC_ERR_MASK) {
		dev_err(&xdev->pdev->dev, "EEPROM CRC check fail");
		return -EIO;
	}
	else {
		dev_info(&xdev->pdev->dev, "EEPROM CRC check OK\n");
	}
	return 0;
}
int plx_check_eeprom ( struct plx_device * xdev ) { u32 val ; u32 crc ; val = plx_mmio_read ( & xdev -> mmio , PLX_EEP_STATUS_CONTROL ) ; switch ( ( val & PLX_EEP_EEPPRSNT_MASK ) >> PLX_EEP_EEPPRSNT_SHIFT ) { case PLX_EEP_EEPPRSNT_NOT_PRESENT : dev_err ( & xdev -> pdev -> dev , " \n " ) ; return - EIO ; case PLX_EEP_EEPRRSNT_SIGNATURE_OK : dev_dbg ( & xdev -> pdev -> dev , " \n " ) ; break ; case PLX_EEP_EEPRRSNT_SIGNATURE_FAIL : dev_err ( & xdev -> pdev -> dev , " \n " ) ; return - EIO ; default : dev_err ( & xdev -> pdev -> dev , " \n " ) ; return - EIO ; } crc = plx_mmio_read ( & xdev -> mmio , PLX_EEP_CRC ) ; dev_info ( & xdev -> pdev -> dev , " \n " , crc ) ; if ( val & PLX_EEP_EEPCRC_ERR_MASK ) { dev_err ( & xdev -> pdev -> dev , " " ) ; return - EIO ; } else { dev_info ( & xdev -> pdev -> dev , " \n " ) ; } return 0 ; }
plx_check_eeprom - Check EEPROM validity and content CRC
 @xdev: pointer to plx_device instance
plx_check_eeprom - Check EEPROM validity and content CRC @xdev : pointer to plx_device instance