I got Error While accessing the register space these are some peace of code

dev = pci_get_device(VENDOR_ID, DEVICE_ID, NULL);

            if (dev)
            {
                    printk("vid=%x\t did=%x\t devfn=%x\n", dev->vendor,dev->device, dev->devfn);
                    if (dev)
                    {
                            printk("GPIO card found\n");
                            // pci_find_flag = 1;
                    }
                    else
                            printk("GPIO device not found\n");

              //      pdev = pci_get_device(VENDOR_ID, DEVICE_ID, pdev);
            }               //end of while   


                if ((ret = pci_assign_resource(dev, BAR))) {
                                    printk(KERN_ERR "mlvc: pci_assign_resource failed with rc=%d\n", ret);
                                    return ret;
                            }
                            ret = pci_enable_device(dev);
                            if (ret < 0)
                            {
                                    printk("unable to enable GPIO device0\n");
                            }
                            else
                            {
                            printk("enable the device sucess=%d\n",ret);

}
baseaddr=pci_resource_start(dev, BAR);
if (baseaddr<0)
{
printk(“unable to start resources\n”);
return -1;
}
else
{
printk(“resources start avaliable=%lx\n”,baseaddr);

            }

bar_flags = pci_resource_flags(dev, BAR);
iosize = pci_resource_len (dev, BAR);

printk(“BAR %d : base : 0x%lx\n”, BAR,baseaddr);
printk(“BAR %d : len : 0x%lx\n”, BAR,iosize);
printk(“BAR %d : flags : 0x%lx\n”, BAR, bar_flags);

printk(“rtnic: set pci master\n”);
pci_set_master(dev);
if ((err = pci_set_dma_mask(dev, DMA_BIT_MASK(32))))
{
printk(“rtnic: no suitable DMA configuration, aborting\n”);
return -1;
}
if ((err = pci_set_consistent_dma_mask(dev, DMA_BIT_MASK(32))))
{
printk(“rtnic: no suitable DMA configuration, aborting\n”);
return -1;
}

    /* Request the memory region corresponding to the card */
    printk("rtnic: requesting memory region for NetFPGA-1G\n");
    if (!request_mem_region(baseaddr, iosize,DRIVER_NAME))
    {
            printk(KERN_ERR "rtnic: cannot reserve MMIO region\n");
            return -1;

}
vmem = ioremap(baseaddr, iosize);
if (!(void *)(vmem))
{
printk(“rtnic: failed to map MMIO range\n”);
return -1;
}
printk(“rtnic: map_ioaddr: 0x%x\n”,(unsigned int ) vmem);

printk(“data readb=%lx\n”,val);
val=ioread8((void*)vmem+0x74);
printk(“data readb=%lx\n”,val);
return 0;
}

-------------------------------------------------DUMP I am getting-------------------

[ 3580.278880] my_pci 0000:01:00.0: BAR 0: assigned [io 0x1000-0x10ff]
[ 3580.285341] enable the device sucess=0
[ 3580.289159] resources start avaliable=1000
[ 3580.293362] request region resources avaliable=0
[ 3580.298542] veme=262873088
[ 3580.301281] BASE ADDRESS OF CARD1=1000…
[ 3580.305340] size=100
[ 3580.307542] data readb=0
[ 3580.310109] data readb=0
[ 3580.312677] CPU4: SError detected, daif=140, spsr=0x80000045, mpidr=80000102, esr=bf000000
[ 3580.320949] CPU4: SError detected, daif=140, spsr=0x40000145, mpidr=80000102, esr=bf40c000
[ 3580.321117] ROC:IOB Machine Check Error:
[ 3580.321121] Address Type = Secure DRAM
[ 3580.321153] Address = 0x0 (Unknown Device)

Pointer to ‘struct pci_dev *’ should not be got through pci_get_device() API, instead whatever is received through arguments to the API registered for .probe() should be used.