/* pci_add_save_buffer - allocate buffer for saving given capability registers @dev: the PCI device @cap: the capability to allocate the buffer for @size: requested size of the buffer  */
static int pci_add_cap_save_buffer(struct pci_dev *dev, char cap, unsigned int size)
/* pci_add_save_buffer - allocate buffer for saving given capability registers @dev: the PCI device @cap: the capability to allocate the buffer for @size: requested size of the buffer  */
static int pci_add_cap_save_buffer(struct pci_dev *dev, char cap, unsigned int size)
{
	int pos;
	struct pci_cap_saved_state *save_state;
	pos = pci_find_capability(dev, cap);
	if (pos <= 0)
		return 0;
	save_state = kzalloc(sizeof(*save_state) + size, GFP_KERNEL);
	if (!save_state)
		return -ENOMEM;
	save_state->cap_nr = cap;
	pci_add_saved_cap(dev, save_state);
	return 0;
}