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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2C502C4321E for ; Tue, 16 Nov 2021 11:34:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1B5A861A08 for ; Tue, 16 Nov 2021 11:34:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235434AbhKPLhq (ORCPT ); Tue, 16 Nov 2021 06:37:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235578AbhKPLfs (ORCPT ); Tue, 16 Nov 2021 06:35:48 -0500 Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7CC96C06121D; Tue, 16 Nov 2021 03:31:48 -0800 (PST) Received: by mail-ed1-x532.google.com with SMTP id w1so20213977edc.6; Tue, 16 Nov 2021 03:31:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Gm0iaiusdciMrx8928GSRwf0HXjOL1IswPuzIDzix+o=; b=THxRtB5bhZqhV9920ZnZeRAQUoWjdx1qnBW8txpKshjpwevq4Ax/wKdI2YmGkd26Qw dkk6/4XQvUMoWLW3wgFO+yfVmbBBxT2o9p76/W+uF0T90tSRmkeEGf1WXrbdt8F64Gju flITnryzQ+6SFgHfICuXaD43d6Q+rTmYGSTKuqnvyc/VJULeaUifCE408d0P7BWdsKqH quow204qEQQ/QGK1e5grkUyW9DP5p3ygCl2TdlosZj/nv34s1TF6J7bXuiEoMx3CZKNk /JUb8LPy6R43HMWV5mQma5/6MixmSuhk1yAKrq+jZqGKD0p433THtj5z/nDXjMH9Og3c UIjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Gm0iaiusdciMrx8928GSRwf0HXjOL1IswPuzIDzix+o=; b=HRGAvpUKjxgW6P6zXrBRnePO1EJ2WirQovAt/GHCdYdsiqKoLt/LelWthGELAaP/fn 5TISOxHVEiN68ZYUDhczE7ihQfiQXANmNd7do38Y0YNeQo9CdV+d6Q1Fq42IpDGrYnkl HF88cy7HQ2WF9CbmGtnpiwwDGcJokyhWo1rRuH+TiyTEsT/zHAyZVh0vDzE5c4JRT2yh L0S8yccDEaH4eIO5hZbjHggEHiBoxsnUEb1egqq6lsY0+DKMnDgh+35PnUgnQ17sDKxx kkDmG2N5uCwhU0p/sICUyQWbDzhQgGNOqvUqOZMCsUGgZGSG1opsxcbsjwYT3uOrZWit iq2w== X-Gm-Message-State: AOAM533LrfOxZyL7xVhTSSrD+PHzGUGbsbEkCutiDxAhPuOiXkXntjfB btkdUh5R0gqbvv9J2BGlV9BzbDMxhqkSo8WSv+g= X-Google-Smtp-Source: ABdhPJzQfh6CnE+Adt6rJoKUiS8IbAoxCjDjjVO60IzlqtV3MQ7qPZyGGziK9o6lTdlwriGZeqCUvxgSVdNIo4hymlI= X-Received: by 2002:a17:907:9196:: with SMTP id bp22mr8705569ejb.69.1637062306909; Tue, 16 Nov 2021 03:31:46 -0800 (PST) MIME-Version: 1.0 References: <20211114170335.66994-1-hdegoede@redhat.com> <20211114170335.66994-18-hdegoede@redhat.com> In-Reply-To: From: Andy Shevchenko Date: Tue, 16 Nov 2021 13:31:05 +0200 Message-ID: Subject: Re: [PATCH v2 17/20] extcon: intel-cht-wc: Support devs with Micro-B / USB-2 only Type-C connectors To: Hans de Goede Cc: "Rafael J . Wysocki" , Mika Westerberg , Mark Gross , Andy Shevchenko , Wolfram Sang , Sebastian Reichel , MyungJoo Ham , Chanwoo Choi , Ard Biesheuvel , Len Brown , ACPI Devel Maling List , Yauhen Kharuzhy , Tsuchiya Yuto , Platform Driver , linux-i2c , Linux PM , Linux Kernel Mailing List , linux-efi Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 16, 2021 at 1:28 PM Andy Shevchenko wrote: > On Sun, Nov 14, 2021 at 7:04 PM Hans de Goede wrote: ... > > + ext->vbus_boost = devm_regulator_get_optional(ext->dev, "vbus"); > > + if (IS_ERR(ext->vbus_boost)) { > > + ret = PTR_ERR(ext->vbus_boost); > > + if (ret == -ENODEV) > > + ret = -EPROBE_DEFER; > > + > > + return dev_err_probe(ext->dev, ret, "getting vbus regulator"); > > Can be also written as > > if (PTR_ERR(ext->vbus_boost) == -ENODEV || > PTR_ERR(ext->vbus_boost) == -EPROBE_DEFER) > return dev_err_probe(ext->dev, -EPROBE_DEFER, "getting vbus regulator"); > > return PTR_ERR(ext->vbus_boost); Oops, other way around, of course. if (PTR_ERR(ext->vbus_boost) == -ENODEV || PTR_ERR(ext->vbus_boost) == -EPROBE_DEFER) return -EPROBE_DEFER; return dev_err_probe(ext->dev, PTR_ERR(ext->vbus_boost), "getting vbus regulator"); > but up to you. > > > + } -- With Best Regards, Andy Shevchenko