public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa@the-dreams.de>
To: Gregory CLEMENT <gregory.clement@free-electrons.com>
Cc: "Thomas Petazzoni" <thomas.petazzoni@free-electrons.com>,
	"Andrew Lunn" <andrew@lunn.ch>,
	"Jason Cooper" <jason@lakedaemon.net>,
	"Igal Liberman" <igall@marvell.com>,
	"Antoine Tenart" <antoine.tenart@free-electrons.com>,
	"Omri Itach" <omrii@marvell.com>,
	"Nadav Haklai" <nadavh@marvell.com>,
	"Shadi Ammouri" <shadi@marvell.com>,
	linux-i2c@vger.kernel.org,
	"Miquèl Raynal" <miquel.raynal@free-electrons.com>,
	"Marcin Wojtas" <mw@semihalf.com>,
	"Hanna Hawa" <hannah@marvell.com>,
	linux-arm-kernel@lists.infradead.org,
	"Sebastian Hesselbarth" <sebastian.hesselbarth@gmail.com>
Subject: Re: [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>


[-- Attachment #1.1: Type: text/plain, Size: 1558 bytes --]

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
> 

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-16 16:35 [PATCH v4 0/3] i2c: mv64xxx: Fix clock resource for Armada 7K/8K Gregory CLEMENT
2018-01-16 16:35 ` [PATCH v4 1/3] i2c: mv64xxx: Remove useless test before clk_disable_unprepare Gregory CLEMENT
2018-01-26 17:40   ` Wolfram Sang
2018-01-26 17:48   ` Wolfram Sang [this message]
2018-01-26 17:53   ` Wolfram Sang
2018-01-16 16:35 ` [PATCH v4 2/3] i2c: mv64xxx: Fix clock resource by adding an optional bus clock Gregory CLEMENT
2018-01-26 17:53   ` Wolfram Sang
2018-01-16 16:35 ` [PATCH v4 3/3] i2c: mv64xxx: Add myslef as maintainer for this driver Gregory CLEMENT
2018-01-26 17:55   ` Wolfram Sang
2018-01-24  6:35 ` [PATCH v4 0/3] i2c: mv64xxx: Fix clock resource for Armada 7K/8K 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=andrew@lunn.ch \
    --cc=antoine.tenart@free-electrons.com \
    --cc=gregory.clement@free-electrons.com \
    --cc=hannah@marvell.com \
    --cc=igall@marvell.com \
    --cc=jason@lakedaemon.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=miquel.raynal@free-electrons.com \
    --cc=mw@semihalf.com \
    --cc=nadavh@marvell.com \
    --cc=omrii@marvell.com \
    --cc=sebastian.hesselbarth@gmail.com \
    --cc=shadi@marvell.com \
    --cc=thomas.petazzoni@free-electrons.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox