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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A875CE7E644 for ; Tue, 26 Sep 2023 16:10:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229621AbjIZQKj (ORCPT ); Tue, 26 Sep 2023 12:10:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234936AbjIZQKi (ORCPT ); Tue, 26 Sep 2023 12:10:38 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2142511D; Tue, 26 Sep 2023 09:10:32 -0700 (PDT) X-IronPort-AV: E=McAfee;i="6600,9927,10845"; a="381503634" X-IronPort-AV: E=Sophos;i="6.03,178,1694761200"; d="scan'208";a="381503634" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Sep 2023 09:09:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10845"; a="892247973" X-IronPort-AV: E=Sophos;i="6.03,178,1694761200"; d="scan'208";a="892247973" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga001.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Sep 2023 09:07:59 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.97-RC0) (envelope-from ) id 1qlAcP-00000000esb-1Jq4; Tue, 26 Sep 2023 19:09:01 +0300 Date: Tue, 26 Sep 2023 19:09:01 +0300 From: Andy Shevchenko To: Duje =?utf-8?Q?Mihanovi=C4=87?= Cc: Daniel Mack , Haojian Zhuang , Robert Jarzmik , Russell King , Alan Stern , Greg Kroah-Hartman , Linus Walleij , Bartosz Golaszewski , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, linux-gpio@vger.kernel.org Subject: Re: [PATCH RFC v2 1/6] ARM: pxa: Convert Spitz OHCI to GPIO descriptors Message-ID: References: <20230926-pxa-gpio-v2-0-984464d165dd@skole.hr> <20230926-pxa-gpio-v2-1-984464d165dd@skole.hr> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230926-pxa-gpio-v2-1-984464d165dd@skole.hr> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org On Tue, Sep 26, 2023 at 05:46:22PM +0200, Duje Mihanović wrote: > Sharp's Spitz board still uses the legacy GPIO interface for controlling > a GPIO pin related to the USB host controller. > > Convert this function to use the new GPIO descriptor interface. ... > + pxa_ohci->usb_host = gpiod_get_optional(&pdev->dev, "usb-host", GPIOD_OUT_LOW); > + if (IS_ERR(pxa_ohci->usb_host)) > + dev_warn(&pdev->dev, "failed to get USB host GPIO with %pe\n", > + pxa_ohci->usb_host); No, with _optional() you should terminate the execution and bail out. The idea behind *optional* is that we skip errors only for the cases when GPIO is not provided. Otherwise we need to handle the errors (yes, the dev_err() has to be used). -- With Best Regards, Andy Shevchenko