mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Bryan O'Donoghue" <pure.logic@nexus-software.ie>
To: "Dan O'Donovan" <dan@emutex.com>,
	platform-driver-x86@vger.kernel.org, dvhart@infradead.org
Cc: lee.jones@linaro.org, andriy.shevchenko@linux.intel.com,
	mika.westerberg@linux.intel.com, linux-kernel@vger.kernel.org
Subject: Re: [RESEND RFC PATCH 1/5] platform: x86: add driver for UP Board I/O CPLD
Date: Fri, 08 Jul 2016 18:05:45 +0100	[thread overview]
Message-ID: <1467997545.17253.143.camel@nexus-software.ie> (raw)
In-Reply-To: <1467648434-29080-2-git-send-email-dan@emutex.com>

On Mon, 2016-07-04 at 17:07 +0100, Dan O'Donovan wrote:
> +	cpld->pinctrl_pdev =
> +		platform_device_register_data(dev, "up-board-
> pinctrl",
> +					      PLATFORM_DEVID_NONE,
> +					      &up_board_pinctrl_pdat
> a,
> +					      sizeof(up_board_pinctr
> l_pdata));
> +	if (IS_ERR(cpld->pinctrl_pdev)) {
> +		ret = PTR_ERR(cpld->pinctrl_pdev);
> +		goto fail_register_pinctrl_pdev;
> +	}
> +
> +	cpld->gpio_pdev =
> +		platform_device_register_data(dev, "up-board-gpio",
> +					      PLATFORM_DEVID_NONE,
> +					      &up_board_gpio_pdata,
> +					      sizeof(up_board_gpio_p
> data));
> +	if (IS_ERR(cpld->gpio_pdev)) {
> +		ret = PTR_ERR(cpld->gpio_pdev);
> +		goto fail_register_gpio_pdev;
> +	}
> +
> +	cpld->leds_pdev =
> +		platform_device_register_data(dev, "up-board-leds",
> +					      PLATFORM_DEVID_NONE,
> +					      &up_board_leds_pdata,
> +					      sizeof(up_board_leds_p
> data));
> +	if (IS_ERR(cpld->leds_pdev)) {
> +		ret = PTR_ERR(cpld->leds_pdev);
> +		goto fail_register_leds_pdev;
> +	}
> +
> +	return 0;
> +
> +fail_register_leds_pdev:
> +	platform_device_unregister(cpld->gpio_pdev);
> +fail_register_gpio_pdev:
> +	platform_device_unregister(cpld->pinctrl_pdev);
> +fail_register_pinctrl_pdev:

Because the subordinate drivers don't have remove routines if any of
these error paths are triggered you'll leak resources. Recommend adding
cleanup exit routines to the subordinate drivers which should then be
triggered on the failure jumps here.

---
bod

  parent reply	other threads:[~2016-07-08 17:05 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1465762392-9205-1-git-send-email-dan@emutex.com>
2016-07-04 16:07 ` [RESEND RFC PATCH 0/5] platform drivers for UP Board Dan O'Donovan
2016-07-04 16:07   ` [RESEND RFC PATCH 1/5] platform: x86: add driver for UP Board I/O CPLD Dan O'Donovan
2016-07-07 13:43     ` Bryan O'Donoghue
2016-07-08 17:05     ` Bryan O'Donoghue [this message]
2016-07-22 20:52     ` Darren Hart
2016-07-22 21:11       ` Paul Gortmaker
2016-07-04 16:07   ` [RESEND RFC PATCH 2/5] platform: x86: add UP Board I/O pinctrl driver Dan O'Donovan
2016-07-04 16:07   ` [RESEND RFC PATCH 3/5] platform: x86: add UP Board I/O gpio driver Dan O'Donovan
2016-07-04 16:07   ` [RESEND RFC PATCH 4/5] platform: x86: add UP Board CPLD LED driver Dan O'Donovan
2016-07-04 16:07   ` [RESEND RFC PATCH 5/5] platform: x86: add platform driver for UP Board Dan O'Donovan
2016-07-07  1:57     ` Bryan O'Donoghue
2016-07-04 16:17   ` [RESEND RFC PATCH 0/5] platform drivers " Andy Shevchenko
2016-09-13  9:42   ` Andy Shevchenko
2016-09-13  9:55     ` Mika Westerberg
2016-09-13 21:51     ` Dan O'Donovan

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=1467997545.17253.143.camel@nexus-software.ie \
    --to=pure.logic@nexus-software.ie \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=dan@emutex.com \
    --cc=dvhart@infradead.org \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=platform-driver-x86@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®