[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 03 Mar 2009 21:29:42 +0100
From: Jiri Slaby <jirislaby@...il.com>
To: Mark Brown <broonie@...nsource.wolfsonmicro.com>
CC: Dmitry Torokhov <dmitry.torokhov@...il.com>,
linux-input@...r.kernel.org, linux-kernel@...r.kernel.org,
Hans-Christian Egtvedt <hcegtvedt@...el.com>
Subject: Re: [PATCH 5/5] Input: add wm97xx accelerated driver for AVR32 AT32AP700X
microprocessors
On 3.3.2009 19:24, Mark Brown wrote:
> +static irqreturn_t at32_wm97xx_channel_b_interrupt(int irq, void *dev_id)
> +{
> + struct at32_wm97xx *at32_wm97xx = dev_id;
> + struct wm97xx *wm = at32_wm97xx->wm;
> + int status = ac97c_readl(at32_wm97xx, CBSR);
> + int retval = IRQ_NONE;
Just a nit, irqreturn_t will become enum one day AFAIK. Use irqreturn_t
which is guaranteed to be the proper type instead. This rather a
suggestion for followup fixup.
> +static int __init at32_wm97xx_probe(struct platform_device *pdev)
> +{
> + struct wm97xx *wm = platform_get_drvdata(pdev);
> + struct at32_wm97xx *at32_wm97xx;
> + int ret;
> +
> + at32_wm97xx = kzalloc(sizeof(struct at32_wm97xx), GFP_KERNEL);
> + if (!at32_wm97xx) {
> + dev_dbg(&pdev->dev, "out of memory\n");
> + return -ENOMEM;
> + }
> +
> + at32_wm97xx->wm = wm;
> + at32_wm97xx->regs = (void *)AT32_WM97XX_AC97C_IOMEM;
> + at32_wm97xx->ac97c_irq = AT32_WM97XX_AC97C_IRQ;
> + at32_wm97xx->gpio_pen = at32_gpio_line;
> + at32_wm97xx->gpio_irq = gpio_to_irq(at32_wm97xx->gpio_pen);
> +
> + setup_timer(&at32_wm97xx->pen_timer, at32_wm97xx_pen_timer,
> + (unsigned long)at32_wm97xx);
> +
> + ret = request_irq(at32_wm97xx->ac97c_irq,
> + at32_wm97xx_channel_b_interrupt,
> + IRQF_SHARED, "at32-wm97xx-ch-b", at32_wm97xx);
> + if (ret) {
> + dev_dbg(&pdev->dev, "could not request ac97c irq\n");
at32_wm97xx leak. I didn't notice last time.
> + return ret;
> + }
> +
> + platform_set_drvdata(pdev, at32_wm97xx);
> +
> + return wm97xx_register_mach_ops(wm,&at32_mach_ops);
On failure, this will still "leak" irq, I suppose this is what you
referred as "fix later" in 0/5.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists