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 D4F25C05027 for ; Fri, 20 Jan 2023 08:05:50 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/jaDQzm8yJGObZx2MWvkzv2sYY7Q/PUruEu0S6benCQ=; b=p4qWRfq97ht9tn j0LfPxuQMdx6vHnb2jQ4FZuewEHsFM1pav1M/gOtgvgiiPBTzBrNhZcIx0e/AEazfLO+KOIkEwQUv frVHxZXb4QX6Cc4Hrk+11ehl+X2PHgkUn4rmKJ6qGtqkn2yvvis0dIZPLJN+MpGR6FNmzOSMA5oAh NkGKSvzOt6DIGpFLa2OEp59SMoL6pNvxacoW5eCfu3GObhT4a9Ms68H3s6U2EUyUtFPvygU3HiBRc QQZVl1biiUGVy7bNqEPzuEQCxinvkklZtGMBl6HtifFPN3RxWYuv3BTwhVMvhqO9XrK6ZJOUUzUE6 SMgZVv40h0SzkVa1eF6Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pImOG-008w03-VL; Fri, 20 Jan 2023 08:04:49 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pImOC-008vyP-KA; Fri, 20 Jan 2023 08:04:46 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 0AB78B82071; Fri, 20 Jan 2023 08:04:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C962BC433D2; Fri, 20 Jan 2023 08:04:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674201881; bh=ddZ781LlQNDNgJDsumMrpxwZeLDaEtSDv9QvaApUzp8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jLY4RLPayUpA4+ykcD7mNqlzP1BnH2Dy/DJzQYURwXEBfqT6VzyheJu10hr1IVYIb 85TbtBgYf8GQ+K2dTeYmBMMQwsoa4RyH5Pj6s1qVUciSJue9ZmBXKgO8mv0E6tU9aN WHrXJ7f1nOgrHtdizE3/rFnB3OPpJWobuTf/C9h146PD4XWNxfWsL7jzAo4t9DE50L 0QXq1QRq9LZWGwwDYDi3I+OLy/m54tZnF8C7zxqUVRcsOW3bDQA/Za8OmLXpbdUGKC suCEVZKbikzCrl8ap+D/iMhvQSnOj2cIsHcfcFkzvDw5OE3pDgndn3muXhxYXe2/+j PG+c6DZUmzx4w== Date: Fri, 20 Jan 2023 13:34:37 +0530 From: Vinod Koul To: Geert Uytterhoeven Cc: Rob Herring , Madalin Bucur , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Horatiu Vultur , UNGLinuxDriver@microchip.com, Thierry Reding , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Bjorn Helgaas , Jonathan Hunter , Kishon Vijay Abraham I , Alan Stern , 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 Subject: Re: [PATCH 7/7] usb: host: ohci-exynos: Convert to devm_of_phy_optional_get() Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230120_000444_999444_E97699B5 X-CRM114-Status: GOOD ( 42.09 ) 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 On 20-01-23, 08:56, Geert Uytterhoeven wrote: > Hi Rob, > > On Wed, Jan 18, 2023 at 8:49 PM Rob Herring wrote: > > On Wed, Jan 18, 2023 at 12:28 PM Geert Uytterhoeven > > wrote: > > > On Wed, Jan 18, 2023 at 6:30 PM Rob Herring wrote: > > > > On Wed, Jan 18, 2023 at 4:15 AM 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. > > > > > > > > > > Signed-off-by: Geert Uytterhoeven > > > > > --- > > > > > drivers/usb/host/ohci-exynos.c | 24 +++++++----------------- > > > > > 1 file changed, 7 insertions(+), 17 deletions(-) > > > > > > > > > > diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c > > > > > index 8d7977fd5d3bd502..8dd9c3b2411c383f 100644 > > > > > --- 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"); > > > > > > > > Optional is really the only reason for the caller to decide whether to > > > > print an error message or not. If we have both flavors of 'get', then > > > > really the 'get' functions should print an error message. > > > > > > In case of a real error, both should print an error message, right? > > > > > > Anyway, I understand that's a three step operation: > > > 1. Introduce and convert to the _optional variant, > > > 2. Add error printing to callees. > > > 3. Remove error printing from callers. > > > > I think you only need 2 out of 3 steps depending on the situation. In > > this case, you can add error printing in the _optional variant when > > you introduce it and then convert callers to it. > > > > Where we already have an optional variant, then you need steps 2 and 3. > > Right, so the error printing can be done now, while introducing > devm_of_phy_optional_get(). > > Vinod: Do you agree? Ack.. IMO makes it better that way > If yes, I can respin with that change. ok > If not, I'll have to respin anyway, as the bug in > am65_cpsw_init_serdes_phy() has been fixed in the meantime. > > Thanks! > > 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-phy mailing list > linux-phy@lists.infradead.org > https://lists.infradead.org/mailman/listinfo/linux-phy -- ~Vinod _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel