From: Moritz Fischer <mdf@kernel.org>
To: Moritz Fischer <mdf@kernel.org>
Cc: davem@davemloft.net, snelson@pensando.io, mst@redhat.com,
hkallweit1@gmail.com, netdev@vger.kernel.org,
linux-parisc@vger.kernel.org, linux-kernel@vger.kernel.org,
moritzf@google.com
Subject: Re: [PATCH net-next 2/3] net: dec: tulip: de2104x: Replace pci_enable_device with devres version
Date: Sun, 13 Sep 2020 20:04:43 -0700 [thread overview]
Message-ID: <20200914030443.GA12542@archbook> (raw)
In-Reply-To: <20200914001002.8623-3-mdf@kernel.org>
On Sun, Sep 13, 2020 at 05:10:01PM -0700, Moritz Fischer wrote:
> Replace pci_enable_device() with its devres counterpart
> pcim_enable_device().
>
> Signed-off-by: Moritz Fischer <mdf@kernel.org>
> ---
> drivers/net/ethernet/dec/tulip/de2104x.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/ethernet/dec/tulip/de2104x.c b/drivers/net/ethernet/dec/tulip/de2104x.c
> index 9bcfc82b71d1..e4189c45c2ba 100644
> --- a/drivers/net/ethernet/dec/tulip/de2104x.c
> +++ b/drivers/net/ethernet/dec/tulip/de2104x.c
> @@ -2009,14 +2009,14 @@ static int de_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
> netif_carrier_off(dev);
>
> /* wake up device, assign resources */
> - rc = pci_enable_device(pdev);
> + rc = pcim_enable_device(pdev);
> if (rc)
> return rc;
>
> /* reserve PCI resources to ensure driver atomicity */
> rc = pci_request_regions(pdev, DRV_NAME);
> if (rc)
> - goto err_out_disable;
> + return rc;
>
> /* check for invalid IRQ value */
> if (pdev->irq < 2) {
> @@ -2096,8 +2096,6 @@ static int de_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
> iounmap(regs);
> err_out_res:
> pci_release_regions(pdev);
> -err_out_disable:
> - pci_disable_device(pdev);
> return rc;
> }
>
> @@ -2111,7 +2109,6 @@ static void de_remove_one(struct pci_dev *pdev)
> kfree(de->ee_data);
> iounmap(de->regs);
> pci_release_regions(pdev);
> - pci_disable_device(pdev);
> }
>
> #ifdef CONFIG_PM
> --
> 2.28.0
>
Ugh, sorry for the noise, I missed the instances in the suspend/resume.
Let me resend a v2 of this ...
Thanks,
Moritz
next prev parent reply other threads:[~2020-09-14 3:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-14 0:09 [PATCH net-next 0/3] First bunch of cleanups Moritz Fischer
2020-09-14 0:10 ` [PATCH net-next 1/3] net: dec: tulip: de2104x: Replace alloc_etherdev by devm_alloc_etherdev Moritz Fischer
2020-09-14 0:10 ` [PATCH net-next 2/3] net: dec: tulip: de2104x: Replace pci_enable_device with devres version Moritz Fischer
2020-09-14 3:04 ` Moritz Fischer [this message]
2020-09-14 0:10 ` [PATCH net-next 3/3] net: dec: tulip: de2104x: Replace kmemdup() with devm_kmempdup() Moritz Fischer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200914030443.GA12542@archbook \
--to=mdf@kernel.org \
--cc=davem@davemloft.net \
--cc=hkallweit1@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-parisc@vger.kernel.org \
--cc=moritzf@google.com \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=snelson@pensando.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).