From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Michael Ellerman <michael@ellerman.id.au>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: [PATCH 2/4] Simplify error logic in rtas_setup_msi_irqs()
Date: Tue, 02 Oct 2007 15:21:59 +1000 [thread overview]
Message-ID: <1191302519.6310.86.camel@pasglop> (raw)
In-Reply-To: <9a0ebd42c2e31f6a99a1028dd370f9ee36c771f3.1190270165.git.michael@ellerman.id.au>
On Thu, 2007-09-20 at 16:36 +1000, Michael Ellerman wrote:
> rtas_setup_msi_irqs() doesn't need to call teardown() itself,
> the generic code will do this for us as long as we return a non
> zero value.
>
> Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> ---
> arch/powerpc/platforms/pseries/msi.c | 17 +++--------------
> 1 files changed, 3 insertions(+), 14 deletions(-)
>
> diff --git a/arch/powerpc/platforms/pseries/msi.c b/arch/powerpc/platforms/pseries/msi.c
> index 6063ea2..9c3bcfe 100644
> --- a/arch/powerpc/platforms/pseries/msi.c
> +++ b/arch/powerpc/platforms/pseries/msi.c
> @@ -189,29 +189,22 @@ static int rtas_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
>
> if (rc != nvec) {
> pr_debug("rtas_msi: rtas_change_msi() failed\n");
> -
> - /*
> - * In case of an error it's not clear whether the device is
> - * left with MSI enabled or not, so we explicitly disable.
> - */
> - goto out_free;
> + return rc;
> }
>
> i = 0;
> list_for_each_entry(entry, &pdev->msi_list, list) {
> hwirq = rtas_query_irq_number(pdn, i);
> if (hwirq < 0) {
> - rc = hwirq;
> pr_debug("rtas_msi: error (%d) getting hwirq\n", rc);
> - goto out_free;
> + return hwirq;
> }
>
> virq = irq_create_mapping(NULL, hwirq);
>
> if (virq == NO_IRQ) {
> pr_debug("rtas_msi: Failed mapping hwirq %d\n", hwirq);
> - rc = -ENOSPC;
> - goto out_free;
> + return -ENOSPC;
> }
>
> dev_dbg(&pdev->dev, "rtas_msi: allocated virq %d\n", virq);
> @@ -220,10 +213,6 @@ static int rtas_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
> }
>
> return 0;
> -
> - out_free:
> - rtas_teardown_msi_irqs(pdev);
> - return rc;
> }
>
> static void rtas_msi_pci_irq_fixup(struct pci_dev *pdev)
next prev parent reply other threads:[~2007-10-02 5:22 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-20 6:36 [PATCH 1/4] Simplify error logic in u3msi_setup_msi_irqs() Michael Ellerman
2007-09-20 6:36 ` [PATCH 2/4] Simplify error logic in rtas_setup_msi_irqs() Michael Ellerman
2007-10-02 5:21 ` Benjamin Herrenschmidt [this message]
2007-09-20 6:36 ` [PATCH 3/4] Simplify rtas_change_msi() error semantics Michael Ellerman
2007-10-02 5:23 ` Benjamin Herrenschmidt
2007-10-02 5:58 ` Michael Ellerman
2007-10-02 6:24 ` Benjamin Herrenschmidt
2007-10-02 7:40 ` Michael Ellerman
2007-10-02 8:37 ` Benjamin Herrenschmidt
2007-09-20 6:36 ` [PATCH 4/4] Inline u3msi_compose_msi_msg() Michael Ellerman
2007-10-02 5:24 ` Benjamin Herrenschmidt
2007-10-02 5:21 ` [PATCH 1/4] Simplify error logic in u3msi_setup_msi_irqs() Benjamin Herrenschmidt
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=1191302519.6310.86.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=michael@ellerman.id.au \
/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).