From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chen Yu Subject: Re: [PATCH v3 10/12] hikey960: Support usb functionality of Hikey960 Date: Mon, 4 Mar 2019 15:31:21 +0800 Message-ID: References: <20190302090505.65542-1-chenyu56@huawei.com> <20190302090505.65542-11-chenyu56@huawei.com> <386ac0cf-cee7-bc1b-d22c-80dedff391cf@huawei.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org To: Andy Shevchenko Cc: liuyu712@hisilicon.com, USB , devicetree , Linux Kernel Mailing List , John Stultz , Suzhuangluan , Kongfei , wanghu17@hisilicon.com, butao@hisilicon.com, Yao Chen , fangshengzhou@hisilicon.com, lipengcheng8@huawei.com, songxiaowei , xu yiping , xuyoujun4@huawei.com, yudongbin@hisilicon.com, zangleigang@hisilicon.com, Chunfeng Yun , Arnd Bergmann , Greg Kroah-Hartman , Binghui Wang , Heikki Krogerus List-Id: devicetree@vger.kernel.org Hi, On 2019/3/4 14:55, Andy Shevchenko wrote: > On Mon, Mar 4, 2019 at 4:35 AM Chen Yu wrote: >> On 2019/3/3 0:01, Andy Shevchenko wrote: >>> On Sat, Mar 2, 2019 at 11:05 AM Yu Chen wrote: > >>>> +config HISI_HIKEY_USB >>>> + tristate "USB functionality of HiSilicon Hikey Platform" >>>> + depends on OF && GPIOLIB >>>> + help >>>> + If you say yes here you get support for usb functionality of HiSilicon Hikey Platform. >>> >>>> +#include >>> >>> It's hard to see why this have >>> depends on OF followed by above header inclusion. >>> >> This driver depends on devicetree, so I add "depends on OF". >> But is seems that "#include " can be removed after "of_" API >> have been removed. Thanks for your reminder! > > So, it means that technically there is no such dependency, rather > administratively. > OK. I will remove the dependent next version. >>>> + hisi_hikey_usb->typec_vbus = devm_gpiod_get(dev, "typec-vbus", >>>> + GPIOD_OUT_LOW); >>> >>>> + if (!hisi_hikey_usb->typec_vbus) >>>> + return -ENOENT; >>> >>> Hmm... Is it possible to get NULL pointer from gpiod_get() at all? >>> >>>> + if (!hisi_hikey_usb->otg_switch) >>>> + return -ENOENT; >>> >>> Ditto. >>> >> I check the comments of devm_gpio_get API, it will not return NULL pointer. >> But is it more safe to keep the NULL checking? What is your advice? > > Why do we need dead code? > OK.I will remove it. Thanks Yu Chen