Re: [PATCH] mtd: orion_nand: fix error code path in probe

2014-10-15 Thread Michael Opdenacker
On 10/14/2014 11:35 PM, Andrew Lunn wrote: > > > if (pdev->dev.of_node) { > board = devm_kzalloc(&pdev->dev, sizeof(struct orion_nand_data), > GFP_KERNEL); > if (!board) { > - ret = -ENOMEM; > -

Re: [PATCH] mtd: orion_nand: fix error code path in probe

2014-10-15 Thread Michael Opdenacker
Andrew, Ezequiel, Many thanks for your review! On 10/15/2014 11:39 PM, Ezequiel Garcia wrote: > On 14 Oct 11:35 PM, Andrew Lunn wrote: > >> Hi Michael >> >> It is quite a common pattern to use: >> >> res = platform_get_resource(dev, IORESOURCE_MEM, 0); >> c->membase = devm_ioremap

Re: [PATCH] mtd: orion_nand: fix error code path in probe

2014-10-15 Thread Ezequiel Garcia
On 14 Oct 11:35 PM, Andrew Lunn wrote: > On Tue, Oct 14, 2014 at 04:16:38PM +0200, Michael Opdenacker wrote: > > This replaces kzalloc() and ioremap() calls by > > the corresponding devm_ functions in the probe() routine, > > which automatically release the corresponding resources > > when probe()

Re: [PATCH] mtd: orion_nand: fix error code path in probe

2014-10-14 Thread Andrew Lunn
On Tue, Oct 14, 2014 at 04:16:38PM +0200, Michael Opdenacker wrote: > This replaces kzalloc() and ioremap() calls by > the corresponding devm_ functions in the probe() routine, > which automatically release the corresponding resources > when probe() fails or when the device is removed. > > This si