From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1D1EFC55191 for ; Thu, 23 Apr 2020 07:56:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0641B21569 for ; Thu, 23 Apr 2020 07:56:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726312AbgDWH4F (ORCPT ); Thu, 23 Apr 2020 03:56:05 -0400 Received: from mga04.intel.com ([192.55.52.120]:21960 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725562AbgDWH4E (ORCPT ); Thu, 23 Apr 2020 03:56:04 -0400 IronPort-SDR: 9q1XsrS7ReNvW3PVd2iLaDYK+pyRmnRIQ7Zsm7z9YFVu0j0jrdDwo17T+VfARP2fgSyV/FgZtm TmySfglMIOeA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Apr 2020 00:56:04 -0700 IronPort-SDR: r+jLurLD/ryur1rbMtyce0xKOEJmXIaoqKT5V0T+RrNwOh9LVjOo744jmIAT0wOwTME4+gLANB 0TwumWeKu/hg== X-IronPort-AV: E=Sophos;i="5.73,306,1583222400"; d="scan'208";a="430232630" Received: from paasikivi.fi.intel.com ([10.237.72.42]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Apr 2020 00:56:00 -0700 Received: by paasikivi.fi.intel.com (Postfix, from userid 1000) id 9B42C2080B; Thu, 23 Apr 2020 10:55:57 +0300 (EEST) Date: Thu, 23 Apr 2020 10:55:57 +0300 From: Sakari Ailus To: Roman Kovalivskyi Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Luis Oliveira , Niklas =?iso-8859-1?Q?S=F6derlund?= , Jacopo Mondi , Michael Rodin , Mauro Carvalho Chehab , Hugues Fruchet , Maxime Ripard , Adam Ford , Todor Tomov , Suresh Udipi , Andrew Gabbasov , Eugeniu Rosca , Dave Stevenson Subject: Re: [PATCH 4/4] media: ov5647: Use gpiod_set_value_cansleep Message-ID: <20200423075557.GL5381@paasikivi.fi.intel.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Roman, On Mon, Apr 13, 2020 at 12:17:47PM +0300, Roman Kovalivskyi wrote: > From: Dave Stevenson > > All calls to the gpio library are in contexts that can sleep, > therefore there is no issue with having those GPIOs controlled > by controllers which require sleeping (eg I2C GPIO expanders). > > Switch to using gpiod_set_value_cansleep instead of gpiod_set_value > to avoid triggering the warning in gpiolib should the GPIO > controller need to sleep. > > Signed-off-by: Dave Stevenson > Signed-off-by: Roman Kovalivskyi This should be merged with the second patch. > --- > drivers/media/i2c/ov5647.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/media/i2c/ov5647.c b/drivers/media/i2c/ov5647.c > index 8a1a515388e0..07550377be2e 100644 > --- a/drivers/media/i2c/ov5647.c > +++ b/drivers/media/i2c/ov5647.c > @@ -373,7 +373,7 @@ static int ov5647_sensor_power(struct v4l2_subdev *sd, int on) > dev_dbg(&client->dev, "OV5647 power on\n"); > > if (ov5647->pwdn) { > - gpiod_set_value(ov5647->pwdn, 0); > + gpiod_set_value_cansleep(ov5647->pwdn, 0); > msleep(PWDN_ACTIVE_DELAY_MS); > } > > @@ -415,7 +415,7 @@ static int ov5647_sensor_power(struct v4l2_subdev *sd, int on) > > clk_disable_unprepare(ov5647->xclk); > > - gpiod_set_value(ov5647->pwdn, 1); > + gpiod_set_value_cansleep(ov5647->pwdn, 1); > } > > /* Update the power count. */ > @@ -648,13 +648,13 @@ static int ov5647_probe(struct i2c_client *client) > goto mutex_remove; > > if (sensor->pwdn) { > - gpiod_set_value(sensor->pwdn, 0); > + gpiod_set_value_cansleep(sensor->pwdn, 0); > msleep(PWDN_ACTIVE_DELAY_MS); > } > > ret = ov5647_detect(sd); > > - gpiod_set_value(sensor->pwdn, 1); > + gpiod_set_value_cansleep(sensor->pwdn, 1); > > if (ret < 0) > goto error; > -- > 2.17.1 > -- Sakari Ailus