From: Felipe Balbi <balbi@ti.com>
To: Alan Cox <alan@linux.intel.com>
Cc: <arve@android.com>, <x86@kernel.org>,
<linux-kernel@vger.kernel.org>, <mikechan@google.com>
Subject: Re: [PATCH 02/10] goldfish: add the goldfish virtual bus
Date: Wed, 16 Jan 2013 18:57:54 +0200 [thread overview]
Message-ID: <20130116165754.GA6377@arwen.pp.htv.fi> (raw)
In-Reply-To: <20130116165850.15183.72063.stgit@bob.linux.org.uk>
[-- Attachment #1: Type: text/plain, Size: 2129 bytes --]
Hi,
On Wed, Jan 16, 2013 at 04:58:51PM +0000, Alan Cox wrote:
> +static irqreturn_t goldfish_pdev_bus_interrupt(int irq, void *dev_id)
> +{
> + irqreturn_t ret = IRQ_NONE;
> + while (1) {
> + u32 op = readl(pdev_bus_base + PDEV_BUS_OP);
> + switch (op) {
> + case PDEV_BUS_OP_DONE:
> + return IRQ_NONE;
> +
> + case PDEV_BUS_OP_REMOVE_DEV:
> + goldfish_pdev_remove();
> + break;
> +
> + case PDEV_BUS_OP_ADD_DEV:
> + goldfish_new_pdev();
> + break;
> + }
> + ret = IRQ_HANDLED;
> + }
missing a return ret here ?
> +}
> +
> +static int goldfish_pdev_bus_probe(struct platform_device *pdev)
> +{
> + int ret;
> + struct resource *r;
> +
> + r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> + if (r == NULL)
> + return -EINVAL;
> +
> + pdev_bus_addr = r->start;
> + pdev_bus_len = resource_size(r);
> +
> + if (request_region(pdev_bus_addr, pdev_bus_len, "goldfish")) {
> + pr_err("unable to reserve Goldfish MMIO.\n");
> + return -EBUSY;
> + }
> +
> + pdev_bus_base = ioremap(pdev_bus_addr, pdev_bus_len);
how about converting the two above to devm_request_and_ioremap() ?
> + if (pdev_bus_base == NULL) {
> + ret = -ENOMEM;
> + pr_err("unable to map Goldfish MMIO.\n");
> + goto free_resources;
> + }
> +
> + r = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
> + if (r == NULL) {
> + ret = -ENOENT;
> + goto free_map;
> + }
> +
> + pdev_bus_irq = r->start;
> +
> + ret = request_irq(pdev_bus_irq, goldfish_pdev_bus_interrupt,
and here to devm_request_irq() ...
> + IRQF_SHARED, "goldfish_pdev_bus", pdev);
> + if (ret)
> + goto free_map;
> +
> + writel(PDEV_BUS_OP_INIT, pdev_bus_base + PDEV_BUS_OP);
> + return 0;
> +
> +free_map:
> + iounmap(pdev_bus_base);
> +free_resources:
> + release_region(pdev_bus_addr, pdev_bus_len);
> + return ret;
> +}
> +
> +static int goldfish_pdev_bus_remove(struct platform_device *pdev)
> +{
> + iounmap(pdev_bus_base);
> + free_irq(pdev_bus_irq, pdev);
> + release_region(pdev_bus_addr, pdev_bus_len);
your remove would, then, be an empty function.
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2013-01-16 16:58 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-16 16:58 [PATCH 00/10] goldfish: still swimming Alan Cox
2013-01-16 16:58 ` [PATCH 01/10] goldfish: definitions for Goldfish on x86 platforms Alan Cox
2013-01-16 16:58 ` [PATCH 02/10] goldfish: add the goldfish virtual bus Alan Cox
2013-01-16 16:57 ` Felipe Balbi [this message]
2013-01-16 16:59 ` [PATCH 03/10] goldfish: tty driver Alan Cox
2013-01-16 17:01 ` Felipe Balbi
2013-01-16 18:25 ` Alan Cox
2013-01-17 8:41 ` Felipe Balbi
2013-01-16 16:59 ` [PATCH 04/10] goldfish: virtual input event driver Alan Cox
2013-01-16 17:13 ` Felipe Balbi
2013-01-16 16:59 ` [PATCH 05/10] goldfish: framebuffer Alan Cox
2013-01-16 16:59 ` [PATCH 06/10] goldfish: emulated MMC device Alan Cox
2013-01-16 17:18 ` Felipe Balbi
2013-01-16 17:27 ` Alan Cox
2013-01-16 17:26 ` Felipe Balbi
2013-01-16 16:59 ` [PATCH 07/10] goldfish: power device Alan Cox
2013-01-16 17:00 ` [PATCH 08/10] goldfish: real time clock Alan Cox
2013-01-16 17:00 ` [PATCH 09/10] goldfish: add QEMU pipe driver Alan Cox
2013-01-16 17:00 ` [PATCH 10/10] goldfish: NAND flash driver Alan Cox
-- strict thread matches above, loose matches on Subject: below --
2013-01-17 17:53 [PATCH 00/10] goldish: onwards, upwards 8) Alan Cox
2013-01-17 17:54 ` [PATCH 02/10] goldfish: add the goldfish virtual bus Alan Cox
2013-01-09 14:22 [PATCH 00/10] goldfish: rebase/resend versus current -next Alan Cox
2013-01-09 14:23 ` [PATCH 02/10] goldfish: add the goldfish virtual bus Alan Cox
2013-01-09 22:30 ` Arnd Bergmann
2013-01-10 15:54 ` Alan Cox
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=20130116165754.GA6377@arwen.pp.htv.fi \
--to=balbi@ti.com \
--cc=alan@linux.intel.com \
--cc=arve@android.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mikechan@google.com \
--cc=x86@kernel.org \
/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
all inboxes | Powered by JetHome®