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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id ADF2BC32793 for ; Wed, 18 Jan 2023 16:57:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=4yQA4b1MM5yjIpY66s/Mfkh6IkjYMzTwwoVW4P61A9o=; b=azBqpcMyTMF43b YkMuEdIs6JW5QSzBszemIM6ia0+VLhtQubXIQG3dVmtRMdEctE7o7QTAMZ6gKcxPrLPzFOzC3MBMX V8/VooABPyEjVnPxHp2zmcOiOamVorOuXrg7tS8iB30VkirZsy3Gktt7AXn5gM90JCOfHG8SjrPcq /OPdSPv1mIKZP/jqq6hM6Xgk1pvbnmnDWls+etlBoVQv9Hg4/FUau+29B+UdI0L3a05HO1V3Ysrsp V2DVXc23CVtr1nmnesERkIO1UvlELj6xIOnAEE/LnZz6ZqHzB9aKvsGDIF1sjLwTkG0cXDYJsGaJJ q62PXBYWbAHvWAOoBnyw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pIBjl-001vLk-K4; Wed, 18 Jan 2023 16:56:33 +0000 Received: from mail-qt1-f178.google.com ([209.85.160.178]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pIBjh-001vKW-Ty; Wed, 18 Jan 2023 16:56:31 +0000 Received: by mail-qt1-f178.google.com with SMTP id j9so7544847qtv.4; Wed, 18 Jan 2023 08:56:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=5eGZCXxPoQAmJ0txjytBJor7KBRzIjhRUq2JtcYKMyc=; b=NJ9cmTWfJcSzrGK38F5MA+e4HGrIvXbKsfkiwn3Ivp90gnsprvc7gL0PixMesTWPtH N0NQHoHxTJUg1DyffY7Q5R3iY7IW6Hn9qtMlbl30zxGGwj7thBBmrtWV7Dez471M/94L hkU0GbFax1HV4w0VCKM2UeIewYKaTbZuQr73Lz1oK+Zg2KnocfNE2XXmcsIPoAwiH/ne A+bJLmLNzhlzyM39pOj8R3XKdC2qA3cL/XEvXpolpwD956Q8j1/qN/5gUDWRYgID3xME BXeUyFDZ4CbOqD7Ep3I09aPkvmf0lmuBA27OqrNI1cYycFPT1TuTiX7bWUwahx76Qx5B 4NOw== X-Gm-Message-State: AFqh2kouNAlgyO7s1dJXRBbt4v5Y2ydWT7e92C5R0V7R83Xiz7kkASu+ SAxVqhr7vI0bERA+RqtIN16HtS1UcNtQ2Sjf X-Google-Smtp-Source: AMrXdXv4xgtmFkc8Doc9MOZFxM82HQztZRm5FOCEwcZUsViuvui6vbd/ElD3SUokdpAQ1nKKeOvr/A== X-Received: by 2002:ac8:5318:0:b0:3b1:221c:c74 with SMTP id t24-20020ac85318000000b003b1221c0c74mr9268931qtn.68.1674060987719; Wed, 18 Jan 2023 08:56:27 -0800 (PST) Received: from mail-yb1-f172.google.com (mail-yb1-f172.google.com. [209.85.219.172]) by smtp.gmail.com with ESMTPSA id bs14-20020a05620a470e00b006b95b0a714esm1950733qkb.17.2023.01.18.08.56.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 18 Jan 2023 08:56:27 -0800 (PST) Received: by mail-yb1-f172.google.com with SMTP id o75so38887312yba.2; Wed, 18 Jan 2023 08:56:27 -0800 (PST) X-Received: by 2002:a81:6e46:0:b0:37e:6806:a5f9 with SMTP id j67-20020a816e46000000b0037e6806a5f9mr952154ywc.47.1674060612772; Wed, 18 Jan 2023 08:50:12 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Geert Uytterhoeven Date: Wed, 18 Jan 2023 17:50:00 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 7/7] usb: host: ohci-exynos: Convert to devm_of_phy_optional_get() To: Alan Stern Cc: Madalin Bucur , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Horatiu Vultur , UNGLinuxDriver@microchip.com, Thierry Reding , Lorenzo Pieralisi , Rob Herring , =?UTF-8?Q?Krzysztof_Wilczy=C5=84ski?= , Bjorn Helgaas , Jonathan Hunter , Vinod Koul , Kishon Vijay Abraham I , Greg Kroah-Hartman , Krzysztof Kozlowski , Alim Akhtar , Siddharth Vadapalli , Russell King , netdev@vger.kernel.org, linux-tegra@vger.kernel.org, linux-pci@vger.kernel.org, linux-phy@lists.infradead.org, linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230118_085629_985196_7EAFE99A X-CRM114-Status: GOOD ( 25.58 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Alan, On Wed, Jan 18, 2023 at 5:26 PM Alan Stern wrote: > On Wed, Jan 18, 2023 at 11:15:20AM +0100, Geert Uytterhoeven wrote: > > Use the new devm_of_phy_optional_get() helper instead of open-coding the > > same operation. > > > > This lets us drop several checks for IS_ERR(), as phy_power_{on,off}() > > handle NULL parameters fine. > > The patch ignores a possible -ENOSYS error return. Is it known that > this will never happen? While some phy_*() dummies in include/linux/phy/phy.h do return -ENOSYS if CONFIG_GENERIC_PHY is not enabled, devm_of_phy_optional_get() returns NULL in that case, so I think this cannot happen. > > --- a/drivers/usb/host/ohci-exynos.c > > +++ b/drivers/usb/host/ohci-exynos.c > > @@ -69,19 +69,12 @@ static int exynos_ohci_get_phy(struct device *dev, > > return -EINVAL; > > } > > > > - phy = devm_of_phy_get(dev, child, NULL); > > + phy = devm_of_phy_optional_get(dev, child, NULL); > > exynos_ohci->phy[phy_number] = phy; > > if (IS_ERR(phy)) { > > - ret = PTR_ERR(phy); > > - if (ret == -EPROBE_DEFER) { > > - of_node_put(child); > > - return ret; > > - } else if (ret != -ENOSYS && ret != -ENODEV) { > > - dev_err(dev, > > - "Error retrieving usb2 phy: %d\n", ret); > > - of_node_put(child); > > - return ret; > > - } > > + of_node_put(child); > > + return dev_err_probe(dev, PTR_ERR(phy), > > + "Error retrieving usb2 phy\n"); > > } > > } > > Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel