unsigned int addr;
        int ret;
 
+       chip = get_chip_info(sdev->pdata);
+       if (!chip) {
+               dev_err(sdev->dev, "no such device supported, chip id:%x\n", pci->device);
+               return -EIO;
+       }
        adata = devm_kzalloc(sdev->dev, sizeof(struct acp_dev_data),
                             GFP_KERNEL);
        if (!adata)
        pci_set_master(pci);
 
        sdev->pdata->hw_pdata = adata;
-
-       chip = get_chip_info(sdev->pdata);
-       if (!chip) {
-               dev_err(sdev->dev, "no such device supported, chip id:%x\n", pci->device);
-               return -EIO;
-       }
-
        adata->smn_dev = pci_get_device(PCI_VENDOR_ID_AMD, chip->host_bridge_id, NULL);
        if (!adata->smn_dev) {
                dev_err(sdev->dev, "Failed to get host bridge device\n");