lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fdf0cbe3-ef13-4e95-668e-c586d750846c@st.com>
Date:   Mon, 30 Jan 2017 12:33:07 +0000
From:   Patrice CHOTARD <patrice.chotard@...com>
To:     Philipp Zabel <p.zabel@...gutronix.de>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
CC:     "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        Ramiro Oliveira <Ramiro.Oliveira@...opsys.com>,
        Mauro Carvalho Chehab <mchehab@...nel.org>
Subject: Re: [PATCH 04/14] [media] st_rc: simplify optional reset handling



On 01/30/2017 12:41 PM, Philipp Zabel wrote:
> As of commit bb475230b8e5 ("reset: make optional functions really
> optional"), the reset framework API calls use NULL pointers to describe
> optional, non-present reset controls.
>
> This allows to return errors from reset_control_get_optional and to call
> reset_control_(de)assert unconditionally.
>
> Signed-off-by: Philipp Zabel <p.zabel@...gutronix.de>
> Cc: Patrice Chotard <patrice.chotard@...com>
> Cc: Mauro Carvalho Chehab <mchehab@...nel.org>
> ---
>  drivers/media/rc/st_rc.c | 13 ++++++-------
>  1 file changed, 6 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/media/rc/st_rc.c b/drivers/media/rc/st_rc.c
> index 1fa0c9d1c5083..04e694b707b45 100644
> --- a/drivers/media/rc/st_rc.c
> +++ b/drivers/media/rc/st_rc.c
> @@ -165,8 +165,7 @@ static void st_rc_hardware_init(struct st_rc_device *dev)
>  	unsigned int rx_sampling_freq_div;
>
>  	/* Enable the IP */
> -	if (dev->rstc)
> -		reset_control_deassert(dev->rstc);
> +	reset_control_deassert(dev->rstc);
>
>  	clk_prepare_enable(dev->sys_clock);
>  	baseclock = clk_get_rate(dev->sys_clock);
> @@ -281,10 +280,11 @@ static int st_rc_probe(struct platform_device *pdev)
>  	else
>  		rc_dev->rx_base = rc_dev->base;
>
> -
>  	rc_dev->rstc = reset_control_get_optional(dev, NULL);
> -	if (IS_ERR(rc_dev->rstc))
> -		rc_dev->rstc = NULL;
> +	if (IS_ERR(rc_dev->rstc)) {
> +		ret = PTR_ERR(rc_dev->rstc);
> +		goto err;
> +	}
>
>  	rc_dev->dev = dev;
>  	platform_set_drvdata(pdev, rc_dev);
> @@ -353,8 +353,7 @@ static int st_rc_suspend(struct device *dev)
>  		writel(0x00, rc_dev->rx_base + IRB_RX_EN);
>  		writel(0x00, rc_dev->rx_base + IRB_RX_INT_EN);
>  		clk_disable_unprepare(rc_dev->sys_clock);
> -		if (rc_dev->rstc)
> -			reset_control_assert(rc_dev->rstc);
> +		reset_control_assert(rc_dev->rstc);
>  	}
>
>  	return 0;
>

Hi Philipp

Acked-by: Patrice Chotard <patrice.chotard@...com>

Thanks

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ