Re: [PATCH 5/5] Input: add wm97xx accelerated driver for AVR32 AT32AP700X microprocessors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux