public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: wsa@the-dreams.de (Wolfram Sang)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 1/3] i2c: mv64xxx: Remove useless test before clk_disable_unprepare
Date: Fri, 26 Jan 2018 18:48:27 +0100	[thread overview]
Message-ID: <20180126174827.kutntrg74avpigfr@ninjato> (raw)
In-Reply-To: <20180116163540.1092-2-gregory.clement@free-electrons.com>

On Tue, Jan 16, 2018 at 05:35:38PM +0100, Gregory CLEMENT wrote:
> The 2 functions called from clk_disable_unprepare() already check that
> the clock pointer is valid: no need to test it before calling it.

Now I get it. 'called from' != 'calling' (what I understood). But also
!= 'called by' (what I would have ecpected, but I am neither a native
speaker).

You mean "clk_disable_unprepare() is NULL pointer safe."

> 
> Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
> ---
>  drivers/i2c/busses/i2c-mv64xxx.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c
> index a832c45276a4..f69066266faa 100644
> --- a/drivers/i2c/busses/i2c-mv64xxx.c
> +++ b/drivers/i2c/busses/i2c-mv64xxx.c
> @@ -950,9 +950,7 @@ mv64xxx_i2c_probe(struct platform_device *pd)
>  exit_reset:
>  	reset_control_assert(drv_data->rstc);
>  exit_clk:
> -	/* Not all platforms have a clk */
> -	if (!IS_ERR(drv_data->clk))
> -		clk_disable_unprepare(drv_data->clk);
> +	clk_disable_unprepare(drv_data->clk);
>  
>  	return rc;
>  }
> @@ -965,9 +963,7 @@ mv64xxx_i2c_remove(struct platform_device *dev)
>  	i2c_del_adapter(&drv_data->adapter);
>  	free_irq(drv_data->irq, drv_data);
>  	reset_control_assert(drv_data->rstc);
> -	/* Not all platforms have a clk */
> -	if (!IS_ERR(drv_data->clk))
> -		clk_disable_unprepare(drv_data->clk);
> +	clk_disable_unprepare(drv_data->clk);
>  
>  	return 0;
>  }
> -- 
> 2.15.1
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180126/18797b1c/attachment-0001.sig>

  parent reply	other threads:[~2018-01-26 17:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20180116163540.1092-1-gregory.clement@free-electrons.com>
2018-01-24  6:35 ` [PATCH v4 0/3] i2c: mv64xxx: Fix clock resource for Armada 7K/8K Wolfram Sang
     [not found] ` <20180116163540.1092-2-gregory.clement@free-electrons.com>
2018-01-26 17:40   ` [PATCH v4 1/3] i2c: mv64xxx: Remove useless test before clk_disable_unprepare Wolfram Sang
2018-01-26 17:48   ` Wolfram Sang [this message]
2018-01-26 17:53   ` Wolfram Sang
     [not found] ` <20180116163540.1092-3-gregory.clement@free-electrons.com>
2018-01-26 17:53   ` [PATCH v4 2/3] i2c: mv64xxx: Fix clock resource by adding an optional bus clock Wolfram Sang
     [not found] ` <20180116163540.1092-4-gregory.clement@free-electrons.com>
2018-01-26 17:55   ` [PATCH v4 3/3] i2c: mv64xxx: Add myslef as maintainer for this driver Wolfram Sang

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=20180126174827.kutntrg74avpigfr@ninjato \
    --to=wsa@the-dreams.de \
    --cc=linux-arm-kernel@lists.infradead.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