[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2708b188-d318-6758-a5fd-8573559b2e70@huawei.com>
Date: Mon, 4 Mar 2019 09:55:37 +0800
From: Chen Yu <chenyu56@...wei.com>
To: Chunfeng Yun <chunfeng.yun@...iatek.com>
CC: <liuyu712@...ilicon.com>, <linux-usb@...r.kernel.org>,
<devicetree@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<john.stultz@...aro.org>, <suzhuangluan@...ilicon.com>,
<kongfei@...ilicon.com>, <wanghu17@...ilicon.com>,
<butao@...ilicon.com>, <chenyao11@...wei.com>,
<fangshengzhou@...ilicon.com>, <lipengcheng8@...wei.com>,
<songxiaowei@...ilicon.com>, <xuyiping@...ilicon.com>,
<xuyoujun4@...wei.com>, <yudongbin@...ilicon.com>,
<zangleigang@...ilicon.com>,
Andy Shevchenko <andy.shevchenko@...il.com>,
Arnd Bergmann <arnd@...db.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Binghui Wang <wangbinghui@...ilicon.com>,
Heikki Krogerus <heikki.krogerus@...ux.intel.com>
Subject: Re: [PATCH v3 10/12] hikey960: Support usb functionality of Hikey960
Hi Chunfeng Yun,
On 2019/3/4 9:47, Chunfeng Yun wrote:
>> +
>> + hisi_hikey_usb->role_sw = usb_role_switch_get(dev);
>> + if (!hisi_hikey_usb->role_sw)
>> + return -EPROBE_DEFER;
> Here return EPROBE_DEFFER means the related device_connection is
> registered after this probe is called, right?
> if not, use IS_ERR_OR_NULL then return PTR_ERR is enough
Yes, the driver which register the usb_role_switch may finish probe after
this driver is probed for the first time.
>> + else if (IS_ERR(hisi_hikey_usb->role_sw))
>> + return PTR_ERR(hisi_hikey_usb->role_sw);
>> +
>> + ret = usb_role_switch_register_notifier(hisi_hikey_usb->role_sw,
>> + &hisi_hikey_usb->nb);
>> + if (ret) {
>> + usb_role_switch_put(hisi_hikey_usb->role_sw);
>> + return ret;
>> + }
>> +
>> + platform_set_drvdata(pdev, hisi_hikey_usb);
>> +
>> + return 0;
>> +}
>> +
>
>
> .
>
Powered by blists - more mailing lists