All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: James Kelly <jamespeterkelly@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	driverdev-devel@linuxdriverproject.org,
	Michal Simek <michal.simek@xilinx.com>
Subject: Re: [PATCH 03/14] staging: clocking-wizard: Split probe function
Date: Mon, 14 May 2018 16:47:26 +0300	[thread overview]
Message-ID: <20180514134726.zdl46z46qe4thx7x@mwanda> (raw)
In-Reply-To: <20180507012040.18187-4-jamespeterkelly@gmail.com>

On Mon, May 07, 2018 at 11:20:29AM +1000, James Kelly wrote:
> +static int clk_wzrd_probe(struct platform_device *pdev)
> +{
> +	int ret;
> +	struct device *dev = &pdev->dev;
> +
> +	ret = clk_wzrd_get_device_tree_data(dev);
> +	if (ret)
> +		return ret;
> +
> +	ret = clk_wzrd_regmap_alloc(dev);
> +	if (ret)
> +		return ret;
> +
> +	ret = clk_wzrd_register_ccf(dev);
> +	if (ret)
> +		return ret;
> +
> +	return 0;

The error handling is a terrible layer violation now...  Every
allocation function should have a matching free function.  But now
instead of that if clk_wzrd_register_ccf() fails then it starts cleaning
up the clk_wzrd->axi_clk that was allocated in
clk_wzrd_get_device_tree_data().

regards,
dan carpenter


_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

  reply	other threads:[~2018-05-14 13:47 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-07  1:20 [PATCH 00/14] staging: clocking-wizard: Implement many TODOs James Kelly
2018-05-07  1:20 ` [PATCH 01/14] staging: clocking-wizard: Add principles of operation James Kelly
2018-05-11  6:04   ` Michal Simek
2018-05-11  7:31     ` James Kelly
2018-05-11  7:59       ` Michal Simek
2018-05-14 13:36     ` Dan Carpenter
2018-05-07  1:20 ` [PATCH 02/14] staging: clocking-wizard: Reverse order of internal clocks James Kelly
2018-05-07  1:20 ` [PATCH 03/14] staging: clocking-wizard: Split probe function James Kelly
2018-05-14 13:47   ` Dan Carpenter [this message]
2018-05-14 14:47     ` Dan Carpenter
2018-05-14 19:30     ` James Kelly
2018-05-15  7:42       ` Dan Carpenter
2018-05-07  1:20 ` [PATCH 04/14] staging: clocking-wizard: Cosmetic cleanups James Kelly
2018-05-07  1:20 ` [PATCH 05/14] staging: clocking-wizard: Implement CCF clock provider James Kelly
2018-05-11  6:06   ` Michal Simek
2018-05-11  7:58     ` James Kelly
2018-05-11  8:05       ` Michal Simek
2018-05-07  1:20 ` [PATCH 06/14] staging: clocking-wizard: Swap CCF clock providers James Kelly
2018-05-11  6:21   ` Michal Simek
2018-05-11  6:24   ` Michal Simek
2018-05-07  1:20 ` [PATCH 07/14] staging: clocking-wizard: Add hardware constaints James Kelly
2018-05-07  1:20 ` [PATCH 08/14] staging: clocking-wizard: Support fractional ratios James Kelly
2018-05-07  5:00   ` kbuild test robot
2018-05-07  1:20 ` [PATCH 09/14] staging: clocking-wizard: Provide more information in debugfs James Kelly
2018-05-11  6:27   ` Michal Simek
2018-05-07  1:20 ` [PATCH 10/14] staging: clocking-wizard: Support clk_round_rate James Kelly
2018-05-11  6:31   ` Michal Simek
2018-05-15  7:52   ` Dan Carpenter
2018-05-15  7:56     ` Greg Kroah-Hartman
2018-05-07  1:20 ` [PATCH 11/14] staging: clocking-wizard: Support clk_set_rate James Kelly
2018-05-11  6:33   ` Michal Simek
2018-05-07  1:20 ` [PATCH 12/14] staging: clocking-wizard: Automatically set internal clock rates James Kelly
2018-05-07  1:20 ` [PATCH 13/14] staging: clocking-wizard: Automatically set input clock rate James Kelly
2018-05-07  1:20 ` [PATCH 14/14] staging: clocking-wizard: Add debugfs entries to facilitate testing James Kelly
2018-05-14 12:02 ` [PATCH 00/14] staging: clocking-wizard: Implement many TODOs Greg Kroah-Hartman
2018-05-14 19:32   ` James Kelly

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=20180514134726.zdl46z46qe4thx7x@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=driverdev-devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jamespeterkelly@gmail.com \
    --cc=michal.simek@xilinx.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.