[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1467997545.17253.143.camel@nexus-software.ie>
Date: Fri, 08 Jul 2016 18:05:45 +0100
From: Bryan O'Donoghue <pure.logic@...us-software.ie>
To: Dan O'Donovan <dan@...tex.com>,
platform-driver-x86@...r.kernel.org, dvhart@...radead.org
Cc: lee.jones@...aro.org, andriy.shevchenko@...ux.intel.com,
mika.westerberg@...ux.intel.com, linux-kernel@...r.kernel.org
Subject: Re: [RESEND RFC PATCH 1/5] platform: x86: add driver for UP Board
I/O CPLD
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
Powered by blists - more mailing lists