struct kp2000_device *pcard = kudev->pcard;
u64 mask;
- lock_card(pcard);
+ mutex_lock(&pcard->sem);
mask = readq(pcard->sysinfo_regs_base + REG_INTERRUPT_MASK);
if (irq_on){
mask &= ~(1 << (kudev->cte.irq_base_num));
mask |= (1 << (kudev->cte.irq_base_num));
}
writeq(mask, pcard->sysinfo_regs_base + REG_INTERRUPT_MASK);
- unlock_card(pcard);
+ mutex_unlock(&pcard->sem);
return 0;
}
scnprintf(pcard->name, 16, "kpcard%d", pcard->card_num);
mutex_init(&pcard->sem);
- lock_card(pcard);
+ mutex_lock(&pcard->sem);
pcard->pdev = pdev;
pci_set_drvdata(pdev, pcard);
//}
dev_dbg(&pcard->pdev->dev, "kp2000_pcie_probe() complete!\n");
- unlock_card(pcard);
+ mutex_unlock(&pcard->sem);
return 0;
out11:
out4:
pci_disable_device(pcard->pdev);
out3:
- unlock_card(pcard);
+ mutex_unlock(&pcard->sem);
kfree(pcard);
return err;
}
if (pcard == NULL) return;
- lock_card(pcard);
+ mutex_lock(&pcard->sem);
kp2000_remove_cores(pcard);
mfd_remove_devices(PCARD_TO_DEV(pcard));
misc_deregister(&pcard->miscdev);
}
pci_disable_device(pcard->pdev);
pci_set_drvdata(pdev, NULL);
- unlock_card(pcard);
+ mutex_unlock(&pcard->sem);
kfree(pcard);
}
// Define this quick little macro because the expression is used frequently
#define PCARD_TO_DEV(pcard) (&(pcard->pdev->dev))
-static inline void
-lock_card(struct kp2000_device *pcard)
-{
- BUG_ON(pcard == NULL);
- mutex_lock(&pcard->sem);
-}
-static inline void
-unlock_card(struct kp2000_device *pcard)
-{
- BUG_ON(pcard == NULL);
- mutex_unlock(&pcard->sem);
-}
-
-
#endif /* KP2000_PCIE_H */