From: Artem Bityutskiy <dedekind1@gmail.com>
To: b35362@freescale.com
Cc: Artem.Bityutskiy@nokia.com, r58472@freescale.com,
linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
linux-mtd@lists.infradead.org, scottwood@freescale.com,
akpm@linux-foundation.org, dwmw2@infradead.org
Subject: Re: [PATCH v2] Integrated Flash Controller support
Date: Tue, 29 Nov 2011 23:36:52 +0200 [thread overview]
Message-ID: <1322602615.2150.7.camel@koala> (raw)
In-Reply-To: <1320053901-23801-1-git-send-email-b35362@freescale.com>
On Mon, 2011-10-31 at 17:38 +0800, b35362@freescale.com wrote:
> +/*
> + * fsl_ifc_ctrl_probe
> + *
> + * called by device layer when it finds a device matching
> + * one our driver can handled. This code allocates all of
> + * the resources needed for the controller only. The
> + * resources for the NAND banks themselves are allocated
> + * in the chip probe function.
> +*/
> +static int __devinit fsl_ifc_ctrl_probe(struct platform_device *dev)
> +{
> + int ret = 0;
> +
> +
... snip ...
I am concerned about the error path in this function
> + init_waitqueue_head(&fsl_ifc_ctrl_dev->nand_wait);
> +
> + ret = request_irq(fsl_ifc_ctrl_dev->irq, fsl_ifc_ctrl_irq, IRQF_SHARED,
> + "fsl-ifc", fsl_ifc_ctrl_dev);
> + if (ret != 0) {
> + dev_err(&dev->dev, "failed to install irq (%d)\n",
> + fsl_ifc_ctrl_dev->irq);
> + goto err;
> + }
irq_dispose_mapping() on error path?
> +
> + ret = request_irq(fsl_ifc_ctrl_dev->nand_irq, fsl_ifc_nand_irq, 0,
> + "fsl-ifc-nand", fsl_ifc_ctrl_dev);
> + if (ret != 0) {
> + dev_err(&dev->dev, "failed to install irq (%d)\n",
> + fsl_ifc_ctrl_dev->nand_irq);
> + goto err;
free_irq() on error path?
> + }
> +
> + return 0;
> +
> +err:
> + return ret;
> +}
> +static __init int fsl_ifc_init(void)
> +{
> + int ret;
> +
> + ret = platform_driver_register(&fsl_ifc_ctrl_driver);
> + if (ret)
> + printk(KERN_ERR "fsl-ifc: Failed to register platform"
> + "driver\n");
> +
> + return ret;
> +}
> +
> +static void __exit fsl_ifc_exit(void)
> +{
> + platform_driver_unregister(&fsl_ifc_ctrl_driver);
> +}
> +
> +module_init(fsl_ifc_init);
> +module_exit(fsl_ifc_exit);
How about using module_platform_driver() instead?
WARNING: multiple messages have this Message-ID (diff)
From: Artem Bityutskiy <dedekind1@gmail.com>
To: b35362@freescale.com
Cc: dwmw2@infradead.org, Artem.Bityutskiy@nokia.com,
r58472@freescale.com, linux-kernel@vger.kernel.org,
linux-mtd@lists.infradead.org, scottwood@freescale.com,
akpm@linux-foundation.org, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v2] Integrated Flash Controller support
Date: Tue, 29 Nov 2011 23:36:52 +0200 [thread overview]
Message-ID: <1322602615.2150.7.camel@koala> (raw)
In-Reply-To: <1320053901-23801-1-git-send-email-b35362@freescale.com>
On Mon, 2011-10-31 at 17:38 +0800, b35362@freescale.com wrote:
> +/*
> + * fsl_ifc_ctrl_probe
> + *
> + * called by device layer when it finds a device matching
> + * one our driver can handled. This code allocates all of
> + * the resources needed for the controller only. The
> + * resources for the NAND banks themselves are allocated
> + * in the chip probe function.
> +*/
> +static int __devinit fsl_ifc_ctrl_probe(struct platform_device *dev)
> +{
> + int ret = 0;
> +
> +
... snip ...
I am concerned about the error path in this function
> + init_waitqueue_head(&fsl_ifc_ctrl_dev->nand_wait);
> +
> + ret = request_irq(fsl_ifc_ctrl_dev->irq, fsl_ifc_ctrl_irq, IRQF_SHARED,
> + "fsl-ifc", fsl_ifc_ctrl_dev);
> + if (ret != 0) {
> + dev_err(&dev->dev, "failed to install irq (%d)\n",
> + fsl_ifc_ctrl_dev->irq);
> + goto err;
> + }
irq_dispose_mapping() on error path?
> +
> + ret = request_irq(fsl_ifc_ctrl_dev->nand_irq, fsl_ifc_nand_irq, 0,
> + "fsl-ifc-nand", fsl_ifc_ctrl_dev);
> + if (ret != 0) {
> + dev_err(&dev->dev, "failed to install irq (%d)\n",
> + fsl_ifc_ctrl_dev->nand_irq);
> + goto err;
free_irq() on error path?
> + }
> +
> + return 0;
> +
> +err:
> + return ret;
> +}
> +static __init int fsl_ifc_init(void)
> +{
> + int ret;
> +
> + ret = platform_driver_register(&fsl_ifc_ctrl_driver);
> + if (ret)
> + printk(KERN_ERR "fsl-ifc: Failed to register platform"
> + "driver\n");
> +
> + return ret;
> +}
> +
> +static void __exit fsl_ifc_exit(void)
> +{
> + platform_driver_unregister(&fsl_ifc_ctrl_driver);
> +}
> +
> +module_init(fsl_ifc_init);
> +module_exit(fsl_ifc_exit);
How about using module_platform_driver() instead?
next prev parent reply other threads:[~2011-11-29 21:37 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-31 9:38 [PATCH v2] Integrated Flash Controller support b35362
2011-10-31 9:38 ` b35362
2011-10-31 9:38 ` [PATCH] mtd/nand : set Nand flash page address to FBAR and FPAR correctly b35362
2011-10-31 9:38 ` b35362
2011-10-31 9:38 ` [PATCH 2/2] NAND Machine support for Integrated Flash Controller b35362
2011-10-31 9:38 ` b35362
2011-11-23 3:41 ` [PATCH v2] Integrated Flash Controller support Kumar Gala
2011-11-23 3:41 ` Kumar Gala
2011-11-23 3:41 ` Kumar Gala
2011-11-24 14:24 ` Kumar Gala
2011-11-24 14:24 ` Kumar Gala
2011-11-24 14:24 ` Kumar Gala
2011-11-29 21:40 ` Artem Bityutskiy
2011-11-29 21:40 ` Artem Bityutskiy
2011-11-29 21:48 ` Scott Wood
2011-11-29 21:48 ` Scott Wood
2011-11-29 21:48 ` Scott Wood
2011-11-30 1:47 ` Kumar Gala
2011-11-30 1:47 ` Kumar Gala
2011-11-30 1:47 ` Kumar Gala
2011-11-30 8:51 ` Artem Bityutskiy
2011-11-30 8:51 ` Artem Bityutskiy
2011-12-14 11:13 ` Li Yang-R58472
2011-12-14 11:13 ` Li Yang-R58472
2011-12-14 11:13 ` Li Yang-R58472
2011-12-17 16:40 ` Artem Bityutskiy
2011-12-17 16:40 ` Artem Bityutskiy
2011-12-17 16:40 ` Artem Bityutskiy
2011-11-29 21:36 ` Artem Bityutskiy [this message]
2011-11-29 21:36 ` Artem Bityutskiy
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=1322602615.2150.7.camel@koala \
--to=dedekind1@gmail.com \
--cc=Artem.Bityutskiy@nokia.com \
--cc=akpm@linux-foundation.org \
--cc=b35362@freescale.com \
--cc=dwmw2@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=r58472@freescale.com \
--cc=scottwood@freescale.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.