From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752737AbdA3Md6 convert rfc822-to-8bit (ORCPT ); Mon, 30 Jan 2017 07:33:58 -0500 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:20136 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752038AbdA3Mdu (ORCPT ); Mon, 30 Jan 2017 07:33:50 -0500 From: Patrice CHOTARD To: Philipp Zabel , "linux-kernel@vger.kernel.org" CC: "linux-arm-kernel@lists.infradead.org" , Ramiro Oliveira , Mauro Carvalho Chehab Subject: Re: [PATCH 04/14] [media] st_rc: simplify optional reset handling Thread-Topic: [PATCH 04/14] [media] st_rc: simplify optional reset handling Thread-Index: AQHSeu3Zcz/eobhUFUOSa5WWiSgXe6FQ42YA Date: Mon, 30 Jan 2017 12:33:07 +0000 Message-ID: References: <20170130114116.22089-1-p.zabel@pengutronix.de> <20170130114116.22089-4-p.zabel@pengutronix.de> In-Reply-To: <20170130114116.22089-4-p.zabel@pengutronix.de> Accept-Language: fr-FR, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.75.127.49] Content-Type: text/plain; charset="Windows-1252" Content-ID: <20558CDD8832FA449B465B112DC82187@st.com> Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-01-30_08:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > Cc: Patrice Chotard > Cc: Mauro Carvalho Chehab > --- > 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 Thanks