lkml.org 
[lkml]   [2009]   [Mar]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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.


\
 
 \ /
  Last update: 2009-03-03 21:33    [W:0.057 / U:3.724 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site