Re: [PATCH] wan: lmc: Switch to using managed resources

2016-03-02 Thread David Miller
From: Amitoj Kaur Chawla Date: Wed, 2 Mar 2016 19:52:42 +0530 > Specifically, pcim_release contains the following code: How incredibly unintuitive that PCI helper functions magically become managed just because a driver invoked pcim_enable_device(). Well, if that's what is it, that's what it is

Re: [PATCH] wan: lmc: Switch to using managed resources

2016-03-02 Thread Amitoj Kaur Chawla
On Wed, Mar 2, 2016 at 3:51 AM, David Miller wrote: > From: Amitoj Kaur Chawla > Date: Sat, 27 Feb 2016 22:34:16 +0530 > >> @@ -835,23 +835,20 @@ static int lmc_init_one(struct pci_dev *pdev, const >> struct pci_device_id *ent) >> err = pci_request_regions(pdev, "lmc"); >> if (err) {

Re: [PATCH] wan: lmc: Switch to using managed resources

2016-03-01 Thread David Miller
From: Amitoj Kaur Chawla Date: Sat, 27 Feb 2016 22:34:16 +0530 > @@ -835,23 +835,20 @@ static int lmc_init_one(struct pci_dev *pdev, const > struct pci_device_id *ent) > err = pci_request_regions(pdev, "lmc"); > if (err) { > printk(KERN_ERR "lmc: pci_request_region fail

[PATCH] wan: lmc: Switch to using managed resources

2016-02-27 Thread Amitoj Kaur Chawla
Use managed resource functions devm_kzalloc and pcim_enable_device to simplify error handling. Subsequently, remove unnecessary kfree, pci_disable_device and pci_release_regions. To be compatible with the change, various gotos are replaced with direct returns and unneeded labels are dropped. Also